From cb02a693b4acce9024448b808b78c1533ba95bc9 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 23 Jan 2013 19:52:52 +0100 Subject: [PATCH] Moved function into correct category. --- src/monitor.c | 75 +++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 107622bf..168c3987 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -94,43 +94,9 @@ static int refreshVideoModes(_GLFWmonitor* monitor) ////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// +////// GLFW event API ////// ////////////////////////////////////////////////////////////////////////// -_GLFWmonitor* _glfwCreateMonitor(const char* name, - GLboolean primary, - int widthMM, int heightMM, - int x, int y) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) calloc(1, sizeof(_GLFWmonitor)); - if (!monitor) - { - _glfwInputError(GLFW_OUT_OF_MEMORY, NULL); - return NULL; - } - - monitor->name = strdup(name); - monitor->primary = primary; - monitor->widthMM = widthMM; - monitor->heightMM = heightMM; - monitor->positionX = x; - monitor->positionY = y; - - return monitor; -} - -void _glfwDestroyMonitor(_GLFWmonitor* monitor) -{ - if (monitor == NULL) - return; - - _glfwPlatformDestroyMonitor(monitor); - - free(monitor->modes); - free(monitor->name); - free(monitor); -} - void _glfwInputMonitorChange(void) { int i, j, monitorCount; @@ -189,6 +155,45 @@ void _glfwInputMonitorChange(void) _glfw.monitorCount = monitorCount; } + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +_GLFWmonitor* _glfwCreateMonitor(const char* name, + GLboolean primary, + int widthMM, int heightMM, + int x, int y) +{ + _GLFWmonitor* monitor = (_GLFWmonitor*) calloc(1, sizeof(_GLFWmonitor)); + if (!monitor) + { + _glfwInputError(GLFW_OUT_OF_MEMORY, NULL); + return NULL; + } + + monitor->name = strdup(name); + monitor->primary = primary; + monitor->widthMM = widthMM; + monitor->heightMM = heightMM; + monitor->positionX = x; + monitor->positionY = y; + + return monitor; +} + +void _glfwDestroyMonitor(_GLFWmonitor* monitor) +{ + if (monitor == NULL) + return; + + _glfwPlatformDestroyMonitor(monitor); + + free(monitor->modes); + free(monitor->name); + free(monitor); +} + void _glfwDestroyMonitors(void) { int i;