aboutsummaryrefslogtreecommitdiff
path: root/dc
diff options
context:
space:
mode:
Diffstat (limited to 'dc')
-rw-r--r--dc/dc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/dc/dc.c b/dc/dc.c
index b90cca7..863c06b 100644
--- a/dc/dc.c
+++ b/dc/dc.c
@@ -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;
}