1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Obey the OPENGL_ES2_PROFILE hint

This commit is contained in:
Jari Vetoniemi 2012-06-30 22:35:26 +03:00
parent 2e7d91ea5a
commit 739be03373

View File

@ -52,7 +52,7 @@ static int getFBConfigAttrib(EGLConfig fbconfig, int attrib)
// Return a list of available and usable framebuffer configs
//========================================================================
static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, unsigned int* found)
{
EGLConfig fbconfigs[_GLFW_EGL_CONFIG_IN];
_GLFWfbconfig* result;
@ -106,6 +106,13 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
continue;
}
if (wndconfig->glProfile == GLFW_OPENGL_ES2_PROFILE &&
!(getFBConfigAttrib(fbconfigs[i], EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES2_BIT))
{
// User requested only OpenGL ES 2.0 context
continue;
}
result[*found].redBits = getFBConfigAttrib(fbconfigs[i], EGL_RED_SIZE);
result[*found].greenBits = getFBConfigAttrib(fbconfigs[i], EGL_GREEN_SIZE);
result[*found].blueBits = getFBConfigAttrib(fbconfigs[i], EGL_BLUE_SIZE);
@ -376,7 +383,7 @@ int _glfwCreateContext(_GLFWwindow* window,
_GLFWfbconfig* fbconfigs;
const _GLFWfbconfig* result;
fbconfigs = getFBConfigs(window, &fbcount);
fbconfigs = getFBConfigs(window, wndconfig, &fbcount);
if (!fbconfigs)
{
_glfwSetError(GLFW_PLATFORM_ERROR,