]> git.cworth.org Git - apitrace/blobdiff - glimports.hpp
Add a custom filter to the event view.
[apitrace] / glimports.hpp
index 5277a0aabd2cc6871f0bc253e28a7dd571563bcc..dce248a2649bc87caf721f2d7db8243595871c2f 100644 (file)
 #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 <windows.h>
+#include <GL/gl.h>
+
+#elif defined(__APPLE__)
 
-#else /* !_WIN32 */
+#include <OpenGL/gl.h>
+
+#else
 
 #include <X11/Xlib.h>
+#include <GL/gl.h>
 
 #endif /* !_WIN32 */
 
-// Prevent including system's glext.h
-#define __glext_h_
-
-#include <GL/gl.h>
 
+// 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
+
+#if defined(_WIN32)
 
 #include "glext/wglext.h"
 
@@ -70,7 +79,7 @@
 #define PFD_SUPPORT_COMPOSITION 0x00008000
 #endif
 
-#ifdef __MINGW32__
+#ifndef WGL_SWAPMULTIPLE_MAX
 
 extern "C"
 typedef struct _WGLSWAP
@@ -81,9 +90,27 @@ typedef struct _WGLSWAP
 
 #define WGL_SWAPMULTIPLE_MAX 16
 
-#endif /* __MINGW32__ */
+#endif /* !WGL_SWAPMULTIPLE_MAX */
+
+#elif defined(__APPLE__)
+
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLIOSurface.h>
+#include <OpenGL/CGLDevice.h>
+
+extern "C" {
 
-#else /* !_WIN32 */
+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 <GL/glx.h>
 #include "glext/glxext.h"
@@ -91,6 +118,7 @@ typedef struct _WGLSWAP
 /* Prevent collision with Trace::Bool */
 #undef Bool
 
-#endif /* !_WIN32 */
+#endif
+
 
 #endif /* _GLIMPORTS_HPP_ */