diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-11 23:53:46 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-11 23:53:46 +0100 |
| commit | 6013bac1556659f1685170b5e68752189f0b93ba (patch) | |
| tree | 166edafb021b49144211410c109a404fe44a2101 /src/text.h | |
| parent | 50a84a54e7cc2308ad87bd04e065151a61ffe513 (diff) | |
assembling vertices
Diffstat (limited to 'src/text.h')
| -rw-r--r-- | src/text.h | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -8,6 +8,9 @@ typedef u32 codepoint_t; +#define WAYC_LETTER_NTRIANGLES 2 +#define WAYC_LETTER_NVERTICES (WAYC_LETTER_NTRIANGLES * WAYC_TRIANGLE_NVERTS) + struct text_vertex_s { vec2 pos; vec2 uv; @@ -21,7 +24,6 @@ enum font_context_error_e { struct font_context_s { FT_Library library; - u32 vao; }; enum font_context_error_e wayc_font_context_init(struct font_context_s* ctx); @@ -55,3 +57,21 @@ enum font_error_e wayc_font_lookup(struct font_s* font, struct atlas_s* atlas, struct atlas_packer_s* packer, codepoint_t codepoint, struct glyph_s* out); void wayc_font_deinit(struct font_s* font); + +enum text_error_e { + TEXT_ERROR_NONE, + TEXT_ERROR_ATLAS, +}; + +struct text_s { + struct font_s* font; + struct atlas_s* atlas; + struct atlas_packer_s* packer; + struct string_s string; +}; + +#define WAYC_TEXT_INIT(font, atlas, packer, string) \ + text_s { font, atlas, packer, string } + +enum text_error_e wayc_text_vertices(struct text_s* text, + struct text_vertex_s** out); |
