glfwSetGammaRamp function

void glfwSetGammaRamp(
  1. Pointer<GLFWmonitor> monitor,
  2. Pointer<GLFWgammaramp> ramp
)

! @brief Sets the current gamma ramp for the specified monitor.

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 @ref 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 @ref GLFW_SRGB_CAPABLE hint.

@paramin monitor The monitor whose gamma ramp to set. @paramin ramp The gamma ramp to use.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_PLATFORM_ERROR.

@remark The size of the specified gamma ramp should match the size of the current ramp for that monitor.

@remark @win32 The gamma ramp size must be 256.

@remark @wayland Gamma handling is a privileged protocol, this function will thus never be implemented and emits @ref 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.

@sa @ref monitor_gamma

@since Added in version 3.0.

@ingroup monitor

GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp)

Implementation

void glfwSetGammaRamp(
    Pointer<GLFWmonitor> monitor, Pointer<GLFWgammaramp> ramp) {
  final glfwSetGammaRampLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWmonitor> monitor, Pointer<GLFWgammaramp> ramp),
      void Function(Pointer<GLFWmonitor> monitor,
          Pointer<GLFWgammaramp> ramp)>('glfwSetGammaRamp');
  return glfwSetGammaRampLookupFunction(monitor, ramp);
}