mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 17:49:21 +02:00
render when visible only
This commit is contained in:
parent
caded3285c
commit
71b6fb0590
@ -75,11 +75,13 @@ void Engine::run()
|
||||
update(ticks - lastFrameTicks);
|
||||
lastFrameTicks = ticks;
|
||||
|
||||
// render
|
||||
render();
|
||||
// render only when visible
|
||||
if(Platform::isWindowVisible()) {
|
||||
render();
|
||||
|
||||
// swap buffers
|
||||
Platform::swapBuffers();
|
||||
// swap buffers
|
||||
Platform::swapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
lastFrameTicks = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user