Updated error codes to better reflect multi-API support.

This commit is contained in:
Camilla Berglund 2012-11-23 12:00:49 +01:00
parent 1e9383d039
commit 06c191feea
5 changed files with 12 additions and 13 deletions

View File

@ -666,7 +666,7 @@ extern "C" {
/*! @brief GLFW could not find support for the requested client API on the /*! @brief GLFW could not find support for the requested client API on the
* system. * system.
*/ */
#define GLFW_OPENGL_UNAVAILABLE 0x00070006 #define GLFW_API_UNAVAILABLE 0x00070006
/*! @brief The requested OpenGL or GLES version is not available. /*! @brief The requested OpenGL or GLES version is not available.
*/ */
#define GLFW_VERSION_UNAVAILABLE 0x00070007 #define GLFW_VERSION_UNAVAILABLE 0x00070007

View File

@ -215,17 +215,17 @@ GLFWAPI const char* glfwErrorString(int error)
case GLFW_NOT_INITIALIZED: case GLFW_NOT_INITIALIZED:
return "The GLFW library is not initialized"; return "The GLFW library is not initialized";
case GLFW_NO_CURRENT_CONTEXT: case GLFW_NO_CURRENT_CONTEXT:
return "There is no current OpenGL context"; return "There is no current context";
case GLFW_INVALID_ENUM: case GLFW_INVALID_ENUM:
return "Invalid argument for enum parameter"; return "Invalid argument for enum parameter";
case GLFW_INVALID_VALUE: case GLFW_INVALID_VALUE:
return "Invalid value for parameter"; return "Invalid value for parameter";
case GLFW_OUT_OF_MEMORY: case GLFW_OUT_OF_MEMORY:
return "Out of memory"; return "Out of memory";
case GLFW_OPENGL_UNAVAILABLE: case GLFW_API_UNAVAILABLE:
return "OpenGL is not available on this machine"; return "The requested client API is unavailable";
case GLFW_VERSION_UNAVAILABLE: case GLFW_VERSION_UNAVAILABLE:
return "The requested OpenGL version is unavailable"; return "The requested client API version is unavailable";
case GLFW_PLATFORM_ERROR: case GLFW_PLATFORM_ERROR:
return "A platform-specific error occurred"; return "A platform-specific error occurred";
case GLFW_FORMAT_UNAVAILABLE: case GLFW_FORMAT_UNAVAILABLE:

View File

@ -189,7 +189,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!available) if (!available)
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "WGL: No pixel formats found"); _glfwSetError(GLFW_API_UNAVAILABLE, "WGL: No pixel formats found");
return NULL; return NULL;
} }

View File

@ -491,7 +491,7 @@ static GLboolean initDisplay(void)
_glfwLibrary.X11.display = XOpenDisplay(NULL); _glfwLibrary.X11.display = XOpenDisplay(NULL);
if (!_glfwLibrary.X11.display) if (!_glfwLibrary.X11.display)
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11: Failed to open X display"); _glfwSetError(GLFW_API_UNAVAILABLE, "X11: Failed to open X display");
return GL_FALSE; return GL_FALSE;
} }

View File

@ -93,7 +93,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
{ {
if (!_glfwLibrary.GLX.SGIX_fbconfig) if (!_glfwLibrary.GLX.SGIX_fbconfig)
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, _glfwSetError(GLFW_API_UNAVAILABLE,
"GLX: GLXFBConfig support not found"); "GLX: GLXFBConfig support not found");
return NULL; return NULL;
} }
@ -116,7 +116,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
&count); &count);
if (!count) if (!count)
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, _glfwSetError(GLFW_API_UNAVAILABLE,
"GLX: No GLXFBConfigs returned"); "GLX: No GLXFBConfigs returned");
return NULL; return NULL;
} }
@ -128,7 +128,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
&count); &count);
if (!count) if (!count)
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, _glfwSetError(GLFW_API_UNAVAILABLE,
"GLX: No GLXFBConfigs returned"); "GLX: No GLXFBConfigs returned");
return NULL; return NULL;
} }
@ -465,7 +465,7 @@ int _glfwInitOpenGL(void)
// Check if GLX is supported on this display // Check if GLX is supported on this display
if (!glXQueryExtension(_glfwLibrary.X11.display, NULL, NULL)) if (!glXQueryExtension(_glfwLibrary.X11.display, NULL, NULL))
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "GLX: GLX support not found"); _glfwSetError(GLFW_API_UNAVAILABLE, "GLX: GLX support not found");
return GL_FALSE; return GL_FALSE;
} }
@ -473,8 +473,7 @@ int _glfwInitOpenGL(void)
&_glfwLibrary.GLX.majorVersion, &_glfwLibrary.GLX.majorVersion,
&_glfwLibrary.GLX.minorVersion)) &_glfwLibrary.GLX.minorVersion))
{ {
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, _glfwSetError(GLFW_API_UNAVAILABLE, "GLX: Failed to query GLX version");
"GLX: Failed to query GLX version");
return GL_FALSE; return GL_FALSE;
} }