This is the reference documentation for monitor related functions and types. For more task-oriented information, see the Monitor guide.
|
GLFWmonitor ** | glfwGetMonitors (int *count) |
| Returns the currently connected monitors. More...
|
|
GLFWmonitor * | glfwGetPrimaryMonitor (void) |
| Returns the primary monitor. More...
|
|
void | glfwGetMonitorPos (GLFWmonitor *monitor, int *xpos, int *ypos) |
| Returns the position of the monitor's viewport on the virtual screen. More...
|
|
void | glfwGetMonitorWorkarea (GLFWmonitor *monitor, int *xpos, int *ypos, int *width, int *height) |
| Retrieves the work area of the monitor. More...
|
|
void | glfwGetMonitorPhysicalSize (GLFWmonitor *monitor, int *widthMM, int *heightMM) |
| Returns the physical size of the monitor. More...
|
|
void | glfwGetMonitorContentScale (GLFWmonitor *monitor, float *xscale, float *yscale) |
| Retrieves the content scale for the specified monitor. More...
|
|
const char * | glfwGetMonitorName (GLFWmonitor *monitor) |
| Returns the name of the specified monitor. More...
|
|
void | glfwSetMonitorUserPointer (GLFWmonitor *monitor, void *pointer) |
| Sets the user pointer of the specified monitor. More...
|
|
void * | glfwGetMonitorUserPointer (GLFWmonitor *monitor) |
| Returns the user pointer of the specified monitor. More...
|
|
GLFWmonitorfun | glfwSetMonitorCallback (GLFWmonitorfun callback) |
| Sets the monitor configuration callback. More...
|
|
const GLFWvidmode * | glfwGetVideoModes (GLFWmonitor *monitor, int *count) |
| Returns the available video modes for the specified monitor. More...
|
|
const GLFWvidmode * | glfwGetVideoMode (GLFWmonitor *monitor) |
| Returns the current mode of the specified monitor. More...
|
|
void | glfwSetGamma (GLFWmonitor *monitor, float gamma) |
| Generates a gamma ramp and sets it for the specified monitor. More...
|
|
const GLFWgammaramp * | glfwGetGammaRamp (GLFWmonitor *monitor) |
| Returns the current gamma ramp for the specified monitor. More...
|
|
void | glfwSetGammaRamp (GLFWmonitor *monitor, const GLFWgammaramp *ramp) |
| Sets the current gamma ramp for the specified monitor. More...
|
|
void glfwGetMonitorWorkarea |
( |
GLFWmonitor * |
monitor, |
|
|
int * |
xpos, |
|
|
int * |
ypos, |
|
|
int * |
width, |
|
|
int * |
height |
|
) |
| |
This function returns the position, in screen coordinates, of the upper-left corner of the work area of the specified monitor along with the work area size in screen coordinates. The work area is defined as the area of the monitor not occluded by the operating system task bar where present. If no task bar exists then the work area is the monitor resolution in screen coordinates.
Any or all of the position and size arguments may be NULL
. If an error occurs, all non-NULL
position and size arguments will be set to zero.
- 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 . |
[out] | width | Where to store the monitor width, or NULL . |
[out] | height | Where to store the monitor height, or NULL . |
- Errors
- Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
- Thread safety
- This function must only be called from the main thread.
- See also
- Work area
- Since
- Added in version 3.3.
void glfwGetMonitorPhysicalSize |
( |
GLFWmonitor * |
monitor, |
|
|
int * |
widthMM, |
|
|
int * |
heightMM |
|
) |
| |
This function returns the size, in millimetres, of the display area of the specified monitor.
Some systems do not provide accurate monitor size information, either because the monitor EDID data is incorrect or because the driver does not report it accurately.
Any or all of the size arguments may be NULL
. If an error occurs, all non-NULL
size arguments will be set to zero.
- Parameters
-
[in] | monitor | The monitor to query. |
[out] | widthMM | Where to store the width, in millimetres, of the monitor's display area, or NULL . |
[out] | heightMM | Where to store the height, in millimetres, of the monitor's display area, or NULL . |
- Errors
- Possible errors include GLFW_NOT_INITIALIZED.
- Thread safety
- This function must only be called from the main thread.
- See also
- Monitor properties
- Since
- Added in version 3.0.
void glfwSetGamma |
( |
GLFWmonitor * |
monitor, |
|
|
float |
gamma |
|
) |
| |
This function generates an appropriately sized gamma ramp from the specified exponent and then calls glfwSetGammaRamp with it. The value must be a finite number greater than zero.
The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.
For gamma correct rendering with OpenGL or OpenGL ES, see the GLFW_SRGB_CAPABLE hint.
- Parameters
-
[in] | monitor | The monitor whose gamma ramp to set. |
[in] | gamma | The desired exponent. |
- Errors
- Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_VALUE and GLFW_PLATFORM_ERROR.
- Thread safety
- This function must only be called from the main thread.
- See also
- Gamma ramp
- Since
- Added in version 3.0.
This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this function is called and is restored by glfwTerminate.
The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.
For gamma correct rendering with OpenGL or OpenGL ES, see the GLFW_SRGB_CAPABLE hint.
- Parameters
-
[in] | monitor | The monitor whose gamma ramp to set. |
[in] | ramp | The gamma ramp to use. |
- Errors
- Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
- Pointer lifetime
- The specified gamma ramp is copied before this function returns.
- Thread safety
- This function must only be called from the main thread.
- See also
- Gamma ramp
- Since
- Added in version 3.0.