Browse Source

Added GLFW_INCLUDE_GLEXT for glext.h inclusion.

Closes #365.
Camilla Berglund 11 years ago
parent
commit
b140606a49
5 changed files with 31 additions and 6 deletions
  1. 7 2
      docs/build.dox
  2. 21 1
      include/GLFW/glfw3.h
  3. 1 1
      tests/defaults.c
  4. 1 1
      tests/fsaa.c
  5. 1 1
      tests/glfwinfo.c

+ 7 - 2
docs/build.dox

@@ -85,9 +85,14 @@ header.  This is useful in combination with an extension loading library.
 If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
 header (`OpenGL/gl.h` on OS X) is included.
 
+`GLFW_INCLUDE_GLEXT` makes the GLFW header include the appropriate extension
+header for the OpenGL or OpenGL ES header selected above after and _in addition
+to_ that header.
+
 `GLFW_INCLUDE_GLU` makes the header include the GLU header _in addition to_ the
-header selected above.  This should only be used with legacy code.  GLU has been
-deprecated and should not be used in new code.
+header selected above.  This should only be used with the standard OpenGL header
+and only for legacy code.  GLU has been deprecated and should not be used in new
+code.
 
 @note GLFW does not provide any of the API headers mentioned above.  They must
 be provided by your development environment or your OpenGL or OpenGL ES SDK.

+ 21 - 1
include/GLFW/glfw3.h

@@ -146,8 +146,13 @@ extern "C" {
 #if defined(__APPLE_CC__)
   #if defined(GLFW_INCLUDE_GLCOREARB)
     #include <OpenGL/gl3.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <OpenGL/gl3ext.h>
+    #endif
   #elif !defined(GLFW_INCLUDE_NONE)
-    #define GL_GLEXT_LEGACY
+    #if !defined(GLFW_INCLUDE_GLEXT)
+      #define GL_GLEXT_LEGACY
+    #endif
     #include <OpenGL/gl.h>
   #endif
   #if defined(GLFW_INCLUDE_GLU)
@@ -158,14 +163,29 @@ extern "C" {
     #include <GL/glcorearb.h>
   #elif defined(GLFW_INCLUDE_ES1)
     #include <GLES/gl.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <GLES/glext.h>
+    #endif
   #elif defined(GLFW_INCLUDE_ES2)
     #include <GLES2/gl2.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <GLES2/gl2ext.h>
+    #endif
   #elif defined(GLFW_INCLUDE_ES3)
     #include <GLES3/gl3.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <GLES3/gl2ext.h>
+    #endif
   #elif defined(GLFW_INCLUDE_ES31)
     #include <GLES3/gl31.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <GLES3/gl2ext.h>
+    #endif
   #elif !defined(GLFW_INCLUDE_NONE)
     #include <GL/gl.h>
+    #if defined(GLFW_INCLUDE_GLEXT)
+      #include <GL/glext.h>
+    #endif
   #endif
   #if defined(GLFW_INCLUDE_GLU)
     #include <GL/glu.h>

+ 1 - 1
tests/defaults.c

@@ -29,8 +29,8 @@
 //
 //========================================================================
 
+#define GLFW_INCLUDE_GLEXT
 #include <GLFW/glfw3.h>
-#include <GL/glext.h>
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 1
tests/fsaa.c

@@ -29,8 +29,8 @@
 //
 //========================================================================
 
+#define GLFW_INCLUDE_GLEXT
 #include <GLFW/glfw3.h>
-#include <GL/glext.h>
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 1
tests/glfwinfo.c

@@ -29,8 +29,8 @@
 //
 //========================================================================
 
+#define GLFW_INCLUDE_GLEXT
 #include <GLFW/glfw3.h>
-#include <GL/glext.h>
 
 #include <stdio.h>
 #include <stdlib.h>