diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-01-14 10:13:39 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-01-14 10:13:39 -0500 |
commit | 969c64da6a63e6c0efa1b79a317ef953cb3aaaa9 (patch) | |
tree | 3cb0d32988e6231886a0f1e9c88b97805ab92d4d /src/sdl/draw-text.h | |
parent | bb9cf9472cad42ad80a53ab4523cabba71978583 (diff) | |
download | sok-969c64da6a63e6c0efa1b79a317ef953cb3aaaa9.tar.bz2 sok-969c64da6a63e6c0efa1b79a317ef953cb3aaaa9.zip |
add text_style_t, draw-text.c
Diffstat (limited to 'src/sdl/draw-text.h')
-rw-r--r-- | src/sdl/draw-text.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/sdl/draw-text.h b/src/sdl/draw-text.h new file mode 100644 index 0000000..b58c1c1 --- /dev/null +++ b/src/sdl/draw-text.h @@ -0,0 +1,35 @@ +#ifndef DRAW_TEXT_H +#define DRAW_TEXT_H + +#include "../libsok/sok.h" // sok_pos_t +#include <SDL.h> // SDL_Color +#include <SDL_ttf.h> // TTF_Font + +typedef enum { + TEXT_ALIGN_TOP_LEFT, + TEXT_ALIGN_TOP_CENTER, + TEXT_ALIGN_TOP_RIGHT, + TEXT_ALIGN_CENTER_LEFT, + TEXT_ALIGN_CENTER_CENTER, + TEXT_ALIGN_CENTER_RIGHT, + TEXT_ALIGN_BOTTOM_LEFT, + TEXT_ALIGN_BOTTOM_RIGHT, + TEXT_ALIGN_BOTTOM_CENTER, + TEXT_ALIGN_LAST, +} text_align_t; + +typedef struct { + const text_align_t align; + const sok_pos_t pad; + const SDL_Color colors[2]; +} text_style_t; + +void +draw_text( + SDL_Renderer * const, + TTF_Font * const, + const text_style_t * const, + const char * const +); + +#endif /* DRAW_TEXT_H */ |