Commit f1e7d7c0 authored by Camilla Berglund's avatar Camilla Berglund
Browse files

Added error callback.

parent 065c7719
......@@ -392,6 +392,7 @@ typedef struct
} GLFWgammaramp;
/* Function pointer types */
typedef void (* GLFWerrorfun)(int,const char*);
typedef void (* GLFWwindowsizefun)(GLFWwindow,int,int);
typedef int (* GLFWwindowclosefun)(GLFWwindow);
typedef void (* GLFWwindowrefreshfun)(GLFWwindow);
......@@ -417,6 +418,7 @@ GLFWAPI const char* glfwGetVersionString(void);
/* Error handling */
GLFWAPI int glfwGetError(void);
GLFWAPI const char* glfwErrorString(int error);
GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun);
/* Video mode functions */
GLFWAPI int glfwGetVideoModes(GLFWvidmode* list, int maxcount);
......
......@@ -265,6 +265,7 @@ version of GLFW.</p>
<li>Added <code>glfwIsWindow</code> function for verifying that a given window handle is (still) valid</li>
<li>Added <code>glfwMakeWindowCurrent</code> function for making the context of the specified window current</li>
<li>Added <code>glfwGetError</code> and <code>glfwErrorString</code> error reporting functions and a number of error tokens</li>
<li>Added <code>glfwSetErrorCallback</code> function and <code>GLFWerrorfun</code> type for receiving more specific and/or nested errors</li>
<li>Added <code>glfwSetWindowUserPointer</code> and <code>glfwGetWindowUserPointer</code> functions for per-window user pointers</li>
<li>Added <code>glfwGetVersionString</code> function for determining which code paths were enabled at compile time</li>
<li>Added <code>glfwGetWindowPos</code> function for querying the position of the specified window</li>
......
......@@ -475,7 +475,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
// Fail if OpenGL 3.0 or above was requested
if (wndconfig->glMajor > 2)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Cocoa/NSOpenGL: Mac OS X does not support OpenGL version 3.0 or above");
return GL_FALSE;
}
......@@ -486,7 +486,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
_glfwLibrary.NS.delegate = [[GLFWApplicationDelegate alloc] init];
if (_glfwLibrary.NS.delegate == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa/NSOpenGL: Failed to create application delegate");
return GL_FALSE;
}
......@@ -496,7 +496,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
window->NS.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window];
if (window->NS.delegate == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa/NSOpenGL: Failed to create window delegate");
return GL_FALSE;
}
......@@ -627,7 +627,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
if (window->NSGL.pixelFormat == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa/NSOpenGL: Failed to create pixel format");
return GL_FALSE;
}
......@@ -641,7 +641,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
shareContext:share];
if (window->NSGL.context == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa/NSOpenGL: Failed to create OpenGL context");
return GL_FALSE;
}
......
......@@ -185,7 +185,7 @@ GLFWAPI void glfwEnable(GLFWwindow window, int token)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -220,7 +220,7 @@ GLFWAPI void glfwDisable(GLFWwindow window, int token)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......
......@@ -45,9 +45,17 @@ static int _glfwError = GLFW_NO_ERROR;
// Sets the current error value
//========================================================================
void _glfwSetError(int error)
void _glfwSetError(int error, const char* description)
{
_glfwError = error;
if (_glfwLibrary.errorCallback)
{
if (!description)
description = glfwErrorString(error);
_glfwLibrary.errorCallback(error, description);
}
else
_glfwError = error;
}
......@@ -99,3 +107,21 @@ GLFWAPI const char* glfwErrorString(int error)
}
}
//========================================================================
// Sets the callback function for GLFW errors
//========================================================================
GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun)
{
if (!_glfwInitialized)
{
// TODO: Uhm... Hmm...
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_glfwLibrary.errorCallback = cbfun;
}
......@@ -106,7 +106,7 @@ GLFWAPI int glfwGetVideoModes(GLFWvidmode* list, int maxcount)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
......@@ -132,13 +132,13 @@ GLFWAPI void glfwGetDesktopMode(GLFWvidmode* mode)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
if (mode == NULL)
{
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwGetDesktopMode: Parameter 'mode' cannot be NULL");
return;
}
......
......@@ -48,7 +48,7 @@ GLFWAPI void glfwSetGammaFormula(float gamma, float blacklevel, float gain)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -89,7 +89,7 @@ GLFWAPI void glfwGetGammaRamp(GLFWgammaramp* ramp)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -105,7 +105,7 @@ GLFWAPI void glfwSetGammaRamp(const GLFWgammaramp* ramp)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......
......@@ -139,14 +139,14 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GL_FALSE;
}
window = _glfwLibrary.currentWindow;
if (!window)
{
_glfwSetError(GLFW_NO_CURRENT_WINDOW);
_glfwSetError(GLFW_NO_CURRENT_WINDOW, NULL);
return GL_FALSE;
}
......@@ -199,13 +199,13 @@ GLFWAPI void* glfwGetProcAddress(const char* procname)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return NULL;
}
if (!_glfwLibrary.currentWindow)
{
_glfwSetError(GLFW_NO_CURRENT_WINDOW);
_glfwSetError(GLFW_NO_CURRENT_WINDOW, NULL);
return NULL;
}
......@@ -223,14 +223,14 @@ GLFWAPI void glfwGetGLVersion(int* major, int* minor, int* rev)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
window = _glfwLibrary.currentWindow;
if (!window)
{
_glfwSetError(GLFW_NO_CURRENT_WINDOW);
_glfwSetError(GLFW_NO_CURRENT_WINDOW, NULL);
return;
}
......
......@@ -43,7 +43,7 @@ GLFWAPI int glfwGetKey(GLFWwindow window, int key)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GLFW_RELEASE;
}
......@@ -51,7 +51,7 @@ GLFWAPI int glfwGetKey(GLFWwindow window, int key)
if (key < 0 || key > GLFW_KEY_LAST)
{
// TODO: Decide whether key is a value or enum
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwGetKey: The specified key is invalid");
return GLFW_RELEASE;
}
......@@ -74,14 +74,14 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow window, int button)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GLFW_RELEASE;
}
// Is it a valid mouse button?
if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)
{
_glfwSetError(GLFW_INVALID_ENUM);
_glfwSetError(GLFW_INVALID_ENUM, "glfwGetMouseButton: The specified mouse button is invalid");
return GLFW_RELEASE;
}
......@@ -104,7 +104,7 @@ GLFWAPI void glfwGetMousePos(GLFWwindow window, int* xpos, int* ypos)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -126,7 +126,7 @@ GLFWAPI void glfwSetMousePos(GLFWwindow window, int xpos, int ypos)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -155,7 +155,7 @@ GLFWAPI void glfwGetScrollOffset(GLFWwindow window, int* x, int* y)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -175,7 +175,7 @@ GLFWAPI void glfwSetKeyCallback(GLFWkeyfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -191,7 +191,7 @@ GLFWAPI void glfwSetCharCallback(GLFWcharfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -207,7 +207,7 @@ GLFWAPI void glfwSetMouseButtonCallback(GLFWmousebuttonfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -223,7 +223,7 @@ GLFWAPI void glfwSetMousePosCallback(GLFWmouseposfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -250,7 +250,7 @@ GLFWAPI void glfwSetScrollCallback(GLFWscrollfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......
......@@ -216,6 +216,7 @@ struct _GLFWlibrary
_GLFWwindow* activeWindow;
_GLFWwindow* cursorLockWindow;
GLFWerrorfun errorCallback;
GLFWwindowsizefun windowSizeCallback;
GLFWwindowclosefun windowCloseCallback;
GLFWwindowrefreshfun windowRefreshCallback;
......@@ -313,7 +314,7 @@ void* _glfwPlatformGetProcAddress(const char* procname);
void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
// Error handling
void _glfwSetError(int error);
void _glfwSetError(int error, const char* description);
// Window management (window.c)
void _glfwClearWindowHints(void);
......
......@@ -43,7 +43,7 @@ GLFWAPI int glfwGetJoystickParam(int joy, int param)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
......@@ -61,7 +61,7 @@ GLFWAPI int glfwGetJoystickPos(int joy, float* pos, int numaxes)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
......@@ -85,7 +85,7 @@ GLFWAPI int glfwGetJoystickButtons(int joy,
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return 0;
}
......
......@@ -43,7 +43,7 @@ GLFWAPI double glfwGetTime(void)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return 0.0;
}
......@@ -59,7 +59,7 @@ GLFWAPI void glfwSetTime(double time)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......
......@@ -184,14 +184,14 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!count)
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE);
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: No pixel formats found");
return NULL;
}
result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count);
if (!result)
{
_glfwSetError(GLFW_OUT_OF_MEMORY);
_glfwSetError(GLFW_OUT_OF_MEMORY, "Win32/WGL: Failed to allocate _GLFWfbconfig array");
return NULL;
}
......@@ -324,13 +324,13 @@ static GLboolean createContext(_GLFWwindow* window,
if (!_glfw_DescribePixelFormat(window->WGL.DC, pixelFormat, sizeof(pfd), &pfd))
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE);
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: Failed to retrieve PFD for selected pixel format");
return GL_FALSE;
}
if (!_glfw_SetPixelFormat(window->WGL.DC, pixelFormat, &pfd))
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE);
_glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: Failed to set selected pixel format");
return GL_FALSE;
}
......@@ -368,14 +368,14 @@ static GLboolean createContext(_GLFWwindow* window,
if (!window->WGL.has_WGL_ARB_create_context_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Win32/WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable");
return GL_FALSE;
}
if (wndconfig->glProfile == GLFW_OPENGL_ES2_PROFILE &&
!window->WGL.has_WGL_EXT_create_context_es2_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Win32/WGL: OpenGL ES 2.x profile requested but WGL_EXT_create_context_es2_profile is unavailable");
return GL_FALSE;
}
......@@ -397,7 +397,7 @@ static GLboolean createContext(_GLFWwindow* window,
attribs);
if (!window->WGL.context)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Win32/WGL: Failed to create OpenGL context");
return GL_FALSE;
}
}
......@@ -406,7 +406,7 @@ static GLboolean createContext(_GLFWwindow* window,
window->WGL.context = wglCreateContext(window->WGL.DC);
if (!window->WGL.context)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to create OpenGL context");
return GL_FALSE;
}
......@@ -414,7 +414,7 @@ static GLboolean createContext(_GLFWwindow* window,
{
if (!wglShareLists(share, window->WGL.context))
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to enable sharing with specified OpenGL context");
return GL_FALSE;
}
}
......@@ -1113,7 +1113,7 @@ static ATOM registerWindowClass(void)
classAtom = RegisterClass(&wc);
if (!classAtom)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to register window class");
return 0;
}
......@@ -1227,14 +1227,14 @@ static int createWindow(_GLFWwindow* window,
if (!window->Win32.handle)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to create window");
return GL_FALSE;
}
window->WGL.DC = GetDC(window->Win32.handle);
if (!window->WGL.DC)
{
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to retrieve DC for window");
return GL_FALSE;
}
......@@ -1352,7 +1352,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
{
if (!window->WGL.has_WGL_ARB_create_context)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Win32/WGL: A forward compatible or debug OpenGL context requested but WGL_ARB_create_context is unavailable");
return GL_FALSE;
}
......@@ -1363,7 +1363,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
{
if (!window->WGL.has_WGL_ARB_create_context_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "Win32/WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable");
return GL_FALSE;
}
......
......@@ -437,14 +437,14 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return NULL;
}
window = (_GLFWwindow*) malloc(sizeof(_GLFWwindow));
if (!window)
{
_glfwSetError(GLFW_OUT_OF_MEMORY);
_glfwSetError(GLFW_OUT_OF_MEMORY, "glfwOpenWindow: Failed to allocate window structure");
return NULL;
}
......@@ -487,21 +487,21 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
{
// OpenGL 1.x series ended with version 1.5
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else if (wndconfig.glMajor == 2 && wndconfig.glMinor > 1)
{
// OpenGL 2.x series ended with version 2.1
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else if (wndconfig.glMajor == 3 && wndconfig.glMinor > 3)
{
// OpenGL 3.x series ended with version 3.3
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else
......@@ -519,7 +519,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
// everything 2.x and let the driver report invalid versions
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Invalid OpenGL ES 2.x version requested");
return GL_FALSE;
}
}
......@@ -531,7 +531,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
// and above
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Context profiles only exist for OpenGL version 3.2 and above");
return GL_FALSE;
}
}
......@@ -540,7 +540,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
{
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_VALUE);
_glfwSetError(GLFW_INVALID_VALUE, "glfwOpenWindow: Forward compatibility only exist for OpenGL version 3.0 and above");
return GL_FALSE;
}
......@@ -548,7 +548,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
{
// Invalid window mode
glfwCloseWindow(window);
_glfwSetError(GLFW_INVALID_ENUM);
_glfwSetError(GLFW_INVALID_ENUM, "glfwOpenWindow: Invalid enum for 'mode' parameter");
return GL_FALSE;
}
......@@ -601,7 +601,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
// The desired OpenGL version is greater than the actual version
// This only happens if the machine lacks {GLX|WGL}_ARB_create_context
glfwCloseWindow(window);
_glfwSetError(GLFW_VERSION_UNAVAILABLE);
_glfwSetError(GLFW_VERSION_UNAVAILABLE, "glfwOpenWindow: The requested OpenGL version is not available");
return GL_FALSE;
}
......@@ -611,7 +611,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
if (!window->GetStringi)
{
glfwCloseWindow(window);
_glfwSetError(GLFW_PLATFORM_ERROR);
_glfwSetError(GLFW_PLATFORM_ERROR, "glfwOpenWindow: Entry point retrieval is broken; see the build documentation for your platform");
return GL_FALSE;
}
}
......@@ -637,7 +637,7 @@ GLFWAPI void glfwMakeWindowCurrent(GLFWwindow window)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -659,7 +659,7 @@ GLFWAPI int glfwIsWindow(GLFWwindow window)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GL_FALSE;
}
......@@ -684,7 +684,7 @@ GLFWAPI GLFWwindow glfwGetCurrentWindow(void)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return GL_FALSE;
}
......@@ -700,7 +700,7 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -780,7 +780,7 @@ GLFWAPI void glfwCloseWindow(GLFWwindow window)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED);
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
......@@ -820,7 +820,7 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow window, const char* title)