diff options
Diffstat (limited to 'src/atlas.h')
| -rw-r--r-- | src/atlas.h | 10 |
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); |
