Made error message tags more consistent.
diff --git a/src/cocoa_init.m b/src/cocoa_init.m
index 3bb61c1..e4de641 100644
--- a/src/cocoa_init.m
+++ b/src/cocoa_init.m
@@ -85,8 +85,7 @@
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
if (_glfwLibrary.NSGL.framework == NULL)
{
- _glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwInit: Failed to locate OpenGL framework");
+ _glfwSetError(GLFW_PLATFORM_ERROR, "Failed to locate OpenGL framework");
return GL_FALSE;
}
diff --git a/src/cocoa_window.m b/src/cocoa_window.m
index 040277a..aa28d24 100644
--- a/src/cocoa_window.m
+++ b/src/cocoa_window.m
@@ -731,7 +731,7 @@
if (wndconfig->clientAPI == GLFW_OPENGL_ES_API)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: NSOpenGL does not support OpenGL ES");
+ "NSOpenGL: This API does not support OpenGL ES");
return GL_FALSE;
}
diff --git a/src/context.c b/src/context.c
index 4dba4a8..4eb2c6d 100644
--- a/src/context.c
+++ b/src/context.c
@@ -255,7 +255,6 @@
//========================================================================
// Checks whether the client API part of the window config is sane
-// It blames glfwOpenWindow because that's the only caller
//========================================================================
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
@@ -263,8 +262,7 @@
if (wndconfig->clientAPI != GLFW_OPENGL_API &&
wndconfig->clientAPI != GLFW_OPENGL_ES_API)
{
- _glfwSetError(GLFW_INVALID_ENUM,
- "glfwCreateWindow: Invalid client API requested");
+ _glfwSetError(GLFW_INVALID_ENUM, "Invalid client API requested");
return GL_FALSE;
}
@@ -281,7 +279,7 @@
// OpenGL 3.x series ended with version 3.3
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Invalid OpenGL version %i.%i requested",
+ "Invalid OpenGL version %i.%i requested",
wndconfig->glMajor, wndconfig->glMinor);
return GL_FALSE;
}
@@ -296,7 +294,7 @@
wndconfig->glProfile != GLFW_OPENGL_COMPAT_PROFILE)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwCreateWindow: Invalid OpenGL profile requested");
+ "Invalid OpenGL profile requested");
return GL_FALSE;
}
@@ -307,7 +305,7 @@
// and above
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Context profiles only exist for "
+ "Context profiles only exist for "
"OpenGL version 3.2 and above");
return GL_FALSE;
}
@@ -317,8 +315,8 @@
{
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Forward compatibility only exist "
- "for OpenGL version 3.0 and above");
+ "Forward compatibility only exist for OpenGL "
+ "version 3.0 and above");
return GL_FALSE;
}
}
@@ -333,7 +331,7 @@
// OpenGL ES 2.x series ended with version 2.0
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Invalid OpenGL ES version %i.%i requested",
+ "Invalid OpenGL ES version %i.%i requested",
wndconfig->glMajor, wndconfig->glMinor);
return GL_FALSE;
}
@@ -346,8 +344,7 @@
{
// OpenGL ES does not support profiles
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Context profiles are not supported "
- "by OpenGL ES");
+ "Context profiles are not supported by OpenGL ES");
return GL_FALSE;
}
@@ -355,8 +352,7 @@
{
// OpenGL ES does not support forward-compatibility
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Forward compatibility is not "
- "supported by OpenGL ES");
+ "Forward compatibility is not supported by OpenGL ES");
return GL_FALSE;
}
}
@@ -367,8 +363,7 @@
wndconfig->glRobustness != GLFW_LOSE_CONTEXT_ON_RESET)
{
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Invalid OpenGL robustness mode "
- "requested");
+ "Invalid OpenGL robustness mode requested");
return GL_FALSE;
}
}
@@ -379,7 +374,6 @@
//========================================================================
// Reads back context properties
-// It blames glfwCreateWindow because that's the only caller
//========================================================================
GLboolean _glfwRefreshContextParams(void)
@@ -404,7 +398,7 @@
if (!window->GetStringi)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwCreateWindow: Entry point retrieval is broken");
+ "Entry point retrieval is broken");
return GL_FALSE;
}
}
@@ -483,7 +477,6 @@
//========================================================================
// Checks whether the current context fulfils the specified requirements
-// It blames glfwCreateWindow because that's the only caller
//========================================================================
GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)
@@ -501,8 +494,7 @@
// For API consistency, we emulate the behavior of the
// {GLX|WGL}_ARB_create_context extension and fail here
- _glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "glfwCreateWindow: The requested OpenGL version is not available");
+ _glfwSetError(GLFW_VERSION_UNAVAILABLE, NULL);
return GL_FALSE;
}
diff --git a/src/gamma.c b/src/gamma.c
index 51e0ce1..0718088 100644
--- a/src/gamma.c
+++ b/src/gamma.c
@@ -55,7 +55,7 @@
if (gamma <= 0.f)
{
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwSetGamma: Gamma value must be greater than zero");
+ "Gamma value must be greater than zero");
return;
}
diff --git a/src/glx_context.c b/src/glx_context.c
index ac9d066..1db55dd 100644
--- a/src/glx_context.c
+++ b/src/glx_context.c
@@ -294,7 +294,9 @@
if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0)
{
- // Request an explicitly versioned context
+ // NOTE: Only request an explicitly versioned context when
+ // necessary, as explicitly requesting version 1.0 does not always
+ // return the highest available version
setGLXattrib(attribs, index, GLX_CONTEXT_MAJOR_VERSION_ARB, wndconfig->glMajor);
setGLXattrib(attribs, index, GLX_CONTEXT_MINOR_VERSION_ARB, wndconfig->glMinor);
diff --git a/src/input.c b/src/input.c
index 2a07750..497e752 100644
--- a/src/input.c
+++ b/src/input.c
@@ -323,7 +323,7 @@
if (key < 0 || key > GLFW_KEY_LAST)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwGetKey: The specified key is invalid");
+ "The specified key is invalid");
return GLFW_RELEASE;
}
@@ -355,7 +355,7 @@
if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwGetMouseButton: The specified mouse button is invalid");
+ "The specified mouse button is invalid");
return GLFW_RELEASE;
}
diff --git a/src/nsgl_context.m b/src/nsgl_context.m
index ed024d6..6651814 100644
--- a/src/nsgl_context.m
+++ b/src/nsgl_context.m
@@ -51,7 +51,7 @@
if (pthread_key_create(&_glfwCurrentTLS, NULL) != 0)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSGL: Failed to create context TLS");
+ "NSOpenGL: Failed to create context TLS");
return GL_FALSE;
}
diff --git a/src/window.c b/src/window.c
index f9048cb..7b47e3f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -265,15 +265,13 @@
if (mode != GLFW_WINDOWED && mode != GLFW_FULLSCREEN)
{
- _glfwSetError(GLFW_INVALID_ENUM,
- "glfwCreateWindow: Invalid window mode");
+ _glfwSetError(GLFW_INVALID_ENUM, "Invalid window mode");
return GL_FALSE;
}
if (width <= 0 || height <= 0)
{
- _glfwSetError(GLFW_INVALID_VALUE,
- "glfwCreateWindow: Invalid window size");
+ _glfwSetError(GLFW_INVALID_VALUE, "Invalid window size");
return GL_FALSE;
}