From 1d647668afc8eb4aa6bfa668180a1de26a8e2146 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Thu, 16 Jul 2020 14:02:32 +0100 Subject: [PATCH] EGL user context code simplification --- src/egl_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/egl_context.c b/src/egl_context.c index 9797d63c..7b3e1b88 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -508,7 +508,7 @@ void _glfwTerminateEGL(void) // Create the OpenGL or OpenGL ES context for the window eglConfig // -GLFWbool _glfwCreateContextForConfigEGL(_GLFWwindow* window, +GLFWbool _glfwCreateContextForConfigEGL(EGLConfig eglConfig, const _GLFWctxconfig* ctxconfig, EGLContext* context) { @@ -620,7 +620,7 @@ GLFWbool _glfwCreateContextForConfigEGL(_GLFWwindow* window, setAttrib(EGL_NONE, EGL_NONE); - *context = eglCreateContext(_glfw.egl.display, window->context.egl.config, share, attribs); + *context = eglCreateContext(_glfw.egl.display, eglConfig, share, attribs); if (*context == EGL_NO_CONTEXT) { @@ -650,7 +650,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, return GLFW_FALSE; } - if (!_glfwCreateContextForConfigEGL(window,ctxconfig,&window->context.egl.handle)) + if (!_glfwCreateContextForConfigEGL(window->context.egl.config,ctxconfig,&window->context.egl.handle)) { return GLFW_FALSE; } @@ -869,7 +869,7 @@ _GLFWusercontext* _glfwCreateUserContextEGL(_GLFWwindow* window) ctxconfig = _glfw.hints.context; ctxconfig.share = window; - if (!_glfwCreateContextForConfigEGL(window,&ctxconfig,&context->egl.handle)) + if (!_glfwCreateContextForConfigEGL(window->context.egl.config,&ctxconfig,&context->egl.handle)) { _glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to create user OpenGL context");