mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 15:44:35 +00:00
Updated error codes to better reflect multi-API support.
This commit is contained in:
parent
1e9383d039
commit
06c191feea
@ -666,7 +666,7 @@ extern "C" {
|
||||
/*! @brief GLFW could not find support for the requested client API on the
|
||||
* system.
|
||||
*/
|
||||
#define GLFW_OPENGL_UNAVAILABLE 0x00070006
|
||||
#define GLFW_API_UNAVAILABLE 0x00070006
|
||||
/*! @brief The requested OpenGL or GLES version is not available.
|
||||
*/
|
||||
#define GLFW_VERSION_UNAVAILABLE 0x00070007
|
||||
|
@ -215,17 +215,17 @@ GLFWAPI const char* glfwErrorString(int error)
|
||||
case GLFW_NOT_INITIALIZED:
|
||||
return "The GLFW library is not initialized";
|
||||
case GLFW_NO_CURRENT_CONTEXT:
|
||||
return "There is no current OpenGL context";
|
||||
return "There is no current context";
|
||||
case GLFW_INVALID_ENUM:
|
||||
return "Invalid argument for enum parameter";
|
||||
case GLFW_INVALID_VALUE:
|
||||
return "Invalid value for parameter";
|
||||
case GLFW_OUT_OF_MEMORY:
|
||||
return "Out of memory";
|
||||
case GLFW_OPENGL_UNAVAILABLE:
|
||||
return "OpenGL is not available on this machine";
|
||||
case GLFW_API_UNAVAILABLE:
|
||||
return "The requested client API is unavailable";
|
||||
case GLFW_VERSION_UNAVAILABLE:
|
||||
return "The requested OpenGL version is unavailable";
|
||||
return "The requested client API version is unavailable";
|
||||
case GLFW_PLATFORM_ERROR:
|
||||
return "A platform-specific error occurred";
|
||||
case GLFW_FORMAT_UNAVAILABLE:
|
||||
|
@ -189,7 +189,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
||||
|
||||
if (!available)
|
||||
{
|
||||
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "WGL: No pixel formats found");
|
||||
_glfwSetError(GLFW_API_UNAVAILABLE, "WGL: No pixel formats found");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ static GLboolean initDisplay(void)
|
||||
_glfwLibrary.X11.display = XOpenDisplay(NULL);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
||||
{
|
||||
if (!_glfwLibrary.GLX.SGIX_fbconfig)
|
||||
{
|
||||
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
||||
_glfwSetError(GLFW_API_UNAVAILABLE,
|
||||
"GLX: GLXFBConfig support not found");
|
||||
return NULL;
|
||||
}
|
||||
@ -116,7 +116,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
||||
&count);
|
||||
if (!count)
|
||||
{
|
||||
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
||||
_glfwSetError(GLFW_API_UNAVAILABLE,
|
||||
"GLX: No GLXFBConfigs returned");
|
||||
return NULL;
|
||||
}
|
||||
@ -128,7 +128,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
||||
&count);
|
||||
if (!count)
|
||||
{
|
||||
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
||||
_glfwSetError(GLFW_API_UNAVAILABLE,
|
||||
"GLX: No GLXFBConfigs returned");
|
||||
return NULL;
|
||||
}
|
||||
@ -465,7 +465,7 @@ int _glfwInitOpenGL(void)
|
||||
// Check if GLX is supported on this display
|
||||
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;
|
||||
}
|
||||
|
||||
@ -473,8 +473,7 @@ int _glfwInitOpenGL(void)
|
||||
&_glfwLibrary.GLX.majorVersion,
|
||||
&_glfwLibrary.GLX.minorVersion))
|
||||
{
|
||||
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
||||
"GLX: Failed to query GLX version");
|
||||
_glfwSetError(GLFW_API_UNAVAILABLE, "GLX: Failed to query GLX version");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user