logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_JoystickGetBall - Get relative trackball motion

Description

       Get the ball axis change.

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

Examples

       int delta_x, delta_y;
       SDL_Joystick *joy;
       .
       .
       .
       SDL_JoystickUpdate();
       if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
         printf("TrackBall Read Error!
       ");
       printf("Trackball Delta- X:%d, Y:%d
       ", delta_x, delta_y);

Name

       SDL_JoystickGetBall - Get relative trackball motion

Return Value

       Returns 0 on success or -1 on failure

See Also

SDL_JoystickNumBalls

SDL                                          Tue 11 Sep 2001, 23:00                       SDL_JoystickGetBall(3)

Synopsis

#include"SDL.h"intSDL_JoystickGetBall(SDL_Joystick*joystick,intball,int*dx,int*dy);

See Also