diff options
Diffstat (limited to 'include/mgl/graphics/text.h')
-rw-r--r-- | include/mgl/graphics/text.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/mgl/graphics/text.h b/include/mgl/graphics/text.h new file mode 100644 index 0000000..bb07675 --- /dev/null +++ b/include/mgl/graphics/text.h @@ -0,0 +1,23 @@ +#ifndef MGL_TEXT_H +#define MGL_TEXT_H + +#include "../system/vec.h" +#include "color.h" + +typedef struct mgl_font mgl_font; +typedef struct mgl_context mgl_context; + +typedef struct { + mgl_font *font; + const char *text; + mgl_color color; + mgl_vec2f position; +} mgl_text; + +/* Note: keeps a reference to |text|. |text| needs to be valid as long as |self| is used. */ +int mgl_text_init(mgl_text *self, mgl_font *font, const char *text, float x, float y); +void mgl_text_deinit(mgl_text *self); + +void mgl_text_draw(mgl_context *context, mgl_text *text); + +#endif /* MGL_TEXT_H */ |