Add monitor and joystick user pointers

This commit is contained in:
Camilla Löwy
2017-12-07 16:19:57 +01:00
parent 9da2285b14
commit 7c2c7858c6
9 changed files with 198 additions and 4 deletions
+16 -3
View File
@@ -86,14 +86,16 @@ void monitor_callback(GLFWmonitor* monitor, int event)
@endcode
If a monitor is disconnected, all windows that are full screen on it will be
switched to windowed mode.
switched to windowed mode before the callback is called. Only @ref
glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values
for a disconnected monitor and only before the monitor callback returns.
@section monitor_properties Monitor properties
Each monitor has a current video mode, a list of supported video modes,
a virtual position, a human-readable name, an estimated physical size and
a gamma ramp.
a virtual position, a human-readable name, a user pointer, an estimated physical
size and a gamma ramp.
@subsection monitor_modes Video modes
@@ -187,6 +189,17 @@ and make may have the same name. Only the monitor handle is guaranteed to be
unique, and only until that monitor is disconnected.
@subsection monitor_userptr User pointer
Each monitor has a user pointer that can be set with @ref
glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer. This
can be used for any purpose you need and will not be modified by GLFW. The
value will be kept until the monitor is disconnected or until the library is
terminated.
The initial value of the pointer is `NULL`.
@subsection monitor_gamma Gamma ramp
The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts