aboutsummaryrefslogtreecommitdiff
path: root/render/render_text.h
diff options
context:
space:
mode:
Diffstat (limited to 'render/render_text.h')
-rw-r--r--render/render_text.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/render/render_text.h b/render/render_text.h
new file mode 100644
index 0000000..e7474ff
--- /dev/null
+++ b/render/render_text.h
@@ -0,0 +1,18 @@
+#ifndef RENDER_TEXT_H
+#define RENDER_TEXT_H
+
+#include <SDL.h>
+
+typedef struct {
+ SDL_Texture *tex;
+ int cw[128];
+} txtd;
+
+void char_width_init (int *char_width);
+int get_text_width (char str[], txtd *t);
+
+void render_text (SDL_Renderer* gRenderer, char str[], float off[], txtd *t);
+void render_text_scaled (SDL_Renderer* gRenderer, char str[],
+ float off[], txtd *t, float scale);
+
+#endif \ No newline at end of file