sdlJoystickGetBall function
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
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
Implementation
int sdlJoystickGetBall(Pointer<SdlJoystick> joystick, int ball,
Pointer<Int32> dx, Pointer<Int32> dy) {
final sdlJoystickGetBallLookupFunction = libSdl2.lookupFunction<
Int32 Function(Pointer<SdlJoystick> joystick, Int32 ball,
Pointer<Int32> dx, Pointer<Int32> dy),
int Function(Pointer<SdlJoystick> joystick, int ball, Pointer<Int32> dx,
Pointer<Int32> dy)>('SDL_JoystickGetBall');
return sdlJoystickGetBallLookupFunction(joystick, ball, dx, dy);
}