render when visible only
This commit is contained in:
parent
caded3285c
commit
71b6fb0590
|
@ -75,12 +75,14 @@ void Engine::run()
|
|||
update(ticks - lastFrameTicks);
|
||||
lastFrameTicks = ticks;
|
||||
|
||||
// render
|
||||
// render only when visible
|
||||
if(Platform::isWindowVisible()) {
|
||||
render();
|
||||
|
||||
// swap buffers
|
||||
Platform::swapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
lastFrameTicks = 0;
|
||||
m_stopping = false;
|
||||
|
|
Loading…
Reference in New Issue