2025-10-17 17:54:33 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "pxl8_types.h"
|
|
|
|
|
|
|
|
|
|
typedef struct pxl8_atlas pxl8_atlas;
|
|
|
|
|
|
|
|
|
|
typedef struct pxl8_atlas_entry {
|
|
|
|
|
bool active;
|
|
|
|
|
u32 texture_id;
|
|
|
|
|
i32 x, y, w, h;
|
|
|
|
|
} pxl8_atlas_entry;
|
|
|
|
|
|
2025-11-27 15:48:11 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-11-28 23:42:57 -06:00
|
|
|
pxl8_atlas* pxl8_atlas_create(u32 width, u32 height, pxl8_pixel_mode pixel_mode);
|
2025-10-17 17:54:33 -05:00
|
|
|
void pxl8_atlas_destroy(pxl8_atlas* atlas);
|
|
|
|
|
|
|
|
|
|
const pxl8_atlas_entry* pxl8_atlas_get_entry(const pxl8_atlas* atlas, u32 id);
|
|
|
|
|
u32 pxl8_atlas_get_entry_count(const pxl8_atlas* atlas);
|
|
|
|
|
u32 pxl8_atlas_get_height(const pxl8_atlas* atlas);
|
|
|
|
|
const u8* pxl8_atlas_get_pixels(const pxl8_atlas* atlas);
|
|
|
|
|
u32 pxl8_atlas_get_width(const pxl8_atlas* atlas);
|
|
|
|
|
bool pxl8_atlas_is_dirty(const pxl8_atlas* atlas);
|
2025-11-27 15:48:11 -06:00
|
|
|
|
2025-10-17 17:54:33 -05:00
|
|
|
void pxl8_atlas_mark_clean(pxl8_atlas* atlas);
|
2025-11-27 15:48:11 -06:00
|
|
|
|
2025-11-28 23:42:57 -06:00
|
|
|
u32 pxl8_atlas_add_texture(pxl8_atlas* atlas, const u8* pixels, u32 w, u32 h, pxl8_pixel_mode pixel_mode);
|
2026-01-07 17:45:46 -06:00
|
|
|
void pxl8_atlas_clear(pxl8_atlas* atlas, u32 preserve_count);
|
2025-11-28 23:42:57 -06:00
|
|
|
bool pxl8_atlas_expand(pxl8_atlas* atlas, pxl8_pixel_mode pixel_mode);
|
2025-11-27 15:48:11 -06:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|