فهرست منبع

Updated error codes to better reflect multi-API support.

Camilla Berglund 13 سال پیش
والد
کامیت
06c191feea
5فایلهای تغییر یافته به همراه12 افزوده شده و 13 حذف شده
  1. 1 1
      include/GL/glfw3.h
  2. 4 4
      src/init.c
  3. 1 1
      src/win32_opengl.c
  4. 1 1
      src/x11_init.c
  5. 5 6
      src/x11_opengl.c

+ 1 - 1
include/GL/glfw3.h

@@ -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

+ 4 - 4
src/init.c

@@ -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:

+ 1 - 1
src/win32_opengl.c

@@ -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;
     }
 

+ 1 - 1
src/x11_init.c

@@ -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;
     }
 

+ 5 - 6
src/x11_opengl.c

@@ -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;
     }