Function SDL_JoystickGetBall

pub unsafe extern "C" fn SDL_JoystickGetBall(
    joystick: *mut _SDL_Joystick,
    ball: i32,
    dx: *mut i32,
    dy: *mut i32,
) -> i32
Available on crate feature dep_sdl2 only.
Expand description

Get the ball axis change since the last poll.

Trackballs can only return relative motion since the last call to SDL_JoystickGetBall(), these motion deltas are placed into dx and dy.

Most joysticks do not have trackballs.

\param joystick the SDL_Joystick to query \param ball the ball index to query; ball indices start at index 0 \param dx stores the difference in the x axis position since the last poll \param dy stores the difference in the y axis position since the last poll \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_JoystickNumBalls