mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[ui] Give panels/windows a group offset
This allows for finer control of render order and thus layering (will be important for menus).
This commit is contained in:
parent
313aa116f8
commit
1404b85846
2 changed files with 4 additions and 2 deletions
|
@ -76,6 +76,7 @@ typedef struct imui_window_s {
|
||||||
int ypos;
|
int ypos;
|
||||||
int xlen;
|
int xlen;
|
||||||
int ylen;
|
int ylen;
|
||||||
|
int group_offset;
|
||||||
int mode;
|
int mode;
|
||||||
bool is_open;
|
bool is_open;
|
||||||
bool is_collapsed;
|
bool is_collapsed;
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
#define c_color (ctx->tsys.text_base + text_color)
|
#define c_color (ctx->tsys.text_base + text_color)
|
||||||
#define c_fill (ctx->csys.base + canvas_fill)
|
#define c_fill (ctx->csys.base + canvas_fill)
|
||||||
|
|
||||||
#define imui_draw_group ((1 << 15) - 1)
|
#define imui_draw_group ((1 << 14) - 1)
|
||||||
#define imui_ontop ((1 << 15) - 1)
|
#define imui_ontop ((1 << 15) - 1)
|
||||||
#define imui_onbottom (-(1 << 15) + 1)
|
#define imui_onbottom (-(1 << 15) + 1)
|
||||||
|
|
||||||
|
@ -1062,7 +1062,8 @@ IMUI_StartPanel (imui_ctx_t *ctx, imui_window_t *panel)
|
||||||
DARRAY_APPEND (&ctx->parent_stack, ctx->current_parent);
|
DARRAY_APPEND (&ctx->parent_stack, ctx->current_parent);
|
||||||
|
|
||||||
auto canvas = Canvas_New (ctx->csys);
|
auto canvas = Canvas_New (ctx->csys);
|
||||||
*Canvas_DrawGroup (ctx->csys, canvas) = imui_draw_group;
|
int draw_group = imui_draw_group + panel->group_offset;
|
||||||
|
*Canvas_DrawGroup (ctx->csys, canvas) = draw_group;
|
||||||
auto panel_view = Canvas_GetRootView (ctx->csys, canvas);
|
auto panel_view = Canvas_GetRootView (ctx->csys, canvas);
|
||||||
state->entity = panel_view.id;
|
state->entity = panel_view.id;
|
||||||
panel->mode = update_hot_active (ctx, old_entity, state->entity);
|
panel->mode = update_hot_active (ctx, old_entity, state->entity);
|
||||||
|
|
Loading…
Reference in a new issue