Added profile enum verification.

This commit is contained in:
Camilla Berglund 2011-03-06 13:28:10 +01:00
parent 6d7d11643a
commit 0d50ee749f

View File

@ -169,6 +169,13 @@ static GLboolean isValidContextConfig(_GLFWwndconfig* wndconfig)
}
else if (wndconfig->glProfile)
{
if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE &&
wndconfig->glProfile != GLFW_OPENGL_COMPAT_PROFILE)
{
_glfwSetError(GLFW_INVALID_ENUM, "glfwOpenWindow: Invalid OpenGL profile");
return GL_FALSE;
}
if (wndconfig->glMajor < 3 || (wndconfig->glMajor == 3 && wndconfig->glMinor < 2))
{
// Desktop OpenGL context profiles are only defined for version 3.2