Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
797d1723
Commit
797d1723
authored
Feb 22, 2011
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maj probleme compilation mac osX
parent
7d8cee23
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
13 deletions
+44
-13
Apps/Tuto/CMakeLists.txt
Apps/Tuto/CMakeLists.txt
+1
-1
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+3
-1
build/CMakeLists.txt
build/CMakeLists.txt
+2
-0
include/Utils/glutwingl3.h
include/Utils/glutwingl3.h
+15
-4
src/Utils/glutwin_gl3.cpp
src/Utils/glutwin_gl3.cpp
+23
-7
No files found.
Apps/Tuto/CMakeLists.txt
View file @
797d1723
...
...
@@ -55,7 +55,7 @@ target_link_libraries( tp_master
add_executable
(
tuto_mt tuto_mt.cpp
)
target_link_libraries
(
tuto_mt
container topology utils algo
${
COMMON_LIBS
}
boost_thread
)
container topology utils algo
${
COMMON_LIBS
}
boost_thread
-mt
)
add_executable
(
tuto_ogl3 tuto_ogl3.cpp
)
target_link_libraries
(
tuto_ogl3
...
...
ThirdParty/CMakeLists.txt
View file @
797d1723
...
...
@@ -8,7 +8,9 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
find_package
(
OpenGL
)
find_package
(
GLUT
)
IF
(
APPLE
)
SET
(
CMAKE_OSX_ARCHITECTURES x86_64
)
ENDIF
(
APPLE
)
#On Windows we use AntTweakBar/OpenCTM of dependencies, not compiled
IF
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib
)
#release added by visual
...
...
build/CMakeLists.txt
View file @
797d1723
...
...
@@ -17,6 +17,8 @@ IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement
SET
(
CMAKE_OSX_SYSROOT
"/Developer/SDKs/MacOSX10.6.sdk"
)
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
)
ENDIF
(
APPLE
)
IF
(
WIN32
)
...
...
include/Utils/glutwingl3.h
View file @
797d1723
...
...
@@ -38,9 +38,14 @@
#include <GL/freeglut.h>
#ifndef WIN32
#include <GL/glx.h>
#ifdef MAC_OSX
#include <OpenGL/CGLCurrent.h>
#else
#include <GL/glx.h>
#endif
#endif
#include "Utils/trackball.h"
#include <IL/ilu.h>
#include <IL/ilut.h>
...
...
@@ -142,13 +147,19 @@ protected:
virtual
void
myMouseClick
(
int
button
,
int
state
,
int
x
,
int
y
)
{}
#ifdef WIN32
HDC
m_drawable
;
HGLRC
m_context
;
#else
Display
*
m_dpy
;
GLXDrawable
m_drawable
;
GLXContext
m_context
;
#ifdef MAC_OSX
CGLContextObj
m_context
;
#else
Display
*
m_dpy
;
GLXDrawable
m_drawable
;
GLXContext
m_context
;
#endif
#endif
public:
...
...
src/Utils/glutwin_gl3.cpp
View file @
797d1723
...
...
@@ -22,7 +22,7 @@
* *
*******************************************************************************/
#ifndef MAC_OSX
//
#ifndef MAC_OSX
#include <stdlib.h>
...
...
@@ -143,13 +143,18 @@ SimpleGlutWinGL3::SimpleGlutWinGL3(int* argc, char **argv, int winX, int winY)
glEnable
(
GL_LIGHTING
);
//Store context infos
#ifdef WIN32
m_drawable
=
wglGetCurrentDC
();
m_context
=
wglGetCurrentContext
();
#else
m_dpy
=
glXGetCurrentDisplay
();
m_drawable
=
glXGetCurrentDrawable
();
m_context
=
glXGetCurrentContext
();
#ifdef MAC_OSX
m_context
=
CGLGetCurrentContext
();
#else
m_dpy
=
glXGetCurrentDisplay
();
m_drawable
=
glXGetCurrentDrawable
();
m_context
=
glXGetCurrentContext
();
#endif
#endif
// Call other initialization (possibly overloaded in instances)
instance
->
init
();
...
...
@@ -237,12 +242,17 @@ void SimpleGlutWinGL3::setCurrentShader(Utils::GLSLShader* sh)
glutPostRedisplay
();
}
void
SimpleGlutWinGL3
::
releaseContext
()
{
#ifdef WIN32
wglMakeCurrent
(
NULL
,
NULL
);
#else
glXMakeCurrent
(
m_dpy
,
None
,
NULL
);
#ifdef MAC_OSX
CGLSetCurrentContext
(
NULL
);
#else
glXMakeCurrent
(
m_dpy
,
None
,
NULL
);
#endif
#endif
}
...
...
@@ -251,13 +261,19 @@ void SimpleGlutWinGL3::useContext()
#ifdef WIN32
wglMakeCurrent
(
m_drawable
,
m_context
);
#else
glXMakeCurrent
(
m_dpy
,
m_drawable
,
m_context
);
#ifdef MAC_OSX
CGLSetCurrentContext
(
m_context
);
#else
glXMakeCurrent
(
m_dpy
,
m_drawable
,
m_context
);
#endif
#endif
}
void
SimpleGlutWinGL3
::
recalcModelView
(
void
)
{
glm
::
mat4
m
;
...
...
@@ -503,4 +519,4 @@ GLfloat SimpleGlutWinGL3::getOrthoScreenRay(int x, int y, Geom::Vec3f& rayA, Geo
}
// namespace Utils
}
// namespace CGoGN
#endif
//
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment