aboutsummaryrefslogtreecommitdiff
path: root/teensy/teensy.h
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-11 08:42:59 -0400
committeriamcheeseman <[email protected]>2026-05-11 08:42:59 -0400
commitcd15c9789c9eeb9ec2fa367c39872685597e0c17 (patch)
treedf52093b99ba7bb7d1ce7903caed487df382b803 /teensy/teensy.h
parent18a5d0af4664a1e50d1e69a5ecbcd91a34246ed4 (diff)
text rendering
Diffstat (limited to 'teensy/teensy.h')
-rw-r--r--teensy/teensy.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/teensy/teensy.h b/teensy/teensy.h
index 1f082f9..0b7829c 100644
--- a/teensy/teensy.h
+++ b/teensy/teensy.h
@@ -1,6 +1,8 @@
#ifndef TEENSY_H_
#define TEENSY_H_
+#include <limits.h>
+
#include "teensy_common.h"
#include "teensy_context.h"
#include "teensy_list.h"
@@ -68,6 +70,10 @@ struct ty_image {
int height;
};
+struct ty_font {
+ struct ty_image glyphs[CHAR_MAX];
+};
+
struct ty_renderer {
struct ty_image screen;
};
@@ -92,6 +98,9 @@ void ty_img_set_pixel(
struct ty_color color
);
+void ty_font_add_glyph(struct ty_font *font, uint8_t c, struct ty_image img);
+int ty_font_width(struct ty_font *font, const char *fmt, ...);
+
void ty_draw_clear(struct ty_color col);
void ty_draw_image(struct ty_image img, struct ty_vec2i pos);
void ty_draw_image_ex(
@@ -105,6 +114,13 @@ void ty_draw_line(
struct ty_vec2i end,
struct ty_color color
);
+void ty_draw_text(struct ty_font *font, struct ty_vec2i pos, const char *text);
+void ty_draw_text_fmt(
+ struct ty_font *font,
+ struct ty_vec2i pos,
+ const char *fmt,
+ ...
+);
void ty_draw_end(void);
void ty_sleep(uint64_t ms);