aboutsummaryrefslogtreecommitdiff
path: root/include/strings33.h
diff options
context:
space:
mode:
authorpk33 <pk33@pk33.space>2024-11-03 22:26:28 +0100
committerpk33 <pk33@pk33.space>2024-11-03 22:26:28 +0100
commit0ffb4f8463e3e06e8d88b7be22f5cb7adb702361 (patch)
tree05e626d6ce4e0d8e544a40f8a14965cf4fdd5780 /include/strings33.h
parent6c69ea8da9d306e4e6d21d0feee5213fea15f49e (diff)
downloadengine33-0ffb4f8463e3e06e8d88b7be22f5cb7adb702361.tar.gz
fonts, text and basic ui for on-screen log
Diffstat (limited to 'include/strings33.h')
-rw-r--r--include/strings33.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/strings33.h b/include/strings33.h
new file mode 100644
index 0000000..c987690
--- /dev/null
+++ b/include/strings33.h
@@ -0,0 +1,42 @@
+#ifndef __STRINGS_H__
+#define __STRINGS_H__
+
+#include "types.h"
+#include "display.h"
+#include "system.h"
+
+
+#define E33_MAX_GLYPH_PLOTS 256
+#define E33_MAX_FONT_GLYPHS 256
+
+#define E33_FONT_DEFAULT 0
+#define E33_FONT_BIG 1
+
+#define quprint( s, x, y, str ) e33_uprint( s, E33_FONT_DEFAULT, WHITE, x, y, str );
+#define quprintf( s, x, y, frm, ... ) e33_uprintf( s, E33_FONT_DEFAULT, WHITE, x, y, frm, ##__VA_ARGS__ );
+#define suprint( f, c, x, y, str ) e33_uprint( &__display.surface, f, c, x, y, str );
+#define suprintf( f, c, x, y, frm, ... ) e33_uprintf( &__display.surface, f, c, x, y, frm, ##__VA_ARGS__ );
+#define qsuprint( str, x, y ) e33_uprint( &__display.surface, E33_FONT_DEFAULT, WHITE, x, y, str );
+#define qsuprintf( x, y, frm, ... ) e33_uprintf( &__display.surface, E33_FONT_DEFAULT, WHITE, x, y, frm, ##__VA_ARGS__ )
+
+
+typedef struct {
+ Size num_plots;
+ Size width;
+ u16 plots[ E33_MAX_GLYPH_PLOTS ];
+} FontGlyph33;
+
+typedef struct {
+ Size xShift, yAnd;
+ Size height;
+ Size num_glyphs;
+ Size maxGlyphWidth;
+ FontGlyph33 glyphs[ E33_MAX_FONT_GLYPHS ];
+} Font33;
+
+
+void e33_uprint( Surface *surf, Size font, u32 col, Size x, Size y, String str );
+void e33_uprintf( Surface *surf, Size font, u32 col, Size x, Size y, String fmt, ... );
+
+
+#endif /* __STRING_H__ */