Match presence of lib prefix on EGL/GLES binaries

This commit is contained in:
Camilla Berglund 2016-07-20 13:11:08 +02:00
parent d5e00e6b0f
commit 2060de5ed0
2 changed files with 8 additions and 0 deletions

View File

@ -309,6 +309,8 @@ GLFWbool _glfwInitEGL(void)
if (!_glfw.egl.handle) if (!_glfw.egl.handle)
return GLFW_FALSE; return GLFW_FALSE;
_glfw.egl.prefix = (strncmp(sonames[i], "lib", 3) == 0);
_glfw.egl.GetConfigAttrib = (PFNEGLGETCONFIGATTRIBPROC) _glfw.egl.GetConfigAttrib = (PFNEGLGETCONFIGATTRIBPROC)
_glfw_dlsym(_glfw.egl.handle, "eglGetConfigAttrib"); _glfw_dlsym(_glfw.egl.handle, "eglGetConfigAttrib");
_glfw.egl.GetConfigs = (PFNEGLGETCONFIGSPROC) _glfw.egl.GetConfigs = (PFNEGLGETCONFIGSPROC)
@ -627,6 +629,11 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
for (i = 0; sonames[i]; i++) for (i = 0; sonames[i]; i++)
{ {
// HACK: Match presence of lib prefix to increase chance of finding
// a matching pair in the jungle that is Win32 EGL/GLES
if (_glfw.egl.prefix != (strncmp(sonames[i], "lib", 3) == 0))
continue;
window->context.egl.client = _glfw_dlopen(sonames[i]); window->context.egl.client = _glfw_dlopen(sonames[i]);
if (window->context.egl.client) if (window->context.egl.client)
break; break;

View File

@ -171,6 +171,7 @@ typedef struct _GLFWlibraryEGL
{ {
EGLDisplay display; EGLDisplay display;
EGLint major, minor; EGLint major, minor;
GLFWbool prefix;
GLFWbool KHR_create_context; GLFWbool KHR_create_context;
GLFWbool KHR_create_context_no_error; GLFWbool KHR_create_context_no_error;