summaryrefslogtreecommitdiff
path: root/src/static-ui.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-06-17 11:12:54 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-06-17 11:12:54 -0400
commit48f56a7e5db638fb3526277513b8f14cbe405398 (patch)
tree36d3b013d704a35d0a0a9315df887f4857ed224e /src/static-ui.cpp
parent66ebed74456f76277597b3b07f3e67cc45388ece (diff)
pke: expose colors for FontRender and pke_ui_box
Diffstat (limited to 'src/static-ui.cpp')
-rw-r--r--src/static-ui.cpp9
1 files changed, 5 insertions, 4 deletions
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<pke_ui_box_instance_buffer_item> &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;
}
}