mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
feat: add texture hot-reload
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user