glfwSetWindowUserPointer function

void glfwSetWindowUserPointer(
  1. Pointer<GLFWwindow> window,
  2. Pointer<Void> pointer
)

! @brief Sets the user pointer of the specified window.

This function sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value is NULL.

@paramin window The window whose pointer to set. @paramin pointer The new value.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

@thread_safety This function may be called from any thread. Access is not synchronized.

@sa @ref window_userptr @sa @ref glfwGetWindowUserPointer

@since Added in version 3.0.

@ingroup window

GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer)

Implementation

void glfwSetWindowUserPointer(
    Pointer<GLFWwindow> window, Pointer<Void> pointer) {
  final glfwSetWindowUserPointerLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window, Pointer<Void> pointer),
      void Function(Pointer<GLFWwindow> window,
          Pointer<Void> pointer)>('glfwSetWindowUserPointer');
  return glfwSetWindowUserPointerLookupFunction(window, pointer);
}