]> git.cworth.org Git - apitrace/commitdiff
Fix MacOSX build.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 9 Oct 2011 16:05:58 +0000 (17:05 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 9 Oct 2011 16:05:58 +0000 (17:05 +0100)
glws_glx.cpp

index 23b4082d0a577414522a67f6c62d0d1ee224ec60..c0824172ec79e8b7bd086a92d7e1be7bac837ebc 100644 (file)
 #include <iostream>
 
 #include "glws.hpp"
+
+#ifdef __APPLE__
+#include <X11/Xlib.h>
+#include <GL/gl.h>
+#include <GL/glx.h>
+#else
 #include "glproc.hpp"
+#endif
 
 
 namespace glws {
@@ -297,7 +304,7 @@ createContext(const Visual *_visual, Context *shareContext)
         share_context = dynamic_cast<GlxContext*>(shareContext)->context;
     }
 
-
+#ifndef __APPLE__
     if (glxVersion >= 0x0104 && has_GLX_ARB_create_context) {
         Attributes<int> attribs;
         attribs.add(GLX_RENDER_TYPE, GLX_RGBA_TYPE);
@@ -307,7 +314,9 @@ createContext(const Visual *_visual, Context *shareContext)
         attribs.end();
 
         context = glXCreateContextAttribsARB(display, visual->fbconfig, share_context, True, attribs);
-    } else if (glxVersion >= 0x103) {
+    } else 
+#endif
+           if (glxVersion >= 0x103) {
         context = glXCreateNewContext(display, visual->fbconfig, GLX_RGBA_TYPE, share_context, True);
     } else {
         context = glXCreateContext(display, visual->visinfo, share_context, True);