diff options
author | Andrey Nazarov <skuller@skuller.net> | 2013-08-06 19:52:27 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2013-09-03 13:41:10 +0400 |
commit | ca11b7ce07d94880793400ef8a6413a8472d8195 (patch) | |
tree | 831b222b65f2e32da70c752f915e8bad4792a56d /src | |
parent | 7749d28c46e13a0953d9c068efbb5b29374e25be (diff) |
Fix the way GL headers are included.
Use SDL_opengl.h when available. This is required on OS X since native
GL headers lack some PFNGL* typedefs there.
On Windows, pre-include windows.h when builing using MSVC since its gl.h
doesn't include it, resulting in build errors.
Diffstat (limited to 'src')
-rw-r--r-- | src/refresh/gl/qgl/dynamic.h | 9 | ||||
-rw-r--r-- | src/refresh/gl/qgl/fixed.h | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/refresh/gl/qgl/dynamic.h b/src/refresh/gl/qgl/dynamic.h index 1366799..4b322ba 100644 --- a/src/refresh/gl/qgl/dynamic.h +++ b/src/refresh/gl/qgl/dynamic.h @@ -19,12 +19,19 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef QGL_H #define QGL_H +#if USE_SDL +#include <SDL_opengl.h> +#else // USE_SDL +#ifdef _MSC_VER +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif // _MSC_VER #include <GL/gl.h> #include <GL/glext.h> - #ifndef APIENTRY #define APIENTRY #endif +#endif // !USE_SDL // subset of OpenGL 1.1 core functions #define QGL_core_IMP \ diff --git a/src/refresh/gl/qgl/fixed.h b/src/refresh/gl/qgl/fixed.h index 31045ca..d041fd1 100644 --- a/src/refresh/gl/qgl/fixed.h +++ b/src/refresh/gl/qgl/fixed.h @@ -19,8 +19,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef QGL_H #define QGL_H +#if USE_SDL +#include <SDL_opengl.h> +#else // USE_SDL +#ifdef _MSC_VER +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif // _MSC_VER #include <GL/gl.h> #include <GL/glext.h> +#endif // !USE_SDL // ========================================================== |