mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Stop render when iconified
This commit is contained in:
parent
837fd2f32f
commit
a1e3706c8f
3 changed files with 14 additions and 3 deletions
|
|
@ -109,10 +109,16 @@ void Engine::mainloop() {
|
|||
|
||||
gui->act(delta);
|
||||
screen->update(delta);
|
||||
screen->draw(delta);
|
||||
gui->draw(&batch, assets.get());
|
||||
|
||||
Window::swapInterval(settings.display.swapInterval);
|
||||
if (!Window::isIconified()) {
|
||||
screen->draw(delta);
|
||||
gui->draw(&batch, assets.get());
|
||||
Window::swapInterval(settings.display.swapInterval);
|
||||
} else {
|
||||
Window::swapInterval(1);
|
||||
Window::swapBuffers();
|
||||
}
|
||||
|
||||
Window::swapBuffers();
|
||||
Events::pollEvents();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue