From 1e81fb2a17af6f91300384407e0595b7d34bbf33 Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Fri, 13 Feb 2015 14:15:31 +0100 Subject: [PATCH] schnapps modif --- CGoGN/src/Utils/GLSLShader.cpp | 8 +++++--- CMakeLists.txt | 9 ++------- SCHNApps/CMakeLists.txt | 12 ++++++++---- SCHNApps/src/schnapps.cpp | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CGoGN/src/Utils/GLSLShader.cpp b/CGoGN/src/Utils/GLSLShader.cpp index d84b032c9..49d1cd533 100644 --- a/CGoGN/src/Utils/GLSLShader.cpp +++ b/CGoGN/src/Utils/GLSLShader.cpp @@ -39,14 +39,16 @@ namespace CGoGN namespace Utils { -#ifdef USE_OGL_CORE_PROFILE +#ifdef CGoGN_USE_OGL_CORE_PROFILE unsigned int GLSLShader::CURRENT_OGL_VERSION = 3; +unsigned int GLSLShader::MAJOR_OGL_CORE = 3; +unsigned int GLSLShader::MINOR_OGL_CORE = 3; #else unsigned int GLSLShader::CURRENT_OGL_VERSION = 2; +unsigned int GLSLShader::MAJOR_OGL_CORE = 2; +unsigned int GLSLShader::MINOR_OGL_CORE = 1; #endif -unsigned int GLSLShader::MAJOR_OGL_CORE = 3; -unsigned int GLSLShader::MINOR_OGL_CORE = 3; std::string GLSLShader::DEFINES_GL2=\ diff --git a/CMakeLists.txt b/CMakeLists.txt index 302e45334..d163406e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,7 @@ SET ( CGoGN_WITH_ASSIMP OFF CACHE BOOL "build CGoGN with Assimp" ) SET ( CGoGN_WITH_ZINRI OFF CACHE BOOL "build CGoGN with Zinri lib" ) SET ( CGoGN_WITH_QT ON CACHE BOOL "build CGoGN with Qt lib" ) SET ( DESIRED_QT_VERSION "4" CACHE STRING "4: QT4/ 5 not yet implemented" ) -SET ( CGoGN_WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)") -SET ( CGoGN_WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW" ) +SET ( CGoGN_WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW (for VRJuggler)" ) SET ( CGoGN_USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not work on mac)" ) SET ( CGoGN_COMPILE_EXAMPLES OFF CACHE BOOL "compile examples" ) @@ -93,7 +92,7 @@ endif() add_definitions("-DCGOGN_ASSERT_BOOL=${ASSERT_ACTIVED}") IF(CGoGN_USE_OGL_CORE_PROFILE) - add_definitions("-DUSE_OGL_CORE_PROFILE=1") + add_definitions("-DCGoGN_USE_OGL_CORE_PROFILE=1") ENDIF() add_definitions("-DGLM_FORCE_RADIANS") @@ -122,10 +121,6 @@ INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/ThirdParty/include) ADD_SUBDIRECTORY(ThirdParty/Tools) -IF (CGoGN_WITH_PYTHONQT) - ADD_SUBDIRECTORY(ThirdParty/PythonQt) -ENDIF () - ADD_SUBDIRECTORY(ThirdParty/OpenNL) INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/ThirdParty/OpenNL/src) diff --git a/SCHNApps/CMakeLists.txt b/SCHNApps/CMakeLists.txt index c500decc0..9d03f9621 100644 --- a/SCHNApps/CMakeLists.txt +++ b/SCHNApps/CMakeLists.txt @@ -41,11 +41,15 @@ SET( QT_USE_QTSVG TRUE ) INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) -add_definitions(-DGLM_FORCE_RADIANS) -#MESSAGE HERE FOR MORE EASY READING (MESSAGE AT THE END) -MESSAGE("Build type = " ${CMAKE_BUILD_TYPE} " (for change -DCMAKE_BUILD_TYPE=Release|Debug)" ) +# PythonQt dependency +ADD_SUBDIRECTORY(${CGoGN_ROOT_DIR}/ThirdParty/PythonQt ThirdParty_PythonQt) + +# for GLM +add_definitions(-DGLM_FORCE_RADIANS) + +# CGoGN compiled in one or several libs file(STRINGS ${CGoGN_SRC_DIR}/include/cgogn_onelib.h ONELIB_STR) IF (ONELIB_STR EQUAL 1) SET(CGoGN_LIBS cgogn) @@ -53,12 +57,12 @@ ELSE() SET(CGoGN_LIBS topology algo container utils) ENDIF() +# use GL core profile 3.3 file(STRINGS ${CGoGN_SRC_DIR}/include/cgogn_coreprofile.h COREPROFILE_STR) IF (COREPROFILE_STR EQUAL 1) add_definitions(-DCGoGN_USE_OGL_CORE_PROFILE=1) ENDIF() - add_definitions(-DCGOGN_ASSERT_BOOL=${CGoGN_ASSERT_ACTIVED}) IF(CGoGN_SLOT_DEBUG_MODE) diff --git a/SCHNApps/src/schnapps.cpp b/SCHNApps/src/schnapps.cpp index 226659ffc..59dc6e9cd 100644 --- a/SCHNApps/src/schnapps.cpp +++ b/SCHNApps/src/schnapps.cpp @@ -44,7 +44,7 @@ SCHNApps::SCHNApps(const QString& appPath, PythonQtObjectPtr& pythonContext, Pyt { GenericMap::initAllStatics(&m_sp); -#ifdef USE_OGL_CORE_PROFILE +#ifdef CGoGN_USE_OGL_CORE_PROFILE CGoGN::Utils::GLSLShader::setCurrentOGLVersion(3); #else CGoGN::Utils::GLSLShader::setCurrentOGLVersion(2); -- GitLab