Made glfwOpenWindow enforce the forward-compat and profile hints.

This commit is contained in:
Camilla Berglund
2012-03-05 20:27:47 +01:00
parent 4b21ccbe19
commit cb9bae5c71
2 changed files with 13 additions and 3 deletions
+12 -3
View File
@@ -675,14 +675,23 @@ static GLboolean createContext(_GLFWwindow* window,
return GL_FALSE;
}
if (wndconfig->glProfile)
if (wndconfig->glMajor > 2)
{
// Fail if a profile other than core was explicitly selected
if (!wndconfig->glForward)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
"Cocoa/NSOpenGL: The targeted version of Mac OS X "
"only supports OpenGL 3.2 contexts if they are "
"forward-compatible");
return GL_FALSE;
}
if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
"Cocoa/NSOpenGL: The targeted version of Mac OS X "
"only supports the OpenGL core profile");
"only supports OpenGL 3.2 contexts if they use the "
"core profile");
return GL_FALSE;
}
}