mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 06:19:57 -05:00
Disable the swap barrier before the scene load (and reactivating it afterwards)
This commit is contained in:
@@ -87,6 +87,9 @@ public:
|
||||
void encode();
|
||||
void decode();
|
||||
|
||||
void enableBarrier();
|
||||
void disableBarrier();
|
||||
|
||||
void runSettingsScripts();
|
||||
|
||||
private:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user