From 0d50ee749f0f4353ae7ece08b8c741d30db0166c Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 6 Mar 2011 13:28:10 +0100 Subject: [PATCH] Added profile enum verification. --- src/window.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/window.c b/src/window.c index 6f151471..ccb1a314 100644 --- a/src/window.c +++ b/src/window.c @@ -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