diff --git a/docs/build.dox b/docs/build.dox index 60a6e24b..4ee79387 100644 --- a/docs/build.dox +++ b/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. diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 0b3cc077..83b2ff00 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -146,8 +146,13 @@ extern "C" { #if defined(__APPLE_CC__) #if defined(GLFW_INCLUDE_GLCOREARB) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #elif !defined(GLFW_INCLUDE_NONE) - #define GL_GLEXT_LEGACY + #if !defined(GLFW_INCLUDE_GLEXT) + #define GL_GLEXT_LEGACY + #endif #include #endif #if defined(GLFW_INCLUDE_GLU) @@ -158,14 +163,29 @@ extern "C" { #include #elif defined(GLFW_INCLUDE_ES1) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #elif defined(GLFW_INCLUDE_ES2) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #elif defined(GLFW_INCLUDE_ES3) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #elif defined(GLFW_INCLUDE_ES31) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #elif !defined(GLFW_INCLUDE_NONE) #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif #endif #if defined(GLFW_INCLUDE_GLU) #include diff --git a/tests/defaults.c b/tests/defaults.c index 2d483540..07ba5a45 100644 --- a/tests/defaults.c +++ b/tests/defaults.c @@ -29,8 +29,8 @@ // //======================================================================== +#define GLFW_INCLUDE_GLEXT #include -#include #include #include diff --git a/tests/fsaa.c b/tests/fsaa.c index 459b7111..ef784390 100644 --- a/tests/fsaa.c +++ b/tests/fsaa.c @@ -29,8 +29,8 @@ // //======================================================================== +#define GLFW_INCLUDE_GLEXT #include -#include #include #include diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c index dcf53537..ad44027f 100644 --- a/tests/glfwinfo.c +++ b/tests/glfwinfo.c @@ -29,8 +29,8 @@ // //======================================================================== +#define GLFW_INCLUDE_GLEXT #include -#include #include #include