glfwSetCursorPosCallback¶
This function sets the cursor position callback of the specified window, which is called when the cursor is moved.
The callback is provided with the position, in screen coordinates, relative to the upper-left corner of the client area of the window.
Example:
glfwSetCursorPosCallback($window, function($xpos, $ypos) {
echo "Cursor position: " . $xpos . ", " . $ypos . PHP_EOL;
});
- arguments
-
\GLFWwindow
$window
The window whose callback to set.callable
$callback
- returns
-
void