Skip to content

Instantly share code, notes, and snippets.

@randvoorhies
Last active August 29, 2015 13:56
Show Gist options
  • Save randvoorhies/9283072 to your computer and use it in GitHub Desktop.
Save randvoorhies/9283072 to your computer and use it in GitHub Desktop.
OpenGL/GLUT Patch for MRPT on OS X
diff -Naur --exclude='.git*' /Library/Caches/Homebrew/mrpt--git/apps/3DSceneViewer/_DSceneViewerMain.cpp ./apps/3DSceneViewer/_DSceneViewerMain.cpp
--- /Library/Caches/Homebrew/mrpt--git/apps/3DSceneViewer/_DSceneViewerMain.cpp 2014-02-28 16:24:13.000000000 -0800
+++ ./apps/3DSceneViewer/_DSceneViewerMain.cpp 2014-02-28 16:36:55.000000000 -0800
@@ -100,8 +100,13 @@
#include <windows.h>
#endif
-#include <GL/gl.h>
-#include <GL/glu.h>
+#ifdef MRPT_OS_APPLE
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glu.h>
+#else
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+#endif
// Critical section for updating the scene:
diff -Naur --exclude='.git*' /Library/Caches/Homebrew/mrpt--git/libs/gui/src/CDisplayWindow3D.cpp ./libs/gui/src/CDisplayWindow3D.cpp
--- /Library/Caches/Homebrew/mrpt--git/libs/gui/src/CDisplayWindow3D.cpp 2014-02-28 16:24:13.000000000 -0800
+++ ./libs/gui/src/CDisplayWindow3D.cpp 2014-02-28 16:34:10.000000000 -0800
@@ -43,9 +43,9 @@
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
- #endif
- #ifdef HAVE_FREEGLUT_EXT_H
- #include <GL/freeglut_ext.h>
+ #ifdef HAVE_FREEGLUT_EXT_H
+ #include <GL/freeglut_ext.h>
+ #endif
#endif
#endif
diff -Naur --exclude='.git*' /Library/Caches/Homebrew/mrpt--git/libs/gui/src/CMyGLCanvasBase.cpp ./libs/gui/src/CMyGLCanvasBase.cpp
--- /Library/Caches/Homebrew/mrpt--git/libs/gui/src/CMyGLCanvasBase.cpp 2014-02-28 16:24:13.000000000 -0800
+++ ./libs/gui/src/CMyGLCanvasBase.cpp 2014-02-28 16:34:08.000000000 -0800
@@ -38,11 +38,11 @@
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
+ #ifdef HAVE_FREEGLUT_EXT_H
+ #include <GL/freeglut_ext.h>
+ #endif
#endif
-#ifdef HAVE_FREEGLUT_EXT_H
- #include <GL/freeglut_ext.h>
- #endif
#endif
#if !wxUSE_GLCANVAS
diff -Naur --exclude='.git*' /Library/Caches/Homebrew/mrpt--git/libs/opengl/src/opengl_internals.h ./libs/opengl/src/opengl_internals.h
--- /Library/Caches/Homebrew/mrpt--git/libs/opengl/src/opengl_internals.h 2014-02-28 16:24:14.000000000 -0800
+++ ./libs/opengl/src/opengl_internals.h 2014-02-28 16:54:57.000000000 -0800
@@ -51,12 +51,15 @@
* under osx
*/
#ifdef __APPLE__
- #include <otherlibs/freeglut/GL/freeglut_std.h>
- #endif
-
- #ifdef HAVE_FREEGLUT_EXT_H
- #include <GL/freeglut_ext.h>
- #endif
+ //#include <otherlibs/freeglut/GL/freeglut_std.h>
+ #ifndef GLUT_INIT_STATE
+ #define GLUT_INIT_STATE 0x007C
+ #endif
+ #else
+ #ifdef HAVE_FREEGLUT_EXT_H
+ #include <GL/freeglut_ext.h>
+ #endif
+ #endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment