diff options
author | Jeremy Huddleston <[email protected]> | 2011-10-21 00:22:40 -0700 |
---|---|---|
committer | Jeremy Huddleston <[email protected]> | 2011-10-21 00:34:06 -0700 |
commit | 9f2abbee6215d89e48b7fe042f8a905997f5c232 (patch) | |
tree | 372bdc82089b5f60c1feaa1bdac3950af39ba1bd /src/glx/apple/apple_glapi.c | |
parent | 098ecfad83a63bd8eb04c37f268c18d8744dff2c (diff) |
apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/glx/apple/apple_glapi.c')
-rw-r--r-- | src/glx/apple/apple_glapi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 34f726efb64..9a670bcfbb0 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); +} |