work-in-progress for 3d triangle rendering

This commit is contained in:
2024-07-10 19:15:28 +03:00
parent e2ed4b2c2d
commit b280243d30
9 changed files with 300 additions and 23 deletions

View File

@@ -51,25 +51,25 @@ void textures_dump_atlases(struct texture_cache *cache);
/* loads an image if it isn't in the cache, otherwise a no-op. */
/* can be called from anywhere at any time after init, useful if you want to */
/* preload textures you know will definitely be used */
void textures_load(struct texture_cache *cache, char *path);
void textures_load(struct texture_cache *cache, const char *path);
/* repacks the current texture atlas based on the texture cache */
void textures_update_current_atlas(struct texture_cache *cache);
/* returns a rect in a texture cache atlas based on a path, for drawing */
/* if the texture is not found, returns a zero-filled rect (so check w or h) */
SDL_Rect textures_get_srcrect(struct texture_cache *cache, char *path);
SDL_Rect textures_get_srcrect(struct texture_cache *cache, const char *path);
/* returns which atlas the texture in the path is in, starting from 0 */
/* if the texture is not found, returns INT_MIN */
int textures_get_atlas_index(struct texture_cache *cache, char *path);
int textures_get_atlas_index(struct texture_cache *cache, const char *path);
/* returns a pointer to the atlas at `index` */
/* if the index is out of bounds, returns NULL. */
/* you can get the index via texture_get_atlas_index */
SDL_Texture *textures_get_atlas(struct texture_cache *cache, int index);
SDL_Texture *textures_get_loner(struct texture_cache *cache, char *path);
SDL_Texture *textures_get_loner(struct texture_cache *cache, const char *path);
/* returns the number of atlases in the cache */
size_t textures_get_num_atlases(struct texture_cache *cache);