From f2f6e9437ec696f6ba31eba227c48290c98bbf57 Mon Sep 17 00:00:00 2001 From: Kyle Brenneman Date: Wed, 28 Sep 2016 14:10:51 -0600 Subject: [PATCH] Use EGL_KHR_get_all_proc_addresses if possible. If EGL_KHR_get_all_proc_addresses extension is supported, then don't try to load a separate client library. Instead, just use eglGetProcAddress to load everything. This can also avoid problems with trying to use OpenGL functions from libGL.so.1 (which is the GLX library) when an EGL context is current. --- src/egl_context.c | 3 +++ src/egl_context.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/egl_context.c b/src/egl_context.c index 8915a6e15..a0743f3d4 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -399,6 +399,8 @@ GLFWbool _glfwInitEGL(void) extensionSupportedEGL("EGL_KHR_create_context_no_error"); _glfw.egl.KHR_gl_colorspace = extensionSupportedEGL("EGL_KHR_gl_colorspace"); + _glfw.egl.KHR_get_all_proc_addresses = + extensionSupportedEGL("EGL_KHR_get_all_proc_addresses"); return GLFW_TRUE; } @@ -583,6 +585,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, window->context.egl.config = config; // Load the appropriate client library + if (!_glfw.egl.KHR_get_all_proc_addresses) { int i; const char** sonames; diff --git a/src/egl_context.h b/src/egl_context.h index 39bd575ff..dbe99340c 100644 --- a/src/egl_context.h +++ b/src/egl_context.h @@ -176,6 +176,7 @@ typedef struct _GLFWlibraryEGL GLFWbool KHR_create_context; GLFWbool KHR_create_context_no_error; GLFWbool KHR_gl_colorspace; + GLFWbool KHR_get_all_proc_addresses; void* handle;