render when visible only

This commit is contained in:
Eduardo Bart 2011-03-20 19:30:15 -03:00
parent caded3285c
commit 71b6fb0590
1 changed files with 6 additions and 4 deletions

View File

@ -75,11 +75,13 @@ void Engine::run()
update(ticks - lastFrameTicks); update(ticks - lastFrameTicks);
lastFrameTicks = ticks; lastFrameTicks = ticks;
// render // render only when visible
render(); if(Platform::isWindowVisible()) {
render();
// swap buffers // swap buffers
Platform::swapBuffers(); Platform::swapBuffers();
}
} }
lastFrameTicks = 0; lastFrameTicks = 0;