Disable the swap barrier before the scene load (and reactivating it afterwards)

This commit is contained in:
Alexander Bock
2015-02-24 19:13:50 +01:00
parent 43a3716afd
commit bac0a9ad31
3 changed files with 16 additions and 0 deletions
@@ -87,6 +87,9 @@ public:
void encode();
void decode();
void enableBarrier();
void disableBarrier();
void runSettingsScripts();
private:
+8
View File
@@ -714,4 +714,12 @@ void OpenSpaceEngine::externalControlCallback(const char* receivedChars,
}
}
void OpenSpaceEngine::enableBarrier() {
sgct::SGCTWindow::setBarrier(true);
}
void OpenSpaceEngine::disableBarrier() {
sgct::SGCTWindow::setBarrier(false);
}
} // namespace openspace
+5
View File
@@ -329,6 +329,8 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
return false;
}
OsEng.disableBarrier();
// initialize the root node
_root = new SceneGraphNode();
_root->setName(SceneGraphNode::RootNodeName);
@@ -358,6 +360,7 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
else {
LFATAL("The '" << constants::scenegraph::keyPathScene << "' pointed to a "
"path '" << moduleDirectory << "' that did not exist");
OsEng.enableBarrier();
return false;
}
@@ -501,6 +504,8 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
OsEng.runSettingsScripts();
OsEng.enableBarrier();
return true;
}