glfwSetMonitorCallback function
! @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.
@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(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
GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback)
Implementation
GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback) {
final glfwSetMonitorCallbackLookupFunction = libglfw.lookupFunction<
GLFWmonitorfun Function(GLFWmonitorfun callback),
GLFWmonitorfun Function(
GLFWmonitorfun callback)>('glfwSetMonitorCallback');
return glfwSetMonitorCallbackLookupFunction(callback);
}