From e10d935efe8f3da472c1db98f977378020a74a8b Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 28 Aug 2012 15:03:57 +0200 Subject: [PATCH] API tag and error message cleanup. --- src/cocoa_clipboard.m | 4 ++-- src/cocoa_fullscreen.m | 2 +- src/cocoa_gamma.c | 2 +- src/cocoa_input.m | 2 +- src/cocoa_joystick.m | 2 +- src/cocoa_time.c | 2 +- src/cocoa_window.m | 32 +++++++++++++++----------------- src/win32_clipboard.c | 14 +++++++------- src/win32_dllmain.c | 2 +- src/win32_fullscreen.c | 2 +- src/win32_gamma.c | 2 +- src/win32_input.c | 2 +- src/win32_joystick.c | 2 +- src/win32_opengl.c | 40 +++++++++++++++++++--------------------- src/win32_time.c | 2 +- src/win32_window.c | 14 +++++++------- src/window.c | 5 ++--- src/x11_clipboard.c | 4 ++-- src/x11_fullscreen.c | 4 ++-- src/x11_gamma.c | 6 +++--- src/x11_init.c | 4 ++-- src/x11_input.c | 2 +- src/x11_joystick.c | 2 +- src/x11_keysym2unicode.c | 2 +- src/x11_opengl.c | 33 ++++++++++++++------------------- src/x11_time.c | 2 +- src/x11_window.c | 7 +++---- 27 files changed, 93 insertions(+), 104 deletions(-) diff --git a/src/cocoa_clipboard.m b/src/cocoa_clipboard.m index 56b98437..99918f77 100644 --- a/src/cocoa_clipboard.m +++ b/src/cocoa_clipboard.m @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ @@ -70,7 +70,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) if (!object) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSGL: Failed to retrieve object from pasteboard"); + "Cocoa: Failed to retrieve object from pasteboard"); return NULL; } diff --git a/src/cocoa_fullscreen.m b/src/cocoa_fullscreen.m index 9382993b..47f86739 100644 --- a/src/cocoa_fullscreen.m +++ b/src/cocoa_fullscreen.m @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API Version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/cocoa_gamma.c b/src/cocoa_gamma.c index 06904516..85d1e489 100644 --- a/src/cocoa_gamma.c +++ b/src/cocoa_gamma.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/cocoa_input.m b/src/cocoa_input.m index c2bb503c..11e1083b 100644 --- a/src/cocoa_input.m +++ b/src/cocoa_input.m @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API Version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index f3e113b4..ff4ba958 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API Version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/cocoa_time.c b/src/cocoa_time.c index 745b4239..d80dd147 100644 --- a/src/cocoa_time.c +++ b/src/cocoa_time.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Cocoa/NSOpenGL +// Platform: Cocoa // API Version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/cocoa_window.m b/src/cocoa_window.m index aaaff289..5129a21f 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -674,8 +674,7 @@ static GLboolean createWindow(_GLFWwindow* window, if (window->NS.object == nil) { - _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSOpenGL: Failed to create window"); + _glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window"); return GL_FALSE; } @@ -717,8 +716,8 @@ static GLboolean createContext(_GLFWwindow* window, (wndconfig->glMajor == 3 && wndconfig->glMinor != 2)) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Cocoa/NSOpenGL: The targeted version of Mac OS X does " - "not support any OpenGL version above 2.1 except 3.2"); + "NSOpenGL: The targeted version of Mac OS X does not " + "support any OpenGL version above 2.1 except 3.2"); return GL_FALSE; } @@ -727,8 +726,8 @@ static GLboolean createContext(_GLFWwindow* window, if (!wndconfig->glForward) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Cocoa/NSOpenGL: The targeted version of Mac OS X " - "only supports OpenGL 3.2 contexts if they are " + "NSOpenGL: The targeted version of Mac OS X only " + "supports OpenGL 3.2 contexts if they are " "forward-compatible"); return GL_FALSE; } @@ -736,8 +735,8 @@ static GLboolean createContext(_GLFWwindow* window, if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Cocoa/NSOpenGL: The targeted version of Mac OS X " - "only supports OpenGL 3.2 contexts if they use the " + "NSOpenGL: The targeted version of Mac OS X only " + "supports OpenGL 3.2 contexts if they use the " "core profile"); return GL_FALSE; } @@ -747,8 +746,8 @@ static GLboolean createContext(_GLFWwindow* window, if (wndconfig->glMajor > 2) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Cocoa/NSOpenGL: The targeted version of Mac OS X does " - "not support OpenGL version 3.0 or above"); + "NSOpenGL: The targeted version of Mac OS X does not " + "support OpenGL version 3.0 or above"); return GL_FALSE; } #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ @@ -757,8 +756,8 @@ static GLboolean createContext(_GLFWwindow* window, if (wndconfig->glRobustness) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Cocoa/NSOpenGL: Mac OS X does not support OpenGL " - "robustness strategies"); + "NSOpenGL: Mac OS X does not support OpenGL robustness " + "strategies"); return GL_FALSE; } @@ -821,7 +820,7 @@ static GLboolean createContext(_GLFWwindow* window, if (window->NSGL.pixelFormat == nil) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSOpenGL: Failed to create OpenGL pixel format"); + "NSOpenGL: Failed to create OpenGL pixel format"); return GL_FALSE; } @@ -836,7 +835,7 @@ static GLboolean createContext(_GLFWwindow* window, if (window->NSGL.context == nil) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSOpenGL: Failed to create OpenGL context"); + "NSOpenGL: Failed to create OpenGL context"); return GL_FALSE; } @@ -868,8 +867,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (_glfwLibrary.NS.delegate == nil) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSOpenGL: Failed to create application " - "delegate"); + "Cocoa: Failed to create application delegate"); return GL_FALSE; } @@ -880,7 +878,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (window->NS.delegate == nil) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Cocoa/NSOpenGL: Failed to create window delegate"); + "Cocoa: Failed to create window delegate"); return GL_FALSE; } diff --git a/src/win32_clipboard.c b/src/win32_clipboard.c index ca31964d..22cdb8f6 100644 --- a/src/win32_clipboard.c +++ b/src/win32_clipboard.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ @@ -53,7 +53,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) if (!wideString) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to convert clipboard string to " + "Win32: Failed to convert clipboard string to " "wide string"); return; } @@ -66,7 +66,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) free(wideString); _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to allocate global handle for clipboard"); + "Win32: Failed to allocate global handle for clipboard"); return; } @@ -79,7 +79,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) free(wideString); _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to open clipboard"); + "Win32: Failed to open clipboard"); return; } @@ -108,7 +108,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) if (!OpenClipboard(window->Win32.handle)) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to open clipboard"); + "Win32: Failed to open clipboard"); return NULL; } @@ -118,7 +118,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) CloseClipboard(); _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to retrieve clipboard data"); + "Win32: Failed to retrieve clipboard data"); return NULL; } @@ -132,7 +132,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) if (!_glfwLibrary.Win32.clipboardString) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to convert wide string to UTF-8"); + "Win32: Failed to convert wide string to UTF-8"); return NULL; } diff --git a/src/win32_dllmain.c b/src/win32_dllmain.c index 95258ccc..98f9ab2a 100644 --- a/src/win32_dllmain.c +++ b/src/win32_dllmain.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_fullscreen.c b/src/win32_fullscreen.c index 3e28e30e..35d75054 100644 --- a/src/win32_fullscreen.c +++ b/src/win32_fullscreen.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_gamma.c b/src/win32_gamma.c index 36fbd3a4..74958191 100644 --- a/src/win32_gamma.c +++ b/src/win32_gamma.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_input.c b/src/win32_input.c index d3785aa3..a9195838 100644 --- a/src/win32_input.c +++ b/src/win32_input.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_joystick.c b/src/win32_joystick.c index c27218db..fcc6b599 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_opengl.c b/src/win32_opengl.c index 2c676c91..bf684094 100644 --- a/src/win32_opengl.c +++ b/src/win32_opengl.c @@ -171,15 +171,14 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) if (!available) { - _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: No pixel formats found"); + _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "WGL: No pixel formats found"); return NULL; } fbconfigs = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * available); if (!fbconfigs) { - _glfwSetError(GLFW_OUT_OF_MEMORY, - "Win32/WGL: Failed to allocate _GLFWfbconfig array"); + _glfwSetError(GLFW_OUT_OF_MEMORY, NULL); return NULL; } @@ -285,6 +284,9 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) if (*found == 0) { + _glfwSetError(GLFW_PLATFORM_ERROR, + "Win32/WGL: No usable pixel formats found"); + free(fbconfigs); return NULL; } @@ -310,15 +312,15 @@ static GLboolean createContext(_GLFWwindow* window, if (!DescribePixelFormat(window->WGL.DC, pixelFormat, sizeof(pfd), &pfd)) { - _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "Win32/WGL: Failed to retrieve PFD for selected pixel format"); + _glfwSetError(GLFW_PLATFORM_ERROR, + "Win32: Failed to retrieve PFD for selected pixel format"); return GL_FALSE; } if (!SetPixelFormat(window->WGL.DC, pixelFormat, &pfd)) { - _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "Win32/WGL: Failed to set selected pixel format"); + _glfwSetError(GLFW_PLATFORM_ERROR, + "Win32: Failed to set selected pixel format"); return GL_FALSE; } @@ -360,7 +362,7 @@ static GLboolean createContext(_GLFWwindow* window, if (!window->WGL.ARB_create_context_profile) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: OpenGL profile requested but " + "WGL: OpenGL profile requested but " "WGL_ARB_create_context_profile is unavailable"); return GL_FALSE; } @@ -369,7 +371,7 @@ static GLboolean createContext(_GLFWwindow* window, !window->WGL.EXT_create_context_es2_profile) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: OpenGL ES 2.x profile requested but " + "WGL: OpenGL ES 2.x profile requested but " "WGL_EXT_create_context_es2_profile is unavailable"); return GL_FALSE; } @@ -392,7 +394,7 @@ static GLboolean createContext(_GLFWwindow* window, if (!window->WGL.ARB_create_context_robustness) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: An OpenGL robustness strategy was " + "WGL: An OpenGL robustness strategy was " "requested but WGL_ARB_create_context_robustness " "is unavailable"); return GL_FALSE; @@ -415,7 +417,7 @@ static GLboolean createContext(_GLFWwindow* window, if (!window->WGL.context) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: Failed to create OpenGL context"); + "WGL: Failed to create OpenGL context"); return GL_FALSE; } } @@ -425,7 +427,7 @@ static GLboolean createContext(_GLFWwindow* window, if (!window->WGL.context) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to create OpenGL context"); + "WGL: Failed to create OpenGL context"); return GL_FALSE; } @@ -434,8 +436,8 @@ static GLboolean createContext(_GLFWwindow* window, if (!wglShareLists(share, window->WGL.context)) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to enable sharing with " - "specified OpenGL context"); + "WGL: Failed to enable sharing with specified " + "OpenGL context"); return GL_FALSE; } } @@ -466,7 +468,7 @@ int _glfwCreateContext(_GLFWwindow* window, if (!window->WGL.DC) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to retrieve DC for window"); + "Win32: Failed to retrieve DC for window"); return GL_FALSE; } @@ -478,16 +480,12 @@ int _glfwCreateContext(_GLFWwindow* window, fbconfigs = getFBConfigs(window, &fbcount); if (!fbconfigs) - { - _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: No usable pixel formats found"); return GL_FALSE; - } result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount); if (!result) { - _glfwSetError(GLFW_PLATFORM_ERROR, + _glfwSetError(GLFW_FORMAT_UNAVAILABLE, "Win32/WGL: No pixel format matched the criteria"); free(fbconfigs); @@ -620,7 +618,7 @@ void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long if (!wglCopyContext(src->WGL.context, dst->WGL.context, mask)) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to copy OpenGL context attributes"); + "WGL: Failed to copy OpenGL context attributes"); } } diff --git a/src/win32_time.c b/src/win32_time.c index f3bd173a..1e1d57f4 100644 --- a/src/win32_time.c +++ b/src/win32_time.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: Win32/WGL +// Platform: Win32 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/win32_window.c b/src/win32_window.c index 77b99026..feccb833 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -813,7 +813,7 @@ static ATOM registerWindowClass(void) if (!classAtom) { _glfwSetError(GLFW_PLATFORM_ERROR, - "Win32/WGL: Failed to register window class"); + "Win32: Failed to register window class"); return 0; } @@ -886,7 +886,7 @@ static int createWindow(_GLFWwindow* window, if (!wideTitle) { _glfwSetError(GLFW_PLATFORM_ERROR, - "glfwCreateWindow: Failed to convert title to wide string"); + "Win32: Failed to convert title to wide string"); return GL_FALSE; } @@ -904,7 +904,7 @@ static int createWindow(_GLFWwindow* window, if (!window->Win32.handle) { - _glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to create window"); + _glfwSetError(GLFW_PLATFORM_ERROR, "Win32: Failed to create window"); return GL_FALSE; } @@ -1008,8 +1008,8 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (!window->WGL.ARB_create_context) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: A forward compatible OpenGL context " - "requested but WGL_ARB_create_context is unavailable"); + "WGL: A forward compatible OpenGL context requested " + "but WGL_ARB_create_context is unavailable"); return GL_FALSE; } @@ -1021,7 +1021,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (!window->WGL.ARB_create_context_profile) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "Win32/WGL: OpenGL profile requested but " + "WGL: OpenGL profile requested but " "WGL_ARB_create_context_profile is unavailable"); return GL_FALSE; } @@ -1107,7 +1107,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) if (!wideTitle) { _glfwSetError(GLFW_PLATFORM_ERROR, - "glfwSetWindowTitle: Failed to convert title to wide string"); + "Win32: Failed to convert title to wide string"); return; } diff --git a/src/window.c b/src/window.c index 4e95129a..acd48195 100644 --- a/src/window.c +++ b/src/window.c @@ -267,7 +267,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height, if (mode != GLFW_WINDOWED && mode != GLFW_FULLSCREEN) { _glfwSetError(GLFW_INVALID_ENUM, - "glfwCreateWindow: Invalid enum for 'mode' parameter"); + "glfwCreateWindow: Invalid window mode"); return GL_FALSE; } @@ -292,8 +292,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height, window = (_GLFWwindow*) malloc(sizeof(_GLFWwindow)); if (!window) { - _glfwSetError(GLFW_OUT_OF_MEMORY, - "glfwCreateWindow: Failed to allocate window structure"); + _glfwSetError(GLFW_OUT_OF_MEMORY, NULL); return NULL; } diff --git a/src/x11_clipboard.c b/src/x11_clipboard.c index a833ed1f..5bc92d44 100644 --- a/src/x11_clipboard.c +++ b/src/x11_clipboard.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ @@ -182,7 +182,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) if (_glfwLibrary.X11.selection.status == _GLFW_CONVERSION_FAILED) { _glfwSetError(GLFW_FORMAT_UNAVAILABLE, - "X11/GLX: Failed to convert selection to string"); + "X11: Failed to convert selection to string"); return NULL; } diff --git a/src/x11_fullscreen.c b/src/x11_fullscreen.c index 8c4138d3..346aefb7 100644 --- a/src/x11_fullscreen.c +++ b/src/x11_fullscreen.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ @@ -442,7 +442,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(int* found) if (visuals == NULL) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to retrieve the available visuals"); + "X11: Failed to retrieve the available visuals"); return 0; } diff --git a/src/x11_gamma.c b/src/x11_gamma.c index 44cd1139..148ae740 100644 --- a/src/x11_gamma.c +++ b/src/x11_gamma.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ @@ -115,7 +115,7 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp) if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to get gamma ramp due to size " + "X11: Failed to get gamma ramp due to size " "incompatibility"); return; } @@ -166,7 +166,7 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp) if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to set gamma ramp due to size " + "X11: Failed to set gamma ramp due to size " "incompatibility"); return; } diff --git a/src/x11_init.c b/src/x11_init.c index 372fc2dd..35f66c0f 100644 --- a/src/x11_init.c +++ b/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/GLX: Failed to open X display"); + _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11: Failed to open X display"); return GL_FALSE; } @@ -525,7 +525,7 @@ static GLboolean initDisplay(void) &_glfwLibrary.X11.RandR.minorVersion)) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to query RandR version"); + "X11: Failed to query RandR version"); return GL_FALSE; } } diff --git a/src/x11_input.c b/src/x11_input.c index 49961395..2ea8b8c4 100644 --- a/src/x11_input.c +++ b/src/x11_input.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11 (Unix) +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/x11_joystick.c b/src/x11_joystick.c index 523a4b3d..8492850b 100644 --- a/src/x11_joystick.c +++ b/src/x11_joystick.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/x11_keysym2unicode.c b/src/x11_keysym2unicode.c index 1f610fdd..c0d10c6e 100644 --- a/src/x11_keysym2unicode.c +++ b/src/x11_keysym2unicode.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/x11_opengl.c b/src/x11_opengl.c index 2a5cc451..a7c3f61b 100644 --- a/src/x11_opengl.c +++ b/src/x11_opengl.c @@ -78,7 +78,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) if (!_glfwLibrary.GLX.SGIX_fbconfig) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "X11/GLX: GLXFBConfig support not found"); + "GLX: GLXFBConfig support not found"); return NULL; } } @@ -101,7 +101,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) if (!count) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "X11/GLX: No GLXFBConfigs returned"); + "GLX: No GLXFBConfigs returned"); return NULL; } } @@ -113,7 +113,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) if (!count) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "X11/GLX: No GLXFBConfigs returned"); + "GLX: No GLXFBConfigs returned"); return NULL; } } @@ -121,8 +121,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found) result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count); if (!result) { - _glfwSetError(GLFW_OUT_OF_MEMORY, - "X11/GLX: Failed to allocate _GLFWfbconfig array"); + _glfwSetError(GLFW_OUT_OF_MEMORY, NULL); return NULL; } @@ -242,7 +241,7 @@ static int createContext(_GLFWwindow* window, if (fbconfig == NULL) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to retrieve the selected GLXFBConfig"); + "GLX: Failed to retrieve the selected GLXFBConfig"); return GL_FALSE; } } @@ -264,7 +263,7 @@ static int createContext(_GLFWwindow* window, XFree(fbconfig); _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to retrieve visual for GLXFBConfig"); + "GLX: Failed to retrieve visual for GLXFBConfig"); return GL_FALSE; } @@ -303,7 +302,7 @@ static int createContext(_GLFWwindow* window, if (!_glfwLibrary.GLX.ARB_create_context_profile) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "X11/GLX: An OpenGL profile requested but " + "GLX: An OpenGL profile requested but " "GLX_ARB_create_context_profile is unavailable"); return GL_FALSE; } @@ -312,7 +311,7 @@ static int createContext(_GLFWwindow* window, !_glfwLibrary.GLX.EXT_create_context_es2_profile) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "X11/GLX: OpenGL ES 2.x profile requested but " + "GLX: OpenGL ES 2.x profile requested but " "GLX_EXT_create_context_es2_profile is unavailable"); return GL_FALSE; } @@ -334,7 +333,7 @@ static int createContext(_GLFWwindow* window, if (!_glfwLibrary.GLX.ARB_create_context_robustness) { _glfwSetError(GLFW_VERSION_UNAVAILABLE, - "X11/GLX: An OpenGL robustness strategy was " + "GLX: An OpenGL robustness strategy was " "requested but GLX_ARB_create_context_robustness " "is unavailable"); return GL_FALSE; @@ -397,7 +396,7 @@ static int createContext(_GLFWwindow* window, // TODO: Handle all the various error codes here _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to create OpenGL context"); + "GLX: Failed to create OpenGL context"); return GL_FALSE; } @@ -437,7 +436,7 @@ int _glfwInitOpenGL(void) if (!_glfwLibrary.GLX.libGL) { - _glfwSetError(GLFW_PLATFORM_ERROR, "X11/GLX: Failed to find libGL"); + _glfwSetError(GLFW_PLATFORM_ERROR, "GLX: Failed to find libGL"); return GL_FALSE; } #endif @@ -445,7 +444,7 @@ int _glfwInitOpenGL(void) // Check if GLX is supported on this display if (!glXQueryExtension(_glfwLibrary.X11.display, NULL, NULL)) { - _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11/GLX: GLX support not found"); + _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "GLX: GLX support not found"); return GL_FALSE; } @@ -454,7 +453,7 @@ int _glfwInitOpenGL(void) &_glfwLibrary.GLX.minorVersion)) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, - "X11/GLX: Failed to query GLX version"); + "GLX: Failed to query GLX version"); return GL_FALSE; } @@ -565,17 +564,13 @@ int _glfwCreateContext(_GLFWwindow* window, fbconfigs = getFBConfigs(window, &fbcount); if (!fbconfigs) - { - _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: No usable GLXFBConfigs found"); return GL_FALSE; - } result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount); if (!result) { _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: No GLXFBConfig matched the criteria"); + "GLX: No GLXFBConfig matched the criteria"); free(fbconfigs); return GL_FALSE; diff --git a/src/x11_time.c b/src/x11_time.c index f1445233..bf3335d3 100644 --- a/src/x11_time.c +++ b/src/x11_time.c @@ -1,6 +1,6 @@ //======================================================================== // GLFW - An OpenGL library -// Platform: X11/GLX +// Platform: X11 // API version: 3.0 // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ diff --git a/src/x11_window.c b/src/x11_window.c index 6d7021a0..a34449d8 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -131,8 +131,7 @@ static GLboolean createWindow(_GLFWwindow* window, // TODO: Handle all the various error codes here and translate them // to GLFW errors - _glfwSetError(GLFW_PLATFORM_ERROR, - "X11/GLX: Failed to create window"); + _glfwSetError(GLFW_PLATFORM_ERROR, "X11: Failed to create window"); return GL_FALSE; } } @@ -191,7 +190,7 @@ static GLboolean createWindow(_GLFWwindow* window, if (!hints) { _glfwSetError(GLFW_OUT_OF_MEMORY, - "X11/GLX: Failed to allocate WM hints"); + "X11: Failed to allocate WM hints"); return GL_FALSE; } @@ -208,7 +207,7 @@ static GLboolean createWindow(_GLFWwindow* window, if (!hints) { _glfwSetError(GLFW_OUT_OF_MEMORY, - "X11/GLX: Failed to allocate size hints"); + "X11: Failed to allocate size hints"); return GL_FALSE; }