glfwSetDropCallback

Function glfwSetDropCallback 

Source
pub unsafe extern "C" fn glfwSetDropCallback(
    window: *mut GLFWwindow,
    callback: Option<unsafe extern "C" fn(*mut GLFWwindow, i32, *mut *const i8)>,
) -> Option<unsafe extern "C" fn(*mut GLFWwindow, i32, *mut *const i8)>
Expand description

@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.

@param[in] window The window whose callback to set. @param[in] 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.

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

@sa @ref path_drop

@since Added in version 3.1.

@ingroup input