X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glimports.hpp;h=dce248a2649bc87caf721f2d7db8243595871c2f;hb=1b4746a25a581405da502bcb83c01af3c808759e;hp=d3dc89b7dfbb2776609ce9e0fc357096d5c0d326;hpb=0ad49cbe3446dfe8404516852c904b40cf909c7c;p=apitrace diff --git a/glimports.hpp b/glimports.hpp index d3dc89b..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 + +#elif defined(__APPLE__) -#else /* !_WIN32 */ +#include + +#else #include +#include #endif /* !_WIN32 */ -#include -#include +// 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 */ -#else /* !_WIN32 */ +#elif defined(__APPLE__) + +#include +#include +#include + +extern "C" { + +typedef int CGSConnectionID; +typedef int CGSWindowID; +typedef int CGSSurfaceID; + +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_ */