This commit is contained in:
Camilla Berglund
2016-03-20 09:39:53 +01:00
parent c1e4c45c7a
commit 5eb2e83c82
3 changed files with 15 additions and 39 deletions
+15 -22
View File
@@ -370,6 +370,21 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
return GLFW_FALSE;
}
if (window->context.major < ctxconfig->major ||
(window->context.major == ctxconfig->major &&
window->context.minor < ctxconfig->minor))
{
// The desired OpenGL version is greater than the actual version
// This only happens if the machine lacks {GLX|WGL}_ARB_create_context
// /and/ the user has requested an OpenGL version greater than 1.0
// For API consistency, we emulate the behavior of the
// {GLX|WGL}_ARB_create_context extension and fail here
_glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);
return GLFW_FALSE;
}
if (window->context.major >= 3)
{
// OpenGL 3.0+ uses a different function for extension string retrieval
@@ -490,28 +505,6 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
return GLFW_TRUE;
}
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
if (window->context.major < ctxconfig->major ||
(window->context.major == ctxconfig->major &&
window->context.minor < ctxconfig->minor))
{
// The desired OpenGL version is greater than the actual version
// This only happens if the machine lacks {GLX|WGL}_ARB_create_context
// /and/ the user has requested an OpenGL version greater than 1.0
// For API consistency, we emulate the behavior of the
// {GLX|WGL}_ARB_create_context extension and fail here
_glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);
return GLFW_FALSE;
}
return GLFW_TRUE;
}
GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions)
{
const char* start = extensions;