From d590442470f8d858c88517aa563cf3e74bd63b24 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Thu, 12 Feb 2026 22:06:02 +0100 Subject: working on atlas and text rendering --- src/text.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/text.h') diff --git a/src/text.h b/src/text.h index 2e768ee..e1a8b3d 100644 --- a/src/text.h +++ b/src/text.h @@ -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 -- cgit v1.2.3