glx: unify GLX_SGIX_pbuffer aliased declarations
[mesa.git] / src / glx / apple / apple_glx_pbuffer.c
index fb56b7512e622bafdb29110214d359777b463af1..142f4cce994a212b2647651656cee093cf9db905 100644 (file)
  prior written authorization.
 */
 
+/* Must be before OpenGL.framework is included.  Remove once fixed:
+ * <rdar://problem/7872773>
+ */
+#include <GL/gl.h>
+#include <GL/glext.h>
+#define __gltypes_h_ 1
+
+/* Must be first for:
+ * <rdar://problem/6953344>
+ */
+#include "apple_glx_context.h"
+#include "apple_glx_drawable.h"
+
 #include <stdlib.h>
 #include <pthread.h>
 #include <assert.h>
-#include <GL/glew.h>
 #include "apple_glx.h"
-#include "glcontextmodes.h"
-#include "apple_glx_context.h"
-#include "apple_glx_drawable.h"
+#include "glxconfig.h"
 #include "apple_cgl.h"
 
+/* mesa defines in glew.h, Apple in glext.h.
+ * Due to namespace nightmares, just do it here.
+ */
+#ifndef GL_TEXTURE_RECTANGLE_EXT
+#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
+#endif
+
 static bool pbuffer_make_current(struct apple_glx_context *ac,
                                  struct apple_glx_drawable *d);
 
@@ -67,8 +84,7 @@ pbuffer_make_current(struct apple_glx_context *ac,
    }
 
    if (!ac->made_current) {
-      glViewport(0, 0, pbuf->width, pbuf->height);
-      glScissor(0, 0, pbuf->width, pbuf->height);
+      apple_glapi_oglfw_viewport_scissor(0, 0, pbuf->width, pbuf->height);
       ac->made_current = true;
    }
 
@@ -111,7 +127,7 @@ apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config,
    Window root;
    int screen;
    Pixmap xid;
-   __GLcontextModes *modes = (__GLcontextModes *) config;
+   struct glx_config *modes = (struct glx_config *) config;
 
    root = DefaultRootWindow(dpy);
    screen = DefaultScreen(dpy);