X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glimports.hpp;h=dce248a2649bc87caf721f2d7db8243595871c2f;hb=f682e19bee94eb69a5cfc8b2db17d7f1ebb10c2b;hp=4b21083449114031498b91068c2b9af6db6d7777;hpb=32871ed473727ee7628bda7cad6a9e4130d0374a;p=apitrace diff --git a/glimports.hpp b/glimports.hpp index 4b21083..dce248a 100644 --- a/glimports.hpp +++ b/glimports.hpp @@ -30,31 +30,45 @@ #ifndef _GLIMPORTS_HPP_ #define _GLIMPORTS_HPP_ -#ifdef WIN32 + +// Prevent including system's glext.h +#define __glext_h_ + + +#if defined(_WIN32) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif #include +#include -#else /* !WIN32 */ +#elif defined(__APPLE__) -#include +#include -#endif /* !WIN32 */ +#else +#include #include -#include +#endif /* !_WIN32 */ + + +// Include our own glext.h +#undef __glext_h_ +#include "glext/glext.h" + #ifndef GL_TEXTURE_INDEX_SIZE_EXT #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #endif -#ifdef WIN32 -#include +#if defined(_WIN32) + +#include "glext/wglext.h" #define GLAPIENTRY __stdcall @@ -65,7 +79,7 @@ #define PFD_SUPPORT_COMPOSITION 0x00008000 #endif -#ifdef __MINGW32__ +#ifndef WGL_SWAPMULTIPLE_MAX extern "C" typedef struct _WGLSWAP @@ -76,16 +90,35 @@ typedef struct _WGLSWAP #define WGL_SWAPMULTIPLE_MAX 16 -#endif /* __MINGW32__ */ +#endif /* !WGL_SWAPMULTIPLE_MAX */ + +#elif defined(__APPLE__) + +#include +#include +#include + +extern "C" { + +typedef int CGSConnectionID; +typedef int CGSWindowID; +typedef int CGSSurfaceID; -#else /* !WIN32 */ +CGLError CGLSetSurface(CGLContextObj ctx, CGSConnectionID cid, CGSWindowID wid, CGSSurfaceID sid); +CGLError CGLGetSurface(CGLContextObj ctx, CGSConnectionID* cid, CGSWindowID* wid, CGSSurfaceID* sid); +CGLError CGLUpdateContext(CGLContextObj ctx); + +} + +#else #include -#include +#include "glext/glxext.h" /* Prevent collision with Trace::Bool */ #undef Bool -#endif /* !WIN32 */ +#endif + #endif /* _GLIMPORTS_HPP_ */