diff --git a/src/main.cpp b/src/main.cpp index 69b0501e3d..c2a2a883b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,13 +42,8 @@ void mainMousePosCallback(double x, double y); void mainMouseScrollCallback(double posX, double posY); void mainEncodeFun(); void mainDecodeFun(); - -#if 0 -// @TODO Remove the ifdef hen the next SGCT version is available ---abock void mainExternalControlCallback(const char * receivedChars, int size); -#else -void mainExternalControlCallback(const char * receivedChars, int size, int clientId); -#endif +void mainLogCallback(const char* msg); namespace { const std::string _loggerCat = "main"; @@ -68,18 +63,11 @@ int main(int argc, char** argv) for (int i = 0; i < newArgc; ++i) newArgv[i] = const_cast(sgctArguments.at(i).c_str()); -#if 0 -// @TODO Remove the ifdef (enabling the functions) when the next SGCT version is available -// that enables the logging redirect ---abock sgct::MessageHandler::instance()->setLogToConsole(false); sgct::MessageHandler::instance()->setShowTime(false); sgct::MessageHandler::instance()->setLogToCallback(true); - sgct::MessageHandler::instance()->setLogCallback([](const char* msg) { - std::string message = msg; - // Remove the trailing \n that is passed along - LINFOC("SGCT", message.substr(0, message.size()-1)); - }); -#endif + sgct::MessageHandler::instance()->setLogCallback(mainLogCallback); + LDEBUG("Creating SGCT Engine"); _sgctEngine = new sgct::Engine(newArgc, newArgv); @@ -163,7 +151,8 @@ void mainPostSyncPreDrawFunc() void mainRenderFunc() { //not the most efficient, but for clarity @JK - glm::mat4 userMatrix = glm::translate(glm::mat4(1.f), _sgctEngine->getUserPtr()->getPos()); + + glm::mat4 userMatrix = glm::translate(glm::mat4(1.f), _sgctEngine->getDefaultUserPtr()->getPos()); glm::mat4 sceneMatrix = _sgctEngine->getModelMatrix(); glm::mat4 viewMatrix = _sgctEngine->getActiveViewMatrix() * userMatrix; @@ -181,20 +170,11 @@ void mainPostDrawFunc() OsEng.postDraw(); } -#if 0 -// @TODO Remove the ifdef hen the next SGCT version is available ---abock void mainExternalControlCallback(const char* receivedChars, int size) { if (_sgctEngine->isMaster()) OsEng.externalControlCallback(receivedChars, size, 0); } -#else -void mainExternalControlCallback(const char* receivedChars, int size, int clientId) -{ - if (_sgctEngine->isMaster()) - OsEng.externalControlCallback(receivedChars, size, clientId); -} -#endif void mainKeyboardCallback(int key, int action) { @@ -237,3 +217,9 @@ void mainDecodeFun() { OsEng.decode(); } + +void mainLogCallback(const char* msg){ + std::string message = msg; + // Remove the trailing \n that is passed along + LINFOC("SGCT", message.substr(0, std::max(message.size() - 1, 0))); +} \ No newline at end of file diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index c9004e84f4..32db38da32 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -272,18 +272,19 @@ namespace openspace { const glm::vec3 center = (corners[0] + corners[1] + corners[2] + corners[3]) / 4.0f; -#if 0 - // @TODO Remove the ifdef when the next SGCT version is released that requests the - // getUserPtr to get a name parameter ---abock - - // set the eye position, useful during rendering - const glm::vec3 eyePosition - = sgct_core::ClusterManager::instance()->getUserPtr("")->getPos(); -#else - const glm::vec3 eyePosition - = sgct_core::ClusterManager::instance()->getUserPtr()->getPos(); -#endif - + +//#if 0 +// // @TODO Remove the ifdef when the next SGCT version is released that requests the +// // getUserPtr to get a name parameter ---abock +// +// // set the eye position, useful during rendering +// const glm::vec3 eyePosition +// = sgct_core::ClusterManager::instance()->getUserPtr("")->getPos(); +//#else +// const glm::vec3 eyePosition +// = sgct_core::ClusterManager::instance()->getUserPtr()->getPos(); +//#endif + const glm::vec3 eyePosition = sgct_core::ClusterManager::instance()->getDefaultUserPtr()->getPos(); // get viewdirection, stores the direction in the camera, used for culling const glm::vec3 viewdir = glm::normalize(eyePosition - center); _mainCamera->setCameraDirection(-viewdir); @@ -386,26 +387,10 @@ namespace openspace { #endif // setup the camera for the current frame -#if 0 - // @TODO: Use this as soon as the new SGCT version is available ---abock - const glm::vec3 eyePosition - = sgct_core::ClusterManager::instance()->getUserPtr("")->getPos(); -#else - const glm::vec3 eyePosition - = sgct_core::ClusterManager::instance()->getUserPtr()->getPos(); -#endif - //@CHECK does the dome disparity disappear if this line disappears? ---abock - //const glm::mat4 view - // = glm::translate(glm::mat4(1.0), - // eyePosition); // make sure the eye is in the center - // - _mainCamera->setViewMatrix( viewMatrix ); - _mainCamera->setProjectionMatrix( projectionMatrix); - //Is this really necessary to store? @JK _mainCamera->setViewProjectionMatrix(projectionMatrix * viewMatrix);