glfwSetGamma function

void glfwSetGamma(
  1. Pointer<GLFWmonitor> monitor,
  2. double gamma
)

! @brief 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.

@paramin monitor The monitor whose gamma ramp to set. @paramin gamma 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

@since Added in version 3.0.

@ingroup monitor

GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma)

Implementation

void glfwSetGamma(Pointer<GLFWmonitor> monitor, double gamma) {
  final glfwSetGammaLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWmonitor> monitor, Float gamma),
      void Function(
          Pointer<GLFWmonitor> monitor, double gamma)>('glfwSetGamma');
  return glfwSetGammaLookupFunction(monitor, gamma);
}