glfwSetGamma

Generates a gamma ramp and sets it for the specified monitor.

This function generates an appropriately sized gamma ramp from the specified exponent and then calls @ref 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 @ref GLFW_SRGB_CAPABLE hint.

extern (C) @nogc nothrow __gshared
void
glfwSetGamma

Parameters

monitor GLFWmonitor*

The monitor whose gamma ramp to set.

gamma float

The desired exponent.

Errors: Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.

@remark @wayland Gamma handling is a privileged protocol, this function will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR.

Thread Safety

This function must only be called from the main thread.

@sa @ref monitor_gamma

Meta

Since

Added in version 3.0.

Ingroup: monitor