1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-10-08 07:07:25 -04:00

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