feat: add texture hot-reload

This commit is contained in:
2026-04-16 15:33:58 +08:00
parent cf9aaa62a7
commit 7d5b9c34b3
8 changed files with 59 additions and 9 deletions

View File

@@ -178,4 +178,20 @@ void TextureManager::init_texture() {
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
void TextureManager::update() {
if (m_need_reload) {
hot_reload();
}
}
void TextureManager::need_reload() {
m_need_reload = true;
}
void TextureManager::hot_reload() {
delet_texture();
init_texture();
m_need_reload = false;
}