From 3d17e6bcf286c4667ab512db11819dc72f0a0033 Mon Sep 17 00:00:00 2001 From: Joakim Kilby Date: Fri, 3 Jul 2015 14:42:20 +0200 Subject: [PATCH] moved setting of master. (before it was set after init so some scripts could fail from startup.lua if they required one to be master) --- apps/OpenSpace/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index d79c93c777..0d74c96399 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -152,6 +152,7 @@ int main(int argc, char** argv) { } sgct::Engine::RunMode rm = versionMapping[glVersion]; const bool initSuccess = _sgctEngine->init(rm); + if (!initSuccess) { LFATAL("Initializing failed"); // could not open a window, deallocates and exits @@ -160,8 +161,7 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - //is this node the master? (must be set after call to _sgctEngine->init()) - OsEng.setMaster(_sgctEngine->isMaster()); + // Main loop LDEBUG("Starting rendering loop"); @@ -183,6 +183,9 @@ int main(int argc, char** argv) { } void mainInitFunc() { + //is this node the master? (must be set after call to _sgctEngine->init()) + OsEng.setMaster(_sgctEngine->isMaster()); + bool success = OsEng.initialize(); if (success) success = OsEng.initializeGL();