Remove predefined colours and allow user to pass colour as param
This commit is contained in:
12
include/ui.h
12
include/ui.h
@@ -31,6 +31,12 @@ struct ui_elem {
|
||||
ui_elem_type_t type;
|
||||
};
|
||||
|
||||
typedef struct ui_elem_colours ui_elem_colours_t;
|
||||
struct ui_elem_colours {
|
||||
colour_t fill;
|
||||
colour_t border;
|
||||
};
|
||||
|
||||
struct ui_ctx {
|
||||
u64 count;
|
||||
i64 hovered;
|
||||
@@ -49,7 +55,9 @@ void init_ui_ctx(ui_ctx_t *ctx);
|
||||
void reset_ui_ctx(ui_ctx_t *ctx);
|
||||
void handle_ui_events(const window_t *wnd, ui_ctx_t *ctx,
|
||||
const SDL_Event *event);
|
||||
bool button(const window_t *wnd, ui_ctx_t *ctx, rect_t rect);
|
||||
rect_t node(const window_t *wnd, ui_ctx_t *ctx, rect_t rect);
|
||||
bool button(const window_t *wnd, ui_ctx_t *ctx, rect_t rect,
|
||||
ui_elem_colours_t colours);
|
||||
rect_t node(const window_t *wnd, ui_ctx_t *ctx, rect_t rect,
|
||||
ui_elem_colours_t colours);
|
||||
|
||||
#endif // !UI_H
|
||||
|
||||
Reference in New Issue
Block a user