From 7915e8d778c8cdb3e0f67f2c2616ad5b336bd651 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 21 Mar 2013 01:12:07 +0100 Subject: [PATCH] Added setting of EGL_RENDERABLE_TYPE. --- src/egl_context.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/egl_context.c b/src/egl_context.c index a5f15bd5..6b7481c6 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -162,10 +162,22 @@ int _glfwCreateContext(_GLFWwindow* window, if (wndconfig->share) share = wndconfig->share->egl.context; - // Retrieve the previously selected EGLConfig + // Find a suitable EGLConfig { int index = 0; + if (wndconfig->clientAPI == GLFW_OPENGL_API) + setEGLattrib(EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT); + + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) + { + if (wndconfig->glMajor == 1) + setEGLattrib(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT); + + if (wndconfig->glMajor == 2) + setEGLattrib(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT); + } + setEGLattrib(EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER); if (fbconfig->redBits)