summaryrefslogtreecommitdiff
path: root/src/static-ui.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-06-12 08:51:08 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-06-12 08:51:08 -0400
commit61d024686403b7be8d6cbd3cd9c5aeaf39b445af (patch)
tree0c3a6e55e3ea44202df56c482a5cecf09da954b4 /src/static-ui.cpp
parent0f89d12e747b380b35143815a2c8e87c6ee752d4 (diff)
pke: move ui colors to instance buffer
Diffstat (limited to 'src/static-ui.cpp')
-rw-r--r--src/static-ui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/static-ui.cpp b/src/static-ui.cpp
index 34887d9..c6b7108 100644
--- a/src/static-ui.cpp
+++ b/src/static-ui.cpp
@@ -19,6 +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::vec2 px_scale;
float depth;
float padding[1];
@@ -236,6 +238,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.px_scale.x = (2.0 / (float)Extent.width);
tmp.px_scale.y = (2.0 / (float)Extent.height);
tmp.depth = (float)box->layer;