|
|
|
@ -424,6 +424,38 @@ epoxy_get_core_proc_address(const char *name, int core_version) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if PLATFORM_HAS_EGL |
|
|
|
|
static EGLenum |
|
|
|
|
epoxy_egl_get_current_gl_context_api(void) |
|
|
|
|
{ |
|
|
|
|
EGLenum save_api = eglQueryAPI(); |
|
|
|
|
EGLContext ctx; |
|
|
|
|
|
|
|
|
|
if (eglBindAPI(EGL_OPENGL_API)) { |
|
|
|
|
ctx = eglGetCurrentContext(); |
|
|
|
|
if (ctx) { |
|
|
|
|
eglBindAPI(save_api); |
|
|
|
|
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 /* PLATFORM_HAS_EGL */ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Performs the dlsym() for the core GL 1.0 functions that we use for |
|
|
|
|
* determining version and extension support for deciding on dlsym |
|
|
|
@ -453,23 +485,10 @@ epoxy_get_bootstrap_proc_address(const char *name) |
|
|
|
|
#if PLATFORM_HAS_EGL |
|
|
|
|
get_dlopen_handle(&api.egl_handle, "libEGL.so.1", false); |
|
|
|
|
if (api.egl_handle) { |
|
|
|
|
EGLenum save_api = eglQueryAPI(); |
|
|
|
|
EGLContext ctx; |
|
|
|
|
|
|
|
|
|
if (eglBindAPI(EGL_OPENGL_API)) { |
|
|
|
|
ctx = eglGetCurrentContext(); |
|
|
|
|
if (ctx) { |
|
|
|
|
eglBindAPI(save_api); |
|
|
|
|
switch (epoxy_egl_get_current_gl_context_api()) { |
|
|
|
|
case EGL_OPENGL_API: |
|
|
|
|
return epoxy_gl_dlsym(name); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
(void)eglGetError(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (eglBindAPI(EGL_OPENGL_ES_API)) { |
|
|
|
|
ctx = eglGetCurrentContext(); |
|
|
|
|
eglBindAPI(save_api); |
|
|
|
|
if (ctx) { |
|
|
|
|
case EGL_OPENGL_ES_API: |
|
|
|
|
/* We can't resolve the GL version, because
|
|
|
|
|
* epoxy_glGetString() is one of the two things calling |
|
|
|
|
* us. Try the GLES2 implementation first, and fall back |
|
|
|
@ -481,9 +500,6 @@ epoxy_get_bootstrap_proc_address(const char *name) |
|
|
|
|
else |
|
|
|
|
return epoxy_gles1_dlsym(name); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
(void)eglGetError(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif /* PLATFORM_HAS_EGL */ |
|
|
|
|
|
|
|
|
|