diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-18 14:14:23 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-18 14:14:23 +0100 |
commit | 5f0fce4191309e9526b7109a0d87c092ce6a4193 (patch) | |
tree | 105257f876551814aa74a0760ec116bd1bf307a5 /render/render_text.h | |
parent | ead78d51e662057467b79d3a65b20c4ba83cbf07 (diff) |
main
Diffstat (limited to 'render/render_text.h')
-rw-r--r-- | render/render_text.h | 18 |
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 |