Fix "epoxy_egl_get_current_gl_context_api" to use "eglQueryContext" with "EGL_CONTEXT_CLIENT_TYPE" as "attribute".

macos/v1.5.9
Yaron Cohen-Tal 9 years ago
parent b3b8bd9af7
commit 8d58c89064
  1. 32
      src/dispatch_common.c

@ -542,31 +542,13 @@ epoxy_get_core_proc_address(const char *name, int core_version)
static EGLenum static EGLenum
epoxy_egl_get_current_gl_context_api(void) epoxy_egl_get_current_gl_context_api(void)
{ {
EGLenum save_api = eglQueryAPI(); EGLDisplay eglDisplay = eglGetCurrentDisplay();
EGLContext ctx; EGLContext eglContext = eglGetCurrentContext();
EGLint eglContextClientType = EGL_NONE;
if (eglBindAPI(EGL_OPENGL_API)) { return eglQueryContext(eglDisplay, eglContext, EGL_CONTEXT_CLIENT_TYPE,
ctx = eglGetCurrentContext(); &eglContextClientType) == EGL_TRUE
if (ctx) { ? (EGLenum)eglContextClientType
eglBindAPI(save_api); : EGL_NONE;
return EGL_OPENGL_API;
}
} else {
(void)eglGetError();
}
if (eglBindAPI(EGL_OPENGL_ES_API)) {
ctx = eglGetCurrentContext();
eglBindAPI(save_api);
if (ctx) {
eglBindAPI(save_api);
return EGL_OPENGL_ES_API;
}
} else {
(void)eglGetError();
}
return EGL_NONE;
} }
#endif /* EPOXY_SUPPORT_EGL */ #endif /* EPOXY_SUPPORT_EGL */

Loading…
Cancel
Save