diff options
| author | iamcheeseman <[email protected]> | 2026-05-13 21:24:21 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-13 21:24:21 -0400 |
| commit | 8d2793e9ef7cf7f742ec23e77c44ac21a624d01f (patch) | |
| tree | c8263278076d7c7fd575cfcf0dc35703e8dc426e /dc/dc.c | |
| parent | 13e6f3d8403f0fdbed4ead1d8eda4d9ed68ac080 (diff) | |
start ui
Diffstat (limited to 'dc/dc.c')
| -rw-r--r-- | dc/dc.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -2,6 +2,7 @@ #include <math.h> #include <teensy.h> +#include <teensy_ui.h> #include <time.h> #define QOI_IMPLEMENTATION @@ -14,6 +15,7 @@ ty_Image img; ty_Font font = {}; +tyui_Id winid = 0; double last_frame = 0; @@ -115,13 +117,19 @@ void tick(void) "^_`{}|~:;<>=? " ); y += 8; - ty_draw_text(&font, ty_vec2i(5, y), - "THe_value = MY_arr[15]" - ); - y += 8; - ty_draw_end(); + if (tyui_begin_window("Test Window", ty_recti(5, 5, 100, 100), &winid)) { + for (int i = 0; i < 20; i++) + tyui_text("super duper awesome example text"); + tyui_end_window(); + } + + tyui_draw(); + ty_Vec2i mouse_pos = ty_mouse_pos(); + ty_draw_rect(ty_recti(mouse_pos.x, mouse_pos.y, 1, 1), TY_COLOR_RED); + + ty_draw_end(); } ty_Image load_qoi_image(const char *path) @@ -145,6 +153,7 @@ int main(void) .ticrate = 60, }; ty_init(hints); + tyui_init(&font); img = load_qoi_image("test_img.qoi"); @@ -191,6 +200,7 @@ int main(void) ty_free_image(glyph); } + tyui_deinit(); ty_deinit(); return 0; } |
