glfwSetWindowContentScaleCallback function

GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(
  1. Pointer<GLFWwindow> window,
  2. GLFWwindowcontentscalefun callback
)

! @brief Sets the window content scale callback for the specified window.

This function sets the window content scale callback of the specified window, which is called when the content scale of the specified window changes.

@paramin window The window whose callback to set. @paramin callback The new callback, or NULL to remove the currently set callback. @return The previously set callback, or NULL if no callback was set or the library had not been initialized(@ref intro_init).

@callback_signature @code void function_name(GLFWwindow* window, float xscale, float yscale) @endcode For more information about the callback parameters, see the function pointer type(@ref GLFWwindowcontentscalefun).

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

@thread_safety This function must only be called from the main thread.

@sa @ref window_scale @sa @ref glfwGetWindowContentScale

@since Added in version 3.3.

@ingroup window

GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback)

Implementation

GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(
    Pointer<GLFWwindow> window, GLFWwindowcontentscalefun callback) {
  final glfwSetWindowContentScaleCallbackLookupFunction =
      libglfw.lookupFunction<
          GLFWwindowcontentscalefun Function(
              Pointer<GLFWwindow> window, GLFWwindowcontentscalefun callback),
          GLFWwindowcontentscalefun Function(
              Pointer<GLFWwindow> window,
              GLFWwindowcontentscalefun
                  callback)>('glfwSetWindowContentScaleCallback');
  return glfwSetWindowContentScaleCallbackLookupFunction(window, callback);
}