mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-21 03:05:00 -07:00
first pass at custom window border
This commit is contained in:
@@ -337,6 +337,7 @@ typedef struct UI_ImageDrawData UI_ImageDrawData;
|
||||
struct UI_ImageDrawData
|
||||
{
|
||||
R_Handle texture;
|
||||
R_Tex2DSampleKind sample_kind;
|
||||
Rng2F32 region;
|
||||
Vec4F32 tint;
|
||||
F32 blur;
|
||||
@@ -350,7 +351,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_image_draw)
|
||||
R_Rect2DInst *inst = d_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
}
|
||||
else
|
||||
else D_Tex2DSampleKindScope(draw_data->sample_kind)
|
||||
{
|
||||
R_Rect2DInst *inst = d_img(box->rect, draw_data->region, draw_data->texture, draw_data->tint, 0, 0, 0);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
@@ -371,11 +372,12 @@ internal UI_BOX_CUSTOM_DRAW(ui_image_draw)
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_image(R_Handle texture, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string)
|
||||
ui_image(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_string(UI_BoxFlag_Clickable, string);
|
||||
UI_ImageDrawData *draw_data = push_array(ui_build_arena(), UI_ImageDrawData, 1);
|
||||
draw_data->texture = texture;
|
||||
draw_data->sample_kind = sample_kind;
|
||||
draw_data->region = region;
|
||||
draw_data->tint = tint;
|
||||
draw_data->blur = blur;
|
||||
@@ -385,14 +387,14 @@ ui_image(R_Handle texture, Rng2F32 region, Vec4F32 tint, F32 blur, String8 strin
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_imagef(R_Handle texture, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...)
|
||||
ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
UI_Signal result = ui_image(texture, region, tint, blur, string);
|
||||
UI_Signal result = ui_image(texture, sample_kind, region, tint, blur, string);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user