diff options
Diffstat (limited to 'src/text.h')
| -rw-r--r-- | src/text.h | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -1,5 +1,6 @@ #pragma once +#include "atlas.h" #include "cglm/types.h" #include "freetype/freetype.h" #include "sokol_gfx.h" @@ -13,6 +14,9 @@ struct text_vertex_s { enum font_context_error_e : u8 { FONT_CONTEXT_ERROR_NONE = 0, FONT_CONTEXT_ERROR_LOAD_LIBRARY, + FONT_CONTEXT_ERROR_CREATE_SAMPLER, + FONT_CONTEXT_ERROR_CREATE_SHADER, + FONT_CONTEXT_ERROR_CREATE_PIPELINE, }; struct font_context_s { @@ -21,14 +25,24 @@ struct font_context_s { struct sg_sampler sampler; }; -enum font_context_error_e font_context_init(struct font_context_s* context); -void font_context_deinit(struct font_context_s* context); +enum font_context_error_e wayc_font_context_init( + struct font_context_s* context); +void wayc_font_context_deinit(struct font_context_s* context); + +enum font_error_e : u8 { + FONT_ERROR_NONE = 0, + FONT_ERROR_LOAD_FACE, + +}; struct font_s { FT_Face face; + u32 font_size; u8* source; - u8* staging; - bool staging_dirty; - struct sg_image atlas; + struct atlas_s atlas; }; + +enum font_error_e wayc_font_init(struct font_s* font, + struct font_context_s* context, + const char* path, u32 font_size);
\ No newline at end of file |
