[go: up one dir, main page]

glfwSetMonitorCallback

Function glfwSetMonitorCallback 

Source
pub unsafe extern "C" fn glfwSetMonitorCallback(
    callback: Option<unsafe extern "C" fn(*mut GLFWmonitor, i32)>,
) -> Option<unsafe extern "C" fn(*mut GLFWmonitor, i32)>
Expand description

@brief Sets the monitor configuration callback.

This function sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the system.

@param[in] 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(GLFWmonitor* monitor, int event) @endcode For more information about the callback parameters, see the [function pointer type](@ref GLFWmonitorfun).

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

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

@sa @ref monitor_event

@since Added in version 3.0.

@ingroup monitor