diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h
index 0f7d080060..7938dc909b 100644
--- a/include/openspace/engine/wrapper/sgctwindowwrapper.h
+++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h
@@ -38,6 +38,7 @@ class SGCTWindowWrapper : public WindowWrapper {
public:
void terminate() override;
void setBarrier(bool enabled) override;
+ void setSynchronization(bool enabled) override;
void clearAllWindows(const glm::vec4& clearColor) override;
bool windowHasResized() const override;
diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h
index 9ea42b78b0..b999f908e9 100644
--- a/include/openspace/engine/wrapper/windowwrapper.h
+++ b/include/openspace/engine/wrapper/windowwrapper.h
@@ -55,6 +55,14 @@ public:
* disables it
*/
virtual void setBarrier(bool enabled);
+
+ /**
+ * This method enables or disables a framelock barrier. If the specific windowing
+ * framework does not provide a framelock, this method defaults to a no-op.
+ * \param enabled If true the framelock is enabled, false
+ * disables it
+ */
+ virtual void setSynchronization(bool enabled);
/**
* This method clears all the rendering windows with the specified \p clearColor. In
diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp
index 3059ec34ee..d7925ccc07 100644
--- a/src/engine/wrapper/sgctwindowwrapper.cpp
+++ b/src/engine/wrapper/sgctwindowwrapper.cpp
@@ -44,6 +44,10 @@ void SGCTWindowWrapper::setBarrier(bool enabled) {
sgct::SGCTWindow::setBarrier(enabled);
}
+void SGCTWindowWrapper::setSynchronization(bool enabled) {
+ sgct_core::ClusterManager::instance()->setUseIgnoreSync(enabled);
+}
+
void SGCTWindowWrapper::clearAllWindows(const glm::vec4& clearColor) {
size_t n = sgct::Engine::instance()->getNumberOfWindows();
for (size_t i = 0; i < n; ++i) {
diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp
index ae042a7d3b..fb3e9f65f2 100644
--- a/src/engine/wrapper/windowwrapper.cpp
+++ b/src/engine/wrapper/windowwrapper.cpp
@@ -35,6 +35,8 @@ WindowWrapper::WindowWrapperException::WindowWrapperException(const std::string&
void WindowWrapper::terminate() {}
void WindowWrapper::setBarrier(bool) {}
+
+void WindowWrapper::setSynchronization(bool) {}
void WindowWrapper::clearAllWindows(const glm::vec4& clearColor) {}
diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp
index f016dd2159..6b03045220 100644
--- a/src/scene/scene.cpp
+++ b/src/scene/scene.cpp
@@ -26,6 +26,7 @@
#include
#include
+#include
#include
#include
#include
@@ -182,11 +183,15 @@ void Scene::clearSceneGraph() {
bool Scene::loadSceneInternal(const std::string& sceneDescriptionFilePath) {
ghoul::Dictionary dictionary;
+ OsEng.windowWrapper().setSynchronization(false);
+ OnExit(
+ [](){ OsEng.windowWrapper().setSynchronization(true); }
+ );
lua_State* state = ghoul::lua::createNewLuaState();
OnExit(
// Delete the Lua state at the end of the scope, no matter what
- [state](){ghoul::lua::destroyLuaState(state);}
+ [state](){ ghoul::lua::destroyLuaState(state); }
);
OsEng.scriptEngine().initializeLuaState(state);