From 26480901fdd07781094dc56b6ff4d1177e6276aa Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 2 Oct 2012 17:24:18 +0200 Subject: [PATCH] Added glfwGetWindowMonitor. --- include/GL/glfw3.h | 1 + src/window.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 2e9ba74f..2c30d9e0 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -560,6 +560,7 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow window); GLFWAPI void glfwShowWindow(GLFWwindow window); GLFWAPI void glfwHideWindow(GLFWwindow window); GLFWAPI int glfwGetWindowParam(GLFWwindow window, int param); +GLFWAPI GLFWmonitor glfwGetWindowMonitor(GLFWwindow window); GLFWAPI void glfwSetWindowUserPointer(GLFWwindow window, void* pointer); GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow window); GLFWAPI void glfwSetWindowSizeCallback(GLFWwindowsizefun cbfun); diff --git a/src/window.c b/src/window.c index 90f9dfc2..7e6ec9b6 100644 --- a/src/window.c +++ b/src/window.c @@ -763,6 +763,24 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param) } +//======================================================================== +// Get window monitor +//======================================================================== + +GLFWAPI GLFWmonitor glfwGetWindowMonitor(GLFWwindow handle) +{ + _GLFWwindow* window = (_GLFWwindow*) handle; + + if (!_glfwInitialized) + { + _glfwSetError(GLFW_NOT_INITIALIZED, NULL); + return NULL; + } + + return (GLFWmonitor) window->monitor; +} + + //======================================================================== // Set the user pointer for the specified window //========================================================================