From d4f820e37bbb6571af4587adb2a3b3519d76849a Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sat, 5 Oct 2024 08:28:22 +0200 Subject: Draw triangles and lines --- examples/ui.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'examples/ui.c') diff --git a/examples/ui.c b/examples/ui.c index 0847af3..4730a9d 100755 --- a/examples/ui.c +++ b/examples/ui.c @@ -59,12 +59,12 @@ i32 main(i32 argc, c8 **argv) { if (platform.cursor_x >= 40 && platform.cursor_x < 100 && platform.cursor_y >= 40 && platform.cursor_y < 100) { button_0_down = platform.key_down[BUTTON_LEFT]; if (button_0_down) - draw_panel(OP_SET, 0xffffff, 40, 40, 60, 60); + fill_rectangle(OP_SET, 0xffffff, 40, 40, 60, 60); else - draw_panel(OP_SET, 0x00ff00, 40, 40, 60, 60); + fill_rectangle(OP_SET, 0x00ff00, 40, 40, 60, 60); } else { button_0_down = 0; - draw_panel(OP_SET, 0x208020, 40, 40, 60, 60); + fill_rectangle(OP_SET, 0x208020, 40, 40, 60, 60); } if (platform.cursor_x >= 40 && platform.cursor_x < 100 && platform.cursor_y >= 120 && platform.cursor_y < 180) { @@ -72,17 +72,17 @@ i32 main(i32 argc, c8 **argv) { if (platform.key_pressed[BUTTON_LEFT]) button_1_checked = !button_1_checked; if (button_1_down) - draw_panel(OP_SET, 0xffffff, 40, 120, 60, 60); + fill_rectangle(OP_SET, 0xffffff, 40, 120, 60, 60); else if (button_1_checked) - draw_panel(OP_SET, 0xff8080, 40, 120, 60, 60); + fill_rectangle(OP_SET, 0xff8080, 40, 120, 60, 60); else - draw_panel(OP_SET, 0x80ff80, 40, 120, 60, 60); + fill_rectangle(OP_SET, 0x80ff80, 40, 120, 60, 60); } else { button_1_down = 0; if (button_1_checked) - draw_panel(OP_SET, 0xff0000, 40, 120, 60, 60); + fill_rectangle(OP_SET, 0xff0000, 40, 120, 60, 60); else - draw_panel(OP_SET, 0x00ff00, 40, 120, 60, 60); + fill_rectangle(OP_SET, 0x00ff00, 40, 120, 60, 60); } i64 w = platform.frame_width / 2; @@ -246,7 +246,7 @@ i32 main(i32 argc, c8 **argv) { draw_text_area(0, x0 + 8, y0 - 8, w, h, 10., 10., text_len, text); draw_text_area(color, x0, y0, w, h, 10., 10., text_len, text); - draw_text_cursor(0xffffff, x0, y0, w, h, 10., 10., cursor, selection, text_len, text); + draw_selection_cursor(0xffffff, x0, y0, w, h, 10., 10., cursor, selection, text_len, text); p_render_frame(); } -- cgit v1.2.3