summaryrefslogtreecommitdiff
path: root/src/atlas.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-13 07:09:38 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-13 07:09:38 +0100
commite40037fd7a922132015340a758468cb5dec71096 (patch)
tree5f57004ffc0bed7c0d1b2e3ae5a45df104d9eabd /src/atlas.h
parent2600ac4737d0098d650b792a30ccc557f6d76d16 (diff)
rasterizing and caching
Diffstat (limited to 'src/atlas.h')
-rw-r--r--src/atlas.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/atlas.h b/src/atlas.h
index 66813a8..993b8f3 100644
--- a/src/atlas.h
+++ b/src/atlas.h
@@ -1,5 +1,6 @@
#pragma once
+#include "cglm/types.h"
#include "sokol_gfx.h"
#include "utils.h"
@@ -10,15 +11,24 @@ enum atlas_error_e : u8 {
ATLAS_ERROR_UPLOAD_FAILED,
};
+struct atlas_packer_s {
+ vec2 cursor;
+ u32 row_height;
+};
+
struct atlas_s {
u32 width, height;
enum sg_pixel_format format;
struct sg_image gpu_atlas;
u8* cpu_atlas;
bool cpu_dirty;
+ struct atlas_packer_s packer;
};
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_insert(struct atlas_s* atlas, u32 width,
+ u32 height, const u8* data, vec2* uv0,
+ vec2* uv1);
enum atlas_error_e wayc_atlas_flush(struct atlas_s* atlas);
void wayc_atlas_deinit(struct atlas_s* atlas);