GRIM: Draw the scene before updating the lua

This commit is contained in:
Joel Teichroeb 2013-05-07 18:57:03 -07:00
parent b1967abd7d
commit bcf6c8ed48

View file

@ -692,10 +692,19 @@ void GrimEngine::mainLoop() {
_refreshDrawNeeded = true; _refreshDrawNeeded = true;
} }
if (_mode != PauseMode) {
// Draw the display scene before doing the luaUpdate.
// This give a large performance boost as OpenGL stores commands
// in a queue on the gpu to be rendered later. When doFlip is
// called the cpu must wait for the gpu to finish its queue.
// Now, it will queue all the OpenGL commands and draw them on the
// GPU while the CPU is busy updating the game world.
updateDisplayScene();
}
luaUpdate(); luaUpdate();
if (_mode != PauseMode) { if (_mode != PauseMode) {
updateDisplayScene();
doFlip(); doFlip();
} }