/*
- Copyright (c) 2009 Apple Inc.
+ Copyright (c) 2009-2011 Apple Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
prior written authorization.
*/
+/* This should be removed once stereo hardware bugs are fixed
+ * <rdar://problem/6729006>
+ */
+
#include <stdbool.h>
-#include "apple_xgl_api_stereo.h"
-#include "apple_xgl_api.h"
+
+#define GL_GLEXT_PROTOTYPES
+#include <GL/gl.h>
+#include <GL/glext.h>
+
+#include "glxclient.h"
#include "apple_glx_context.h"
+#include "apple_xgl_api.h"
+#include "main/glheader.h"
+#include "glapitable.h"
+
+extern struct _glapi_table * __ogl_framework_api;
-extern struct apple_xgl_api __gl_api;
/*
* These are special functions for stereoscopic support
* differences in MacOS X.
*/
void
-glDrawBuffer(GLenum mode)
+__applegl_glDrawBuffer(GLenum mode)
{
- GLXContext gc = glXGetCurrentContext();
+ struct glx_context * gc = __glXGetCurrentContext();
- if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
+ if (gc != &dummyContext && apple_glx_context_uses_stereo(gc->driContext)) {
GLenum buf[2];
GLsizei n = 0;
break;
}
- __gl_api.DrawBuffers(n, buf);
+ __ogl_framework_api->DrawBuffers(n, buf);
}
else {
- __gl_api.DrawBuffer(mode);
+ __ogl_framework_api->DrawBuffer(mode);
}
}
void
-glDrawBuffers(GLsizei n, const GLenum * bufs)
+__applegl_glDrawBuffers(GLsizei n, const GLenum * bufs)
{
- GLXContext gc = glXGetCurrentContext();
+ struct glx_context * gc = __glXGetCurrentContext();
- if (gc && apple_glx_context_uses_stereo(gc->driContext)) {
+ if (gc != &dummyContext && apple_glx_context_uses_stereo(gc->driContext)) {
GLenum newbuf[n + 2];
GLsizei i, outi = 0;
bool have_back = false;
newbuf[outi++] = GL_FRONT_RIGHT;
}
- __gl_api.DrawBuffers(outi, newbuf);
+ __ogl_framework_api->DrawBuffers(outi, newbuf);
}
else {
- __gl_api.DrawBuffers(n, bufs);
+ __ogl_framework_api->DrawBuffers(n, bufs);
}
}
-
-void
-glDrawBuffersARB(GLsizei n, const GLenum * bufs)
-{
- glDrawBuffers(n, bufs);
-}