summaryrefslogtreecommitdiff
path: root/examples/ui.c
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2025-01-16 19:09:09 +0100
committerMitya Selivanov <automainint@guattari.tech>2025-01-16 19:09:09 +0100
commit39aad7f9ca931342f58bf638b5aadd1923db0f50 (patch)
tree14c39e0a532d60a48227c7b2c023c13004620960 /examples/ui.c
parent6f72e6bea5d3c18f342a3c460d4ae8a4a776b659 (diff)
downloadreduced_system_layer-39aad7f9ca931342f58bf638b5aadd1923db0f50.zip
Graphics fixes
Diffstat (limited to 'examples/ui.c')
-rw-r--r--examples/ui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/ui.c b/examples/ui.c
index 8375e4d..c10a9c6 100644
--- a/examples/ui.c
+++ b/examples/ui.c
@@ -60,11 +60,11 @@ void update_and_render_frame(void) {
f64 x0 = w / 2.0;
f64 y0 = h / 2.0;
- vec3_f32 color = { 1.f, .5f, .5f };
+ vec4_f32 color = { 1.f, .5f, .5f, 1.f };
if (g_platform.cursor_x >= x0 && g_platform.cursor_x < x0 + w &&
g_platform.cursor_y >= y0 && g_platform.cursor_y < y0 + h)
- color = (vec3_f32) { 1.f, 1.f, 1.f };
+ color = (vec4_f32) { 1.f, 1.f, 1.f, 1.f };
for (i64 i = 0; i < g_platform.input_size; ++i)
if (g_platform.input[i].ctrl)
@@ -223,8 +223,8 @@ void update_and_render_frame(void) {
}
draw_text_area(RGB(0.f, 0.f, 0.f), x0 + 8, y0 - 8, w, h, 10., 10., text_len, text);
- draw_text_area((Brush) { .color = with_alpha(color, 1.f) }, x0, y0, w, h, 10., 10., text_len, text);
- draw_text_cursor((Brush) { .xor_color = 1, .color = { 1.f, 1.f, 1.f, 1.f } }, x0, y0, w, h, 10., 10., cursor, selection, text_len, text);
+ draw_text_area((Brush) { .color = color, }, x0, y0, w, h, 10., 10., text_len, text);
+ draw_text_cursor((Brush) { .xor_color = 1, .color = { 1.f, 1.f, 1.f, 1.f }, }, x0, y0, w, h, 10., 10., cursor, selection, text_len, text);
p_render_frame();
}