summaryrefslogtreecommitdiffstats
path: root/src/glx/apple
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-10-21 00:22:40 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-10-21 00:34:06 -0700
commit9f2abbee6215d89e48b7fe042f8a905997f5c232 (patch)
tree372bdc82089b5f60c1feaa1bdac3950af39ba1bd /src/glx/apple
parent098ecfad83a63bd8eb04c37f268c18d8744dff2c (diff)
downloadexternal_mesa3d-9f2abbee6215d89e48b7fe042f8a905997f5c232.zip
external_mesa3d-9f2abbee6215d89e48b7fe042f8a905997f5c232.tar.gz
external_mesa3d-9f2abbee6215d89e48b7fe042f8a905997f5c232.tar.bz2
apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src/glx/apple')
-rw-r--r--src/glx/apple/apple_glapi.c15
-rw-r--r--src/glx/apple/apple_glx.h1
-rw-r--r--src/glx/apple/apple_glx_pbuffer.c3
-rw-r--r--src/glx/apple/apple_glx_pixmap.c3
-rw-r--r--src/glx/apple/apple_glx_surface.c3
5 files changed, 15 insertions, 10 deletions
diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c
index 34f726e..9a670bc 100644
--- a/src/glx/apple/apple_glapi.c
+++ b/src/glx/apple/apple_glapi.c
@@ -49,11 +49,9 @@
struct _glapi_table * __ogl_framework_api = NULL;
struct _glapi_table * __applegl_api = NULL;
-void apple_glapi_set_dispatch(void) {
- if(__applegl_api) {
- _glapi_set_dispatch(__applegl_api);
+static void _apple_glapi_create_table(void) {
+ if (__applegl_api)
return;
- }
__ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl");
assert(__ogl_framework_api);
@@ -68,6 +66,15 @@ void apple_glapi_set_dispatch(void) {
SET_DrawBuffer(__applegl_api, __applegl_glDrawBuffer);
SET_DrawBuffersARB(__applegl_api, __applegl_glDrawBuffersARB);
SET_Viewport(__applegl_api, __applegl_glViewport);
+}
+void apple_glapi_set_dispatch(void) {
+ _apple_glapi_create_table();
_glapi_set_dispatch(__applegl_api);
}
+
+void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
+ _apple_glapi_create_table();
+ __ogl_framework_api->Viewport(x, y, width, height);
+ __ogl_framework_api->Scissor(x, y, width, height);
+}
diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h
index c70fc00..ce8c488 100644
--- a/src/glx/apple/apple_glx.h
+++ b/src/glx/apple/apple_glx.h
@@ -46,5 +46,6 @@ void apple_glx_waitx(Display * dpy, void *ptr);
int apple_get_dri_event_base(void);
void apple_glapi_set_dispatch(void);
+void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height);
#endif
diff --git a/src/glx/apple/apple_glx_pbuffer.c b/src/glx/apple/apple_glx_pbuffer.c
index 2817cda..142f4cc 100644
--- a/src/glx/apple/apple_glx_pbuffer.c
+++ b/src/glx/apple/apple_glx_pbuffer.c
@@ -84,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;
}
diff --git a/src/glx/apple/apple_glx_pixmap.c b/src/glx/apple/apple_glx_pixmap.c
index 4586707..bee0ec9 100644
--- a/src/glx/apple/apple_glx_pixmap.c
+++ b/src/glx/apple/apple_glx_pixmap.c
@@ -80,8 +80,7 @@ pixmap_make_current(struct apple_glx_context *ac,
}
if (!ac->made_current) {
- glViewport(0, 0, p->width, p->height);
- glScissor(0, 0, p->width, p->height);
+ apple_glapi_oglfw_viewport_scissor(0, 0, p->width, p->height);
ac->made_current = true;
}
diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c
index 6db2910..39f5130 100644
--- a/src/glx/apple/apple_glx_surface.c
+++ b/src/glx/apple/apple_glx_surface.c
@@ -53,8 +53,7 @@ update_viewport_and_scissor(Display * dpy, GLXDrawable drawable)
XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &bd, &depth);
- glViewport(0, 0, width, height);
- glScissor(0, 0, width, height);
+ apple_glapi_oglfw_viewport_scissor(0, 0, width, height);
}
static bool