glfwSetWindowSizeCallback function

GLFWwindowsizefun glfwSetWindowSizeCallback(
  1. Pointer<GLFWwindow> window,
  2. GLFWwindowsizefun callback
)

! @brief Sets the size callback for the specified window.

This function sets the size callback of the specified window, which is called when the window is resized. The callback is provided with the size, in screen coordinates, of the content area of the window.

@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, int width, int height) @endcode For more information about the callback parameters, see the function pointer type(@ref GLFWwindowsizefun).

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

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

@sa @ref window_size

@since Added in version 1.0. @glfw3 Added window handle parameter and return value.

@ingroup window

GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback)

Implementation

GLFWwindowsizefun glfwSetWindowSizeCallback(
    Pointer<GLFWwindow> window, GLFWwindowsizefun callback) {
  final glfwSetWindowSizeCallbackLookupFunction = libglfw.lookupFunction<
      GLFWwindowsizefun Function(
          Pointer<GLFWwindow> window, GLFWwindowsizefun callback),
      GLFWwindowsizefun Function(Pointer<GLFWwindow> window,
          GLFWwindowsizefun callback)>('glfwSetWindowSizeCallback');
  return glfwSetWindowSizeCallbackLookupFunction(window, callback);
}