瀏覽代碼

Fixes for gl.h inclusion

Josh Yelon 19 年之前
父節點
當前提交
4130fd7429
共有 4 個文件被更改,包括 33 次插入23 次删除
  1. 26 0
      panda/src/glgsg/glgsg.h
  2. 0 20
      panda/src/glstuff/glstuff_src.h
  3. 6 2
      panda/src/mesadisplay/mesagsg.h
  4. 1 1
      panda/src/nativenet/socket_portable.h

+ 26 - 0
panda/src/glgsg/glgsg.h

@@ -37,6 +37,32 @@
 #define EXPCL_GL EXPCL_PANDAGL
 #define EXPTP_GL EXPTP_PANDAGL
 
+// Before including gl.h, need to include windows.h
+#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+// This prevents glext.h from getting included by gl.h
+// That way, we can provide our own, better version.
+#define __glext_h_
+#define GL_GLEXT_VERSION 0
+
+#ifdef IS_OSX
+  #include <OpenGL/gl.h>
+  #ifdef HAVE_GLU
+  #include <OpenGL/glu.h>
+  #endif
+#else
+  #include <GL/gl.h>
+  #ifdef HAVE_GLU
+  #include <GL/glu.h>
+  #endif
+#endif
+
+#undef GL_GLEXT_VERSION
+#include "panda_glext.h"
+
 #include "glstuff_src.h"
 
 #endif  // GLGSG_H

+ 0 - 20
panda/src/glstuff/glstuff_src.h

@@ -37,26 +37,6 @@
 // This file is not protected from multiple inclusion; it may need to
 // be included multiple times.
 
-
-// Before including gl.h, need to include windows.h
-#if defined(_WIN32)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-// This prevents glext.h from getting included by gl.h
-// That way, we can provide our own, better version.
-#define __glext_h_
-#define GL_GLEXT_VERSION 0
-
-#include <GL/gl.h>
-#ifdef HAVE_GLU
-#include <GL/glu.h>
-#endif
-
-#undef GL_GLEXT_VERSION
-#include "panda_glext.h"
-
 #include "glmisc_src.h"
 #include "glTextureContext_src.h"
 #include "glVertexBufferContext_src.h"

+ 6 - 2
panda/src/mesadisplay/mesagsg.h

@@ -44,14 +44,18 @@
 #define EXPCL_GL EXPCL_PANDAMESA
 #define EXPTP_GL EXPTP_PANDAMESA
 
-// Don't include Mesa's provided glext.h file; we'll provide our own
-// that's more current.
+// This prevents glext.h from getting included by gl.h
+// That way, we can provide our own, better version.
 #define __glext_h_
+#define GL_GLEXT_VERSION 0
 
 #include <GL/gl.h>
 #include <GL/glu.h>
 #include <GL/osmesa.h>
 
+#undef GL_GLEXT_VERSION
+#include "panda_glext.h"
+
 #include "glstuff_src.h"
 
 #endif  // MESAGSG_H

+ 1 - 1
panda/src/nativenet/socket_portable.h

@@ -357,7 +357,7 @@ const int LOCAL_CONNECT_BLOCKING = EINPROGRESS;
 /************************************************************************
 * NO DEFINITION => GIVE COMPILATION ERROR
 ************************************************************************/
-No Host Type defined !!
+/* No Host Type defined !! */
 #error  Fatal
 #endif