diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index f5802222..f3c8e1ff 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -134,71 +134,97 @@ extern "C" { #include /* Include because it is needed by Vulkan and related functions. + * Include it unconditionally to avoid surprising side-effects. */ #include -/* Include the chosen client API headers. +/* Include the chosen OpenGL or OpenGL ES headers. */ #if 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_ES32) + #include #if defined(GLFW_INCLUDE_GLEXT) #include #endif -#elif defined(__APPLE__) - #if defined(GLFW_INCLUDE_GLCOREARB) + +#elif defined(GLFW_INCLUDE_GLCOREARB) + + #if defined(__APPLE__) + #include #if defined(GLFW_INCLUDE_GLEXT) #include - #endif - #elif !defined(GLFW_INCLUDE_NONE) + #endif /*GLFW_INCLUDE_GLEXT*/ + + #else /*__APPLE__*/ + + #include + + #endif /*__APPLE__*/ + +#elif !defined(GLFW_INCLUDE_NONE) + + #if defined(__APPLE__) + #if !defined(GLFW_INCLUDE_GLEXT) #define GL_GLEXT_LEGACY #endif #include - #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif -#else - #if defined(GLFW_INCLUDE_GLCOREARB) - #include - #elif !defined(GLFW_INCLUDE_NONE) + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #else /*__APPLE__*/ + #include #if defined(GLFW_INCLUDE_GLEXT) #include #endif - #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif -#endif + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #endif /*__APPLE__*/ + +#endif /* OpenGL and OpenGL ES headers */ + #if defined(GLFW_INCLUDE_VULKAN) + #if defined(__APPLE__) #include #else #include #endif -#endif + +#endif /* Vulkan header */ #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) /* GLFW_DLL must be defined by applications that are linking against the DLL