//======================================================================== // GLFW 3.5 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2019 Camilla Löwy <[email protected]> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would // be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not // be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // //======================================================================== #include "internal.h" #include <assert.h> #include <math.h> #include <float.h> #include <string.h> #include <stdlib.h> #include <limits.h> // Lexically compare video modes, used by qsort // static int compareVideoModes(const void* fp, const void* sp) { … } // Retrieves the available modes for the specified monitor // static GLFWbool refreshVideoModes(_GLFWmonitor* monitor) { … } ////////////////////////////////////////////////////////////////////////// ////// GLFW event API ////// ////////////////////////////////////////////////////////////////////////// // Notifies shared code of a monitor connection or disconnection // void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement) { … } // Notifies shared code that a full screen window has acquired or released // a monitor // void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window) { … } ////////////////////////////////////////////////////////////////////////// ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// // Allocates and returns a monitor object with the specified name and dimensions // _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) { … } // Frees a monitor object and any data associated with it // void _glfwFreeMonitor(_GLFWmonitor* monitor) { … } // Allocates red, green and blue value arrays of the specified size // void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size) { … } // Frees the red, green and blue value arrays and clears the struct // void _glfwFreeGammaArrays(GLFWgammaramp* ramp) { … } // Chooses the video mode most closely matching the desired one // const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) { … } // Performs lexical comparison between two @ref GLFWvidmode structures // int _glfwCompareVideoModes(const GLFWvidmode* fm, const GLFWvidmode* sm) { … } // Splits a color depth into red, green and blue bit depths // void _glfwSplitBPP(int bpp, int* red, int* green, int* blue) { … } ////////////////////////////////////////////////////////////////////////// ////// GLFW public API ////// ////////////////////////////////////////////////////////////////////////// GLFWAPI GLFWmonitor** glfwGetMonitors(int* count) { … } GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void) { … } GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos) { … } GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* handle, int* xpos, int* ypos, int* width, int* height) { … } GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* widthMM, int* heightMM) { … } GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* handle, float* xscale, float* yscale) { … } GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle) { … } GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* handle, void* pointer) { … } GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* handle) { … } GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun) { … } GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count) { … } GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* handle) { … } GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma) { … } GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle) { … } GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp) { … }