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/atlas.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/atlas.h (limited to 'src/atlas.h') diff --git a/src/atlas.h b/src/atlas.h new file mode 100644 index 0000000..be10c3b --- /dev/null +++ b/src/atlas.h @@ -0,0 +1,23 @@ +#pragma once + +#include "sokol_gfx.h" +#include "utils.h" + +enum atlas_error_e : u8 { + ATLAS_ERROR_NONE = 0, + ATLAS_ERROR_GPU_ATLAS, + ATLAS_ERROR_ATLAS_FULL, + ATLAS_ERROR_UPLOAD_FAILED, +}; + +struct atlas_s { + u32 width, height; + struct sg_image gpu_atlas; + u8* cpu_atlas; + bool cpu_dirty; +}; + +enum atlas_error_e wayc_atlas_init(struct atlas_s* atlas, u32 width, u32 height, + enum sg_pixel_format format); +enum atlas_error_e wayc_atlas_flush(struct atlas_s* atlas); +void wayc_atlas_deinit(struct atlas_s* atlas); -- cgit v1.2.3