X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fapple%2Fapple_glapi.c;h=4d19f7f6a3ec67ee66e5506ded15f9a9d9aad4aa;hb=cb53aacaa1555b98fa77146492e96a7e3d7631ba;hp=34f726efb64275ed4610cab1126e944a06221916;hpb=424b1210d951c206e7c2fb8f2778acbd384eb247;p=mesa.git diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 34f726efb64..4d19f7f6a3e 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -38,6 +38,7 @@ #include +#include "main/glheader.h" #include "glapi.h" #include "glapitable.h" #include "main/dispatch.h" @@ -49,11 +50,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); @@ -66,8 +65,17 @@ void apple_glapi_set_dispatch(void) { SET_CopyPixels(__applegl_api, __applegl_glCopyPixels); SET_CopyColorTable(__applegl_api, __applegl_glCopyColorTable); SET_DrawBuffer(__applegl_api, __applegl_glDrawBuffer); - SET_DrawBuffersARB(__applegl_api, __applegl_glDrawBuffersARB); + SET_DrawBuffers(__applegl_api, __applegl_glDrawBuffers); 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); +}