Various error fixes.

Fixed incorrect error types.  Added missing error string prefixes.
Removed some invalid or superfluous error emissions.  Clarified some
error strings.  Joined error string lines to aid grep.  Replaced some
generic error strings with specific ones.  Documentation work.

Fixes #450.
This commit is contained in:
Camilla Berglund
2015-03-10 19:51:14 +01:00
parent a75e43ef22
commit d493a82f9e
18 changed files with 124 additions and 157 deletions
+6 -12
View File
@@ -42,7 +42,7 @@ int _glfwInitContextAPI(void)
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
if (_glfw.nsgl.framework == NULL)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
_glfwInputError(GLFW_API_UNAVAILABLE,
"NSGL: Failed to locate OpenGL framework");
return GL_FALSE;
}
@@ -76,8 +76,7 @@ int _glfwCreateContext(_GLFWwindow* window,
if (ctxconfig->major == 3 && ctxconfig->minor < 2)
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X does not "
"support OpenGL 3.0 or 3.1");
"NSGL: The targeted version of OS X does not support OpenGL 3.0 or 3.1");
return GL_FALSE;
}
@@ -86,18 +85,14 @@ int _glfwCreateContext(_GLFWwindow* window,
if (!ctxconfig->forward)
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X only "
"supports OpenGL 3.2 and later versions if they "
"are forward-compatible");
"NSGL: The targeted version of OS X only supports forward-compatible contexts for OpenGL 3.2 and above");
return GL_FALSE;
}
if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE)
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X only "
"supports OpenGL 3.2 and later versions if they "
"use the core profile");
"NSGL: The targeted version of OS X only supports core profile contexts for OpenGL 3.2 and above");
return GL_FALSE;
}
}
@@ -106,8 +101,7 @@ int _glfwCreateContext(_GLFWwindow* window,
if (ctxconfig->major > 2)
{
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: The targeted version of OS X does not "
"support OpenGL version 3.0 or above");
"NSGL: The targeted version of OS X does not support OpenGL version 3.0 or above");
return GL_FALSE;
}
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
@@ -232,7 +226,7 @@ int _glfwCreateContext(_GLFWwindow* window,
shareContext:share];
if (window->nsgl.context == nil)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
_glfwInputError(GLFW_VERSION_UNAVAILABLE,
"NSGL: Failed to create OpenGL context");
return GL_FALSE;
}