Made monitor list cleanup shared.

This commit is contained in:
Marcel Metz 2012-01-30 12:04:16 +01:00
parent 01f9d0e32c
commit 6f970f5753
6 changed files with 15 additions and 14 deletions

View File

@ -387,5 +387,10 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig); GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig); GLboolean _glfwIsValidContext(_GLFWwindow* window, _GLFWwndconfig* wndconfig);
// Monitor management (monitor.c)
void _glfwTerminateMonitors(void);
// platform specific (*_monitor.c)
_GLFWmonitor* _glfwDestroyMonitor(_GLFWmonitor* monitor);
#endif // _internal_h_ #endif // _internal_h_

View File

@ -145,3 +145,13 @@ GLFWAPI void glfwSetMonitorDeviceCallback(GLFWmonitordevicefun cbfun)
_glfwLibrary.monitorCallback= cbfun; _glfwLibrary.monitorCallback= cbfun;
} }
//========================================================================
// Delete the monitor list.
//========================================================================
void _glfwTerminateMonitors(void)
{
while (_glfwLibrary.monitorListHead)
_glfwLibrary.monitorListHead = _glfwDestroyMonitor(_glfwLibrary.monitorListHead);
}

View File

@ -223,9 +223,3 @@ void _glfwRefreshMonitors(void)
_glfwLibrary.monitorListHead = newMonitorList; _glfwLibrary.monitorListHead = newMonitorList;
} }
void _glfwTerminateMonitors(void)
{
while (_glfwLibrary.monitorListHead)
_glfwLibrary.monitorListHead = _glfwDestroyMonitor(_glfwLibrary.monitorListHead);
}

View File

@ -339,7 +339,6 @@ void _glfwInitTimer(void);
// Monitor support // Monitor support
void _glfwInitMonitors(void); void _glfwInitMonitors(void);
void _glfwRefreshMonitors(void); void _glfwRefreshMonitors(void);
void _glfwTerminateMonitors(void);
// Fullscreen support // Fullscreen support
void _glfwSetVideoMode(int* width, int* height, void _glfwSetVideoMode(int* width, int* height,

View File

@ -128,9 +128,3 @@ void _glfwInitMonitors(void)
} }
} }
void _glfwTerminateMonitors(void)
{
while (_glfwLibrary.monitorListHead)
_glfwLibrary.monitorListHead = _glfwDestroyMonitor(_glfwLibrary.monitorListHead);
}

View File

@ -281,7 +281,6 @@ void _glfwTerminateJoysticks(void);
// Monitors // Monitors
void _glfwInitMonitors(void); void _glfwInitMonitors(void);
void _glfwTerminateMonitors(void);
// Unicode support // Unicode support
long _glfwKeySym2Unicode(KeySym keysym); long _glfwKeySym2Unicode(KeySym keysym);