summaryrefslogtreecommitdiff
path: root/src/atlas.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-12 22:06:02 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-12 22:06:02 +0100
commitd590442470f8d858c88517aa563cf3e74bd63b24 (patch)
treed76ef829a330370ecb90c819cad2323d3de6289c /src/atlas.h
parentd10134d6c74cb9eef83956a8ec5ce4dce69b5ee0 (diff)
working on atlas and text rendering
Diffstat (limited to 'src/atlas.h')
-rw-r--r--src/atlas.h23
1 files changed, 23 insertions, 0 deletions
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);