glfwSetDropCallback function

GLFWdropfun glfwSetDropCallback(
  1. Pointer<GLFWwindow> window,
  2. GLFWdropfun callback
)

! @brief Sets the path drop callback.

This function sets the path drop callback of the specified window, which is called when one or more dragged paths are dropped on the window.

Because the path array and its strings may have been generated specifically for that event, they are not guaranteed to be valid after the callback has returned. If you wish to use them after the callback returns, you need to make a deep copy.

@paramin window The window whose callback to set. @paramin callback The new file drop 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 path_count, const char* paths[]) @endcode For more information about the callback parameters, see the function pointer type(@ref GLFWdropfun).

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

@remark @wayland File drop is currently unimplemented.

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

@sa @ref path_drop

@since Added in version 3.1.

@ingroup input

GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback)

Implementation

GLFWdropfun glfwSetDropCallback(
    Pointer<GLFWwindow> window, GLFWdropfun callback) {
  final glfwSetDropCallbackLookupFunction = libglfw.lookupFunction<
      GLFWdropfun Function(Pointer<GLFWwindow> window, GLFWdropfun callback),
      GLFWdropfun Function(Pointer<GLFWwindow> window,
          GLFWdropfun callback)>('glfwSetDropCallback');
  return glfwSetDropCallbackLookupFunction(window, callback);
}