diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-12 22:06:02 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-12 22:06:02 +0100 |
| commit | d590442470f8d858c88517aa563cf3e74bd63b24 (patch) | |
| tree | d76ef829a330370ecb90c819cad2323d3de6289c /src/text.h | |
| parent | d10134d6c74cb9eef83956a8ec5ce4dce69b5ee0 (diff) | |
working on atlas and text rendering
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 |
