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);
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);
+}
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
}
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;
}
}
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;
}
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