LDKTextureAtlas
typedef struct LDKTextureAtlas{
LDKAssetPath texture_path;
LDKTextureAtlasRegion *regions;
u32 region_count, region_capacity;
u64 next_region_id;
}LDKTextureAtlas;
typedef struct LDKTextureAtlas{
LDKAssetPath texture_path;
LDKTextureAtlasRegion *regions;
u32 region_count, region_capacity;
u64 next_region_id;
}LDKTextureAtlas;
Clear the state of the texture atlas.
LDK_API void ldk_texture_atlas_clear(LDKTextureAtlas *atlas);
LDKTextureAtlas *atlasCopy the texture atlas.
LDK_API bool ldk_texture_atlas_copy(
LDKTextureAtlas *dst,
const LDKTextureAtlas *src
);
LDKTextureAtlas *dstconst LDKTextureAtlas *srcTrue if the operation succeeds; false otherwise.
Add a grid of regions to the atlas.
LDK_API bool ldk_texture_atlas_grid_append(
LDKTextureAtlas *atlas,
u32 image_width,
u32 image_height,
u32 cell_width,
u32 cell_height,
u32 spacing_x,
u32 spacing_y,
u32 margin_x,
u32 margin_y
);
LDKTextureAtlas *atlasu32 image_widthu32 image_heightu32 cell_widthu32 cell_heightu32 spacing_xu32 spacing_yu32 margin_xu32 margin_yTrue if the operation succeeds; false otherwise.
Initialize an empty texture atlas.
LDK_API void ldk_texture_atlas_init(LDKTextureAtlas *atlas);
LDKTextureAtlas *atlasSet the texture atlas texture.
LDK_API bool ldk_texture_atlas_texture_set(
LDKTextureAtlas *atlas,
const char *path
);
LDKTextureAtlas *atlasconst char *pathTrue if the operation succeeds; false otherwise.
Validate the texture atlas.
LDK_API bool ldk_texture_atlas_validate(const LDKTextureAtlas *atlas);
const LDKTextureAtlas *atlasTrue if the operation succeeds; false otherwise.