Fixed glfwCreateWindow return value semantics.

This commit is contained in:
Camilla Berglund 2013-07-30 14:19:24 +02:00
parent 5b8ff4a2fc
commit 9d0e102135

View File

@ -158,7 +158,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
if (width <= 0 || height <= 0) if (width <= 0 || height <= 0)
{ {
_glfwInputError(GLFW_INVALID_VALUE, "Invalid window size"); _glfwInputError(GLFW_INVALID_VALUE, "Invalid window size");
return GL_FALSE; return NULL;
} }
// Set up desired framebuffer config // Set up desired framebuffer config
@ -196,7 +196,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
// Check the OpenGL bits of the window config // Check the OpenGL bits of the window config
if (!_glfwIsValidContextConfig(&wndconfig)) if (!_glfwIsValidContextConfig(&wndconfig))
return GL_FALSE; return NULL;
window = calloc(1, sizeof(_GLFWwindow)); window = calloc(1, sizeof(_GLFWwindow));
window->next = _glfw.windowListHead; window->next = _glfw.windowListHead;
@ -229,7 +229,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
{ {
glfwDestroyWindow((GLFWwindow*) window); glfwDestroyWindow((GLFWwindow*) window);
glfwMakeContextCurrent((GLFWwindow*) previous); glfwMakeContextCurrent((GLFWwindow*) previous);
return GL_FALSE; return NULL;
} }
glfwMakeContextCurrent((GLFWwindow*) window); glfwMakeContextCurrent((GLFWwindow*) window);
@ -239,7 +239,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
{ {
glfwDestroyWindow((GLFWwindow*) window); glfwDestroyWindow((GLFWwindow*) window);
glfwMakeContextCurrent((GLFWwindow*) previous); glfwMakeContextCurrent((GLFWwindow*) previous);
return GL_FALSE; return NULL;
} }
// Verify the context against the requested parameters // Verify the context against the requested parameters
@ -247,7 +247,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
{ {
glfwDestroyWindow((GLFWwindow*) window); glfwDestroyWindow((GLFWwindow*) window);
glfwMakeContextCurrent((GLFWwindow*) previous); glfwMakeContextCurrent((GLFWwindow*) previous);
return GL_FALSE; return NULL;
} }
// Clearing the front buffer to black to avoid garbage pixels left over // Clearing the front buffer to black to avoid garbage pixels left over