aboutsummaryrefslogtreecommitdiff
path: root/dc/dc.c
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-11 09:15:33 -0400
committeriamcheeseman <[email protected]>2026-05-11 09:15:33 -0400
commit2460fd470eb4839252266f61449587dd20de4ddd (patch)
tree0cdb83e86ffc5e1b5392e0dca27b600eb07e7709 /dc/dc.c
parent9f06f971752b5cbbb76cc15543f66b80eabd707f (diff)
make the test project less cancerous
Diffstat (limited to 'dc/dc.c')
-rw-r--r--dc/dc.c63
1 files changed, 26 insertions, 37 deletions
diff --git a/dc/dc.c b/dc/dc.c
index bccc82f..69df3f8 100644
--- a/dc/dc.c
+++ b/dc/dc.c
@@ -21,43 +21,12 @@ void tick(void)
ty_draw_clear(TY_COLOR_BLACK);
- for (int y = 0; y < SCREEN_HEIGHT; y += 16) {
- for (int x = 0; x < SCREEN_WIDTH; x += 16) {
- ty_draw_image(img, ty_vec2i(x, y));
- }
- }
-
- ty_draw_rect(
- (struct ty_recti){
- SCREEN_WIDTH*0.5 + sin(ty_get_time() * 10) * 50 - 25,
- SCREEN_HEIGHT*0.5-25,
- 50, 50,
- },
- TY_COLOR_RED
- );
-
- ty_draw_line(
- ty_vec2i(0, 0),
- ty_vec2i(100, 100),
- ty_color(0xFF, 0xF0, 0x80)
- );
-
- ty_draw_line(
- ty_vec2i(100, 0),
- ty_vec2i(0, 100),
- ty_color(0x80, 0xF0, 0xFF)
- );
-
- ty_draw_line(
- ty_vec2i(150, 0),
- ty_vec2i(150, 100),
- ty_color(0x80, 0xF0, 0xFF)
- );
-
- ty_draw_line(
- ty_vec2i(100, 50),
- ty_vec2i(200, 50),
- ty_color(0xFF, 0xF0, 0x80)
+ ty_draw_image(
+ img,
+ ty_vec2i(
+ SCREEN_WIDTH*0.5 + sin(ty_get_time() * 10) * 50 - (img.width*0.5),
+ SCREEN_HEIGHT*0.5 - (img.height*0.5)
+ )
);
ty_draw_text(&font, ty_vec2i(5, SCREEN_HEIGHT - 5 - 8), "hello, world!");
@@ -98,6 +67,23 @@ void tick(void)
(int)(1.0 / frame_time)
);
+ int y = 5+24;
+ ty_draw_text(&font, ty_vec2i(5, y),
+ "abcdefghijklmnopqrstuvwxyz"
+ );
+ y += 8;
+ ty_draw_text(&font, ty_vec2i(5, y),
+ "0123456789"
+ );
+ y += 8;
+ ty_draw_text(&font, ty_vec2i(5, y),
+ "!\"'#$%&()*+,-./@[]\\"
+ );
+ y += 8;
+ ty_draw_text(&font, ty_vec2i(5, y),
+ "^_`{}|~:;<>=? "
+ );
+
ty_draw_end();
}
@@ -160,6 +146,9 @@ int main(void)
ty_free_image(img);
ty_free_image(font_img);
+ for (int i = 0; i < CHAR_MAX; i++)
+ ty_free_image(font.glyphs[i]);
+
ty_deinit();
return 0;
}