From 48f56a7e5db638fb3526277513b8f14cbe405398 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 17 Jun 2025 11:12:54 -0400 Subject: pke: expose colors for FontRender and pke_ui_box --- src/static-ui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/static-ui.cpp') diff --git a/src/static-ui.cpp b/src/static-ui.cpp index 81e0511..68fd551 100644 --- a/src/static-ui.cpp +++ b/src/static-ui.cpp @@ -19,8 +19,8 @@ TypeSafeInt_B(PKE_UI_BOX_FLAG); struct pke_ui_box_instance_buffer_item { glm::mat4 pos_scale; - glm::vec4 border_color; - glm::vec4 background_color; + glm::vec4 color_border; + glm::vec4 color_background; glm::vec2 px_scale; float depth; float padding[1]; @@ -242,8 +242,8 @@ void pke_ui_calc_px(pk_arr_t &buffer, pke_ui_fl pke_ui_box_instance_buffer_item tmp{}; tmp.pos_scale = glm::translate(glm::mat4(1), translate); tmp.pos_scale = glm::scale(tmp.pos_scale, scale); - tmp.border_color = glm::vec4(1.0, 0.0, 0.0, 1.0); - tmp.background_color = glm::vec4(0.2, 0.3, 0.2, 0.5); + tmp.color_border = box->color_border; + tmp.color_background = box->color_background; tmp.px_scale.x = (2.0 / (float)Extent.width); tmp.px_scale.y = (2.0 / (float)Extent.height); tmp.depth = (float)box->layer; @@ -471,6 +471,7 @@ void pke_ui_internal_new_typed_box(pke_ui_box *box, const PKE_UI_BOX_TYPE type) case PKE_UI_BOX_TYPE_INPUT_TEXT: break; default: + assert(true == false && "unknown pke_ui_box::type"); break; } } -- cgit v1.2.3