Commit a2e7476d authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Fixes to improve platform support

 - detect XCode in CMake and handle equivalent to Unix environment
 - fix problem with glew 1.13 and GL core cotext
 - bugfix for potential hangup during app init
parent 73afddbe
......@@ -128,7 +128,8 @@ TARGET_LINK_LIBRARIES(campvis-application-lib ${CampvisMainLibs} ${CampvisGlobal
# the code to export DLL symbols
SET_TARGET_PROPERTIES(campvis-application-lib PROPERTIES DEFINE_SYMBOL "CAMPVIS_APPLICATION_BUILD_DLL")
target_compile_definitions(campvis-application-lib PUBLIC ${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions})
target_compile_definitions(campvis-application-lib PUBLIC ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions})
target_compile_options(campvis-application-lib PUBLIC ${CampvisGlobalDefinitions})
target_include_directories(campvis-application-lib PUBLIC ${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
IF(CAMPVIS_GROUP_SOURCE_FILES)
......
......@@ -90,7 +90,7 @@ ELSEIF(${CMAKE_GENERATOR} MATCHES "MinGW")
SET(CAMPVIS_MINGW TRUE)
SET(CAMPVIS_WIN32 TRUE)
MESSAGE("MinGW 32 Bit Build (not actively supported)")
ELSEIF(${CMAKE_GENERATOR} MATCHES "Unix")
ELSEIF(${CMAKE_GENERATOR} MATCHES "Unix" OR ${CMAKE_GENERATOR} MATCHES "XCode")
SET(CAMPVIS_UNIX TRUE)
MESSAGE(STATUS "Unix Build")
ELSE()
......
......@@ -61,7 +61,7 @@ namespace campvis {
LERRORC("CAMPVis.core.init", "Your system does not support GLSL Shader Version 3.30, which is mandatory. CAMPVis will probably not work as intended.");
}
ShdrMgr.setDefaultGlslVersion("430");
ShdrMgr.setDefaultGlslVersion("410");
for (auto it = searchPaths.cbegin(); it != searchPaths.cend(); ++it) {
ShdrMgr.addPath(*it);
ShdrMgr.addPath(*it + "/core/glsl");
......@@ -99,7 +99,7 @@ namespace campvis {
CAMPVIS_CORE_API void startOpenGlThreadAndMoveQtThreadAffinity(cgt::Runnable* runnable, cgt::GLCanvas* canvas) {
// welcome to a complex signalling ping-pong to move the OpenGL context thread affinity
// we will use targetThread as signalling variable and initialize it with nullptr:
void* targetThread = nullptr;
volatile void* targetThread = nullptr;
// start the new thread with special init function
runnable->start([&]() {
......
......@@ -55,6 +55,8 @@ namespace cgt {
// Init GLEW for this context
context->acquireAsCurrentContext();
glewExperimental=true; // required in case an old glew version is used
GLenum err = glewInit();
if (err != GLEW_OK) {
// Problem: glewInit failed, something is seriously wrong.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment