This is the reference documentation for monitor related functions and types. For more information, see the Multi-monitor guide.
◆ GLFWgammaramp
◆ GLFWmonitor
◆ GLFWmonitorfun
This is the function signature for monitor configuration callback functions.
- Parameters
-
[in] | monitor | The monitor that was connected or disconnected. |
[in] | event | One of GLFW_CONNECTED or GLFW_DISCONNECTED . |
- See also
- glfwSetMonitorCallback
◆ GLFWvidmode
This describes a single video mode.
◆ glfwGetGammaRamp()
This function retrieves the current gamma ramp of the specified monitor.
- Parameters
-
[in] | monitor | The monitor to query. |
- Returns
- The current gamma ramp, or
NULL
if an error occurred.
- Note
- The value arrays of the returned ramp are allocated and freed by GLFW. You should not free them yourself.
◆ glfwGetMonitorName()
const char* glfwGetMonitorName |
( |
GLFWmonitor * |
monitor | ) |
|
This function returns a human-readable name, encoded as UTF-8, of the specified monitor.
- Parameters
-
[in] | monitor | The monitor to query. |
- Returns
- The UTF-8 encoded name of the monitor, or
NULL
if an error occurred.
- Note
- The returned string is allocated and freed by GLFW. You should not free it yourself.
◆ glfwGetMonitorPhysicalSize()
void glfwGetMonitorPhysicalSize |
( |
GLFWmonitor * |
monitor, |
|
|
int * |
width, |
|
|
int * |
height |
|
) |
| |
This function returns the size, in millimetres, of the display area of the specified monitor.
- Parameters
-
[in] | monitor | The monitor to query. |
[out] | width | Where to store the width, in mm, of the monitor's display area, or NULL . |
[out] | height | Where to store the height, in mm, of the monitor's display area, or NULL . |
- Note
- Some operating systems do not provide accurate information, either because the monitor's EDID data is incorrect, or because the driver does not report it accurately.
◆ glfwGetMonitorPos()
void glfwGetMonitorPos |
( |
GLFWmonitor * |
monitor, |
|
|
int * |
xpos, |
|
|
int * |
ypos |
|
) |
| |
This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor.
- Parameters
-
[in] | monitor | The monitor to query. |
[out] | xpos | Where to store the monitor x-coordinate, or NULL . |
[out] | ypos | Where to store the monitor y-coordinate, or NULL . |
◆ glfwGetMonitors()
This function returns an array of handles for all currently connected monitors.
- Parameters
-
[out] | count | Where to store the size of the returned array. This is set to zero if an error occurred. |
- Returns
- An array of monitor handles, or
NULL
if an error occurred.
- Note
- The returned array is allocated and freed by GLFW. You should not free it yourself.
-
The returned array is valid only until the monitor configuration changes. See glfwSetMonitorCallback to receive notifications of configuration changes.
- See also
- glfwGetPrimaryMonitor
◆ glfwGetPrimaryMonitor()
This function returns the primary monitor. This is usually the monitor where elements like the Windows task bar or the OS X menu bar is located.
- Returns
- The primary monitor, or
NULL
if an error occurred.
- See also
- glfwGetMonitors
◆ glfwGetVideoMode()
This function returns the current video mode of the specified monitor. If you are using a full screen window, the return value will therefore depend on whether it is focused.
- Parameters
-
[in] | monitor | The monitor to query. |
- Returns
- The current mode of the monitor, or
NULL
if an error occurred.
- Note
- The returned struct is allocated and freed by GLFW. You should not free it yourself.
- See also
- glfwGetVideoModes
◆ glfwGetVideoModes()
This function returns an array of all video modes supported by the specified monitor. The returned array is sorted in ascending order, first by color bit depth (the sum of all channel depths) and then by resolution area (the product of width and height).
- Parameters
-
[in] | monitor | The monitor to query. |
[out] | count | Where to store the number of video modes in the returned array. This is set to zero if an error occurred. |
- Returns
- An array of video modes, or
NULL
if an error occurred.
- Note
- The returned array is allocated and freed by GLFW. You should not free it yourself.
-
The returned array is valid only until this function is called again for the specified monitor.
- See also
- glfwGetVideoMode
◆ glfwSetGamma()
void glfwSetGamma |
( |
GLFWmonitor * |
monitor, |
|
|
float |
gamma |
|
) |
| |
This function generates a 256-element gamma ramp from the specified exponent and then calls glfwSetGammaRamp with it.
- Parameters
-
[in] | monitor | The monitor whose gamma ramp to set. |
[in] | gamma | The desired exponent. |
◆ glfwSetGammaRamp()
This function sets the current gamma ramp for the specified monitor.
- Parameters
-
[in] | monitor | The monitor whose gamma ramp to set. |
[in] | ramp | The gamma ramp to use. |
- Note
- Gamma ramp sizes other than 256 are not supported by all hardware.
◆ glfwSetMonitorCallback()
This function sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the system.
- Parameters
-
[in] | cbfun | The new callback, or NULL to remove the currently set callback. |
- Returns
- The previously set callback, or
NULL
if no callback was set or an error occurred.
- Bug:
- X11: This callback is not yet called on monitor configuration changes.