diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 1b93a3eb..64d797db 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -133,10 +133,38 @@ extern "C" { /* Most GL/glu.h variants on Windows need wchar_t * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */ -#include +#if !defined(GLFW_INCLUDE_NONE) + #include +#endif - -/* ---------------- GLFW related system specific defines ----------------- */ +/* Include the chosen client API headers. + */ +#if defined(__APPLE_CC__) + #if defined(GLFW_INCLUDE_GLCOREARB) + #include + #elif !defined(GLFW_INCLUDE_NONE) + #define GL_GLEXT_LEGACY + #include + #endif + #if defined(GLFW_INCLUDE_GLU) + #include + #endif +#else + #if defined(GLFW_INCLUDE_GLCOREARB) + #include + #elif defined(GLFW_INCLUDE_ES1) + #include + #elif defined(GLFW_INCLUDE_ES2) + #include + #elif defined(GLFW_INCLUDE_ES3) + #include + #elif !defined(GLFW_INCLUDE_NONE) + #include + #endif + #if defined(GLFW_INCLUDE_GLU) + #include + #endif +#endif #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) /* GLFW_DLL is defined by users of GLFW when compiling programs that will link @@ -173,35 +201,6 @@ extern "C" { /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ -/* Include the chosen client API headers. - */ -#if defined(__APPLE_CC__) - #if defined(GLFW_INCLUDE_GLCOREARB) - #include - #elif !defined(GLFW_INCLUDE_NONE) - #define GL_GLEXT_LEGACY - #include - #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif -#else - #if defined(GLFW_INCLUDE_GLCOREARB) - #include - #elif defined(GLFW_INCLUDE_ES1) - #include - #elif defined(GLFW_INCLUDE_ES2) - #include - #elif defined(GLFW_INCLUDE_ES3) - #include - #elif !defined(GLFW_INCLUDE_NONE) - #include - #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif -#endif - /************************************************************************* * GLFW API tokens