diff --git a/CMakeLists.txt b/CMakeLists.txt index 60ee6000597ccf0e6688d910794352679249cbd0..0b1fdfdc26a2c1efa679eb8ed457bb6eb74762e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,6 +135,7 @@ IF(APPLE) SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX") SET(CMAKE_OSX_ARCHITECTURES x86_64) + SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} "-framework Foundation -framework cocoa" ) ENDIF(APPLE) IF(WIN32) diff --git a/include/Algo/Modelisation/extrusion.hpp b/include/Algo/Modelisation/extrusion.hpp index d3d80bfa734c6ec39eb1a02ad43b2168a4809ab1..b03f99576996b9f01733a54412a8eb6bcef2e1ae 100644 --- a/include/Algo/Modelisation/extrusion.hpp +++ b/include/Algo/Modelisation/extrusion.hpp @@ -22,7 +22,7 @@ * * *******************************************************************************/ -#include +#include "Utils/gl_def.h" #include "Geometry/transfo.h" namespace CGoGN diff --git a/include/Algo/Render/GL2/colorPerFaceRender.h b/include/Algo/Render/GL2/colorPerFaceRender.h index 83f61d07439db747182e3e4f541b8a64a4611429..b8f34bfcf8628d8c50e5651ae74a0f470dd0c8ce 100644 --- a/include/Algo/Render/GL2/colorPerFaceRender.h +++ b/include/Algo/Render/GL2/colorPerFaceRender.h @@ -25,7 +25,6 @@ #ifndef _COLOR_PER_FACE_RENDER #define _COLOR_PER_FACE_RENDER -#include #include "Topology/generic/dart.h" #include "Topology/generic/attributeHandler.h" diff --git a/include/Algo/Render/GL2/explodeVolumeRender.h b/include/Algo/Render/GL2/explodeVolumeRender.h index 85a183977bf3a599b99b1b2f0cb30a28efd209cf..7247baad178197279a9ceddae631462b8d921fa7 100644 --- a/include/Algo/Render/GL2/explodeVolumeRender.h +++ b/include/Algo/Render/GL2/explodeVolumeRender.h @@ -25,8 +25,6 @@ #ifndef _EXPLODE_VOLUME_VBO_RENDER #define _EXPLODE_VOLUME_VBO_RENDER -#include - #include #include diff --git a/include/Algo/Render/GL2/mapRender.h b/include/Algo/Render/GL2/mapRender.h index 5360cf532331fec062ca60c0456fcc31b9ce01c7..7003a3514f63c7007dd8b3985d8de2358b4869bf 100644 --- a/include/Algo/Render/GL2/mapRender.h +++ b/include/Algo/Render/GL2/mapRender.h @@ -28,7 +28,6 @@ #define _USE_MATH_DEFINES #include -#include #include #include #include diff --git a/include/Algo/Render/GL2/topo3Render.h b/include/Algo/Render/GL2/topo3Render.h index bddea0881b9c81c8ee4ee0e78fac084d67813fed..72141e64611c759f9353d170974db32d75ccf369 100644 --- a/include/Algo/Render/GL2/topo3Render.h +++ b/include/Algo/Render/GL2/topo3Render.h @@ -25,8 +25,6 @@ #ifndef _TOPO3_VBO_RENDER #define _TOPO3_VBO_RENDER -#include - #include #include diff --git a/include/Algo/Render/GL2/topoRender.h b/include/Algo/Render/GL2/topoRender.h index 44c5aae108d736fca73cd46ea1258d0a64560a66..77234dedff0521e3b943c9ba8ff508a57f36f4e6 100644 --- a/include/Algo/Render/GL2/topoRender.h +++ b/include/Algo/Render/GL2/topoRender.h @@ -25,8 +25,6 @@ #ifndef _GL2_TOPO_RENDER_ #define _GL2_TOPO_RENDER_ -#include - #include #include diff --git a/include/Utils/Qt/macgl3.h b/include/Utils/Qt/macgl3.h new file mode 100644 index 0000000000000000000000000000000000000000..ce3ab7115fd035ada74854d4e2a8946c5417c3fb --- /dev/null +++ b/include/Utils/Qt/macgl3.h @@ -0,0 +1,25 @@ +//#include +#include +#include +#include + +//external Objective C function +void* select_3_2_mac_visual(GDHandle handle); + +namespace CGoGN +{ + +/// Use with GLWidget(...):QGLWidget(new Core3_2_context(QGLFormat::defaultFormat())) +/// check with std::cout< +#include "Utils/gl_def.h" #include #include #include diff --git a/include/Utils/drawer.h b/include/Utils/drawer.h index 9579e6de80848a95efe808f88a470d1ad988263a..bed58d31a86c3ccf65a1279a39d3d96955dd3ebc 100644 --- a/include/Utils/drawer.h +++ b/include/Utils/drawer.h @@ -26,7 +26,7 @@ #define _CGOGN_DRAWER_H_ #include -#include +#include "Utils/gl_def.h" #include "Geometry/vector_gen.h" namespace CGoGN { namespace Utils { class VBO; } } diff --git a/include/Utils/fbo.h b/include/Utils/fbo.h index f9c91960655b2792da1387053337573536685bdd..98865b281218ea8bcd2d0b96bf8ab2f79d8ac384 100644 --- a/include/Utils/fbo.h +++ b/include/Utils/fbo.h @@ -25,7 +25,6 @@ #ifndef __CGoGN_GLSL_FBO__ #define __CGoGN_GLSL_FBO__ -#include #include "Utils/gl_def.h" #include diff --git a/include/Utils/textures.h b/include/Utils/textures.h index e3577a8a1d7deccc1f033db678109a8bc25aa751..422a81f13115304df0f390ce3cefac9df0002cac 100644 --- a/include/Utils/textures.h +++ b/include/Utils/textures.h @@ -27,7 +27,6 @@ #include "Utils/gl_def.h" #include "Geometry/vector_gen.h" -#include #include #include diff --git a/include/Utils/vbo.h b/include/Utils/vbo.h index e6aae9488333c454f080c094167ebed660885505..48076c799747d45ed4d73d542b2d1bebc2e28bef 100644 --- a/include/Utils/vbo.h +++ b/include/Utils/vbo.h @@ -27,7 +27,6 @@ #include -#include #include "Utils/gl_def.h" #include "Topology/generic/attributeHandler.h" #include "Container/convert.h" diff --git a/include/Utils/vboRender.h b/include/Utils/vboRender.h index fd1944257547851c682ee6be25c6bb3806235dce..a07c18c1a5c2e7cc2b7758c73f00d169a1b60b51 100644 --- a/include/Utils/vboRender.h +++ b/include/Utils/vboRender.h @@ -25,7 +25,7 @@ #ifndef _VBO_RENDER_ #define _VBO_RENDER_ -#include +#include "Utils/gl_def.h" namespace CGoGN { diff --git a/src/Utils/Qt/qtgl.cpp b/src/Utils/Qt/qtgl.cpp index 77db9edcdbcd34576e32d8c811ab27b71af8d3fb..8b8214ecf106972d61bcb7da6c2c62cb09311db2 100644 --- a/src/Utils/Qt/qtgl.cpp +++ b/src/Utils/Qt/qtgl.cpp @@ -22,7 +22,6 @@ * * *******************************************************************************/ -#include #include #include "Utils/trackball.h" #include "Utils/Qt/qtgl.h" @@ -30,6 +29,9 @@ #include "glm/gtc/type_precision.hpp" #include "Utils/GLSLShader.h" +#ifdef MAC_OSX + #include "Utils/Qt/macgl3.h" +#endif namespace CGoGN { @@ -42,7 +44,12 @@ namespace QT float GLWidget::FAR_PLANE = 500.0f; GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) : +#ifdef MAC_OSX +// QGLWidget(new Core3_2_context(QGLFormat::defaultFormat()),parent), QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent), +#else + QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent), +#endif m_cbs(cbs), m_state_modifier(0), allow_rotation(true) @@ -186,6 +193,7 @@ glm::vec3& GLWidget::getObjPos() void GLWidget::initializeGL() { + std::cout << "GL VERSION = "<< glGetString(GL_VERSION)<< std::endl; glEnable(GL_DEPTH_TEST); if (m_cbs) diff --git a/src/Utils/Shaders/shaderColorPerVertex.cpp b/src/Utils/Shaders/shaderColorPerVertex.cpp index c2b6eb650d5bb3783ae26f5077d4e1e981953ea7..484ad150868234fadcb1312ed178cacf93156eb5 100644 --- a/src/Utils/Shaders/shaderColorPerVertex.cpp +++ b/src/Utils/Shaders/shaderColorPerVertex.cpp @@ -22,7 +22,6 @@ * * *******************************************************************************/ -#include #include "Utils/Shaders/shaderColorPerVertex.h" diff --git a/src/Utils/Shaders/shaderEnvMap.cpp b/src/Utils/Shaders/shaderEnvMap.cpp index f30cb8f0a46a7494699d0f3dada64c70a37a5e8c..cd79e4011eaa6e059bf623e00e62def45180a34f 100644 --- a/src/Utils/Shaders/shaderEnvMap.cpp +++ b/src/Utils/Shaders/shaderEnvMap.cpp @@ -22,7 +22,6 @@ * * *******************************************************************************/ -#include #include "Utils/Shaders/shaderEnvMap.h" #include diff --git a/src/Utils/Shaders/shaderExplodeVolumes.cpp b/src/Utils/Shaders/shaderExplodeVolumes.cpp index b11ef3f96f28c803637e653c67abed8903a8b032..3fe01c2d326475ea4bf0372a60105addd1208a8c 100644 --- a/src/Utils/Shaders/shaderExplodeVolumes.cpp +++ b/src/Utils/Shaders/shaderExplodeVolumes.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #include -#include #include "Utils/Shaders/shaderExplodeVolumes.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderExplodeVolumesLines.cpp b/src/Utils/Shaders/shaderExplodeVolumesLines.cpp index 36233a7468a461b94a7678d7ffa437d10b3a6fb4..94bc03a86e1fb45d088de1e0d2ff15640b3a6825 100644 --- a/src/Utils/Shaders/shaderExplodeVolumesLines.cpp +++ b/src/Utils/Shaders/shaderExplodeVolumesLines.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #include -#include #include "Utils/Shaders/shaderExplodeVolumesLines.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderFlat.cpp b/src/Utils/Shaders/shaderFlat.cpp index fa1322b2565542ea76eab030fb0d872741eaea79..98060021f991dc509397b3babde1365958388333 100644 --- a/src/Utils/Shaders/shaderFlat.cpp +++ b/src/Utils/Shaders/shaderFlat.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #include -#include #include "Utils/Shaders/shaderFlat.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderFlatColor.cpp b/src/Utils/Shaders/shaderFlatColor.cpp index 069e2277255a21b5af50fac610a1f7a3788ba543..b5de4900edfc71d399ad776b097fd60c09f9d980 100644 --- a/src/Utils/Shaders/shaderFlatColor.cpp +++ b/src/Utils/Shaders/shaderFlatColor.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #include -#include #include "Utils/Shaders/shaderFlatColor.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderIsoLines.cpp b/src/Utils/Shaders/shaderIsoLines.cpp index 644552492504a2b650ab014501333a05515cd87b..57e85da1a32b2c9e8bd06558524bfeb85d58cc89 100644 --- a/src/Utils/Shaders/shaderIsoLines.cpp +++ b/src/Utils/Shaders/shaderIsoLines.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #include -#include #include "Utils/Shaders/shaderIsoLines.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderScalarField.cpp b/src/Utils/Shaders/shaderScalarField.cpp index f651b1413b24fdc3d216ec2e9fdba314b330b487..a10be20bd7da664a9838ba915d5790e8e12ac5ed 100644 --- a/src/Utils/Shaders/shaderScalarField.cpp +++ b/src/Utils/Shaders/shaderScalarField.cpp @@ -22,10 +22,8 @@ * * *******************************************************************************/ -#include #include "Utils/Shaders/shaderScalarField.h" - namespace CGoGN { diff --git a/src/Utils/Shaders/shaderSimpleColor.cpp b/src/Utils/Shaders/shaderSimpleColor.cpp index 1b3b30bd89dea9563977634668572e04eec82880..1529a1851740f7404049a422f06e47c13cd3fbf0 100644 --- a/src/Utils/Shaders/shaderSimpleColor.cpp +++ b/src/Utils/Shaders/shaderSimpleColor.cpp @@ -22,7 +22,6 @@ * * *******************************************************************************/ -#include #include "Utils/Shaders/shaderSimpleColor.h" namespace CGoGN diff --git a/src/Utils/Shaders/shaderSimpleTexture.cpp b/src/Utils/Shaders/shaderSimpleTexture.cpp index 84aa32390a89ca0574a875802e2b8468593d617c..cd89de644efba5b83c0aa4e1e996fef34c15c0c1 100644 --- a/src/Utils/Shaders/shaderSimpleTexture.cpp +++ b/src/Utils/Shaders/shaderSimpleTexture.cpp @@ -24,7 +24,6 @@ #ifdef WITH_QT -#include #include "Utils/Shaders/shaderSimpleTexture.h" diff --git a/src/Utils/Shaders/shaderTextureMask.cpp b/src/Utils/Shaders/shaderTextureMask.cpp index 23053d0245c50f2d2994f5a7f8348c2f9de9005b..9051ffcb34cdf01b2825b5a1d6990155e39c4a3a 100644 --- a/src/Utils/Shaders/shaderTextureMask.cpp +++ b/src/Utils/Shaders/shaderTextureMask.cpp @@ -23,7 +23,6 @@ *******************************************************************************/ #ifdef WITH_QT -#include #include "Utils/Shaders/shaderTextureMask.h" diff --git a/src/Utils/Shaders/shaderVectorPerVertex.cpp b/src/Utils/Shaders/shaderVectorPerVertex.cpp index 55ef7e932291a2345a2d578427487544d205fd0d..9fac4ff84ba2ef959e220045f987d7aacce87189 100644 --- a/src/Utils/Shaders/shaderVectorPerVertex.cpp +++ b/src/Utils/Shaders/shaderVectorPerVertex.cpp @@ -22,7 +22,6 @@ * * *******************************************************************************/ -#include #include "Utils/Shaders/shaderVectorPerVertex.h" namespace CGoGN