glfwSetWindowPosCallback function
! @brief Sets the position callback for the specified window.
This function sets the position callback of the specified window, which is called when the window is moved. The callback is provided with the position, in screen coordinates, of the upper-left corner of the content area of the window.
@paramin
window The window whose callback to set.
@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(GLFWwindow* window, int xpos, int ypos)
@endcode
For more information about the callback parameters, see the
function pointer type
(@ref GLFWwindowposfun).
@errors Possible errors include @ref GLFW_NOT_INITIALIZED.
@remark @wayland This callback will never be called, as there is no way for an application to know its global position.
@thread_safety This function must only be called from the main thread.
@sa @ref window_pos
@since Added in version 3.0.
@ingroup window
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback)
Implementation
GLFWwindowposfun glfwSetWindowPosCallback(
Pointer<GLFWwindow> window, GLFWwindowposfun callback) {
final glfwSetWindowPosCallbackLookupFunction = libglfw.lookupFunction<
GLFWwindowposfun Function(
Pointer<GLFWwindow> window, GLFWwindowposfun callback),
GLFWwindowposfun Function(Pointer<GLFWwindow> window,
GLFWwindowposfun callback)>('glfwSetWindowPosCallback');
return glfwSetWindowPosCallbackLookupFunction(window, callback);
}