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