twn_filewatch.c: file and directory change api, initial support for texture reload

This commit is contained in:
veclavtalica
2025-01-29 07:21:09 +03:00
parent 630c6fb5d4
commit 4b2a22bf3c
7 changed files with 246 additions and 29 deletions

View File

@ -308,6 +308,8 @@ static void update_texture_rects_in_atlas(TextureCache *cache, stbrp_rect *rects
void textures_cache_init(TextureCache *cache, SDL_Window *window) {
SDL_zero(*cache);
cache->window = window;
sh_new_arena(cache->hash);
@ -581,4 +583,6 @@ size_t textures_get_num_atlases(const TextureCache *cache) {
}
void textures_reset_state(void) {
textures_cache_deinit(&ctx.texture_cache);
textures_cache_init(&ctx.texture_cache, ctx.window);
}