diff options
Diffstat (limited to 'teensy/teensy.h')
| -rw-r--r-- | teensy/teensy.h | 16 |
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); |
