1SDL_JoystickGetBall(3)         SDL API Reference        SDL_JoystickGetBall(3)
2
3
4

NAME

6       SDL_JoystickGetBall - Get relative trackball motion
7

SYNOPSIS

9       #include "SDL.h"
10
11       int  SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int
12       *dy);
13

DESCRIPTION

15       Get the ball axis change.
16
17       Trackballs can only return relative  motion  since  the  last  call  to
18       SDL_JoystickGetBall, these motion deltas a placed into dx and dy.
19

RETURN VALUE

21       Returns 0 on success or -1 on failure
22

EXAMPLES

24       int delta_x, delta_y;
25       SDL_Joystick *joy;
26       .
27       .
28       .
29       SDL_JoystickUpdate();
30       if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
31         printf("TrackBall Read Error!
32       ");
33       printf("Trackball Delta- X:%d, Y:%d
34       ", delta_x, delta_y);
35

SEE ALSO

37       SDL_JoystickNumBalls
38
39
40
41SDL                         Tue 11 Sep 2001, 23:00      SDL_JoystickGetBall(3)
Impressum