mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Formatting and comments.
This commit is contained in:
parent
8308c4b89b
commit
33b2195fb9
10
src/window.c
10
src/window.c
@ -703,8 +703,6 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint)
|
|||||||
|
|
||||||
GLFWAPI void glfwCloseWindow(GLFWwindow window)
|
GLFWAPI void glfwCloseWindow(GLFWwindow window)
|
||||||
{
|
{
|
||||||
_GLFWwindow** prev;
|
|
||||||
|
|
||||||
if (!_glfwInitialized)
|
if (!_glfwInitialized)
|
||||||
{
|
{
|
||||||
_glfwSetError(GLFW_NOT_INITIALIZED);
|
_glfwSetError(GLFW_NOT_INITIALIZED);
|
||||||
@ -715,19 +713,25 @@ GLFWAPI void glfwCloseWindow(GLFWwindow window)
|
|||||||
if (window == _glfwLibrary.cursorLockWindow)
|
if (window == _glfwLibrary.cursorLockWindow)
|
||||||
glfwEnable(window, GLFW_MOUSE_CURSOR);
|
glfwEnable(window, GLFW_MOUSE_CURSOR);
|
||||||
|
|
||||||
|
// Clear the current context if this window's context is current
|
||||||
if (window == _glfwLibrary.currentWindow)
|
if (window == _glfwLibrary.currentWindow)
|
||||||
glfwMakeWindowCurrent(NULL);
|
glfwMakeWindowCurrent(NULL);
|
||||||
|
|
||||||
|
// Clear the active window pointer if this is the active window
|
||||||
if (window == _glfwLibrary.activeWindow)
|
if (window == _glfwLibrary.activeWindow)
|
||||||
_glfwLibrary.activeWindow = NULL;
|
_glfwLibrary.activeWindow = NULL;
|
||||||
|
|
||||||
_glfwPlatformCloseWindow(window);
|
_glfwPlatformCloseWindow(window);
|
||||||
|
|
||||||
prev = &_glfwLibrary.windowListHead;
|
// Unlink window from global linked list
|
||||||
|
{
|
||||||
|
_GLFWwindow** prev = &_glfwLibrary.windowListHead;
|
||||||
|
|
||||||
while (*prev != window)
|
while (*prev != window)
|
||||||
prev = &((*prev)->next);
|
prev = &((*prev)->next);
|
||||||
|
|
||||||
*prev = window->next;
|
*prev = window->next;
|
||||||
|
}
|
||||||
|
|
||||||
free(window);
|
free(window);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user