include/SDL_touch.h
changeset 6951 7833f01322b3
parent 6950 1ddb72193079
child 7170 d5f5a491fe49
     1.1 --- a/include/SDL_touch.h	Sat Mar 02 20:44:16 2013 -0800
     1.2 +++ b/include/SDL_touch.h	Sun Mar 03 01:01:33 2013 -0800
     1.3 @@ -46,46 +46,11 @@
     1.4  typedef struct SDL_Finger
     1.5  {
     1.6      SDL_FingerID id;
     1.7 -    Uint16 x;
     1.8 -    Uint16 y;
     1.9 -    Uint16 pressure;
    1.10 -    Uint16 xdelta;
    1.11 -    Uint16 ydelta;
    1.12 -    Uint16 last_x, last_y,last_pressure;  /* the last reported coordinates */
    1.13 -    SDL_bool down;
    1.14 +    float x;
    1.15 +    float y;
    1.16 +    float pressure;
    1.17  } SDL_Finger;
    1.18  
    1.19 -typedef struct SDL_Touch
    1.20 -{
    1.21 -  /* Free the touch when it's time */
    1.22 -  void (*FreeTouch) (struct SDL_Touch * touch);
    1.23 -  
    1.24 -  /* data common for tablets */
    1.25 -  float pressure_max, pressure_min;
    1.26 -  float x_max,x_min;
    1.27 -  float y_max,y_min;
    1.28 -  Uint16 xres,yres,pressureres;
    1.29 -  float native_xres,native_yres,native_pressureres;
    1.30 -  float tilt_x;                 /* for future use */
    1.31 -  float tilt_y;                 /* for future use */
    1.32 -  float rotation;               /* for future use */
    1.33 -  
    1.34 -  /* Data common to all touch */
    1.35 -  SDL_TouchID id;
    1.36 -  SDL_Window *focus;
    1.37 -  
    1.38 -  char *name;
    1.39 -  Uint8 buttonstate;
    1.40 -  SDL_bool relative_mode;
    1.41 -  SDL_bool flush_motion;
    1.42 -
    1.43 -  int num_fingers;
    1.44 -  int max_fingers;
    1.45 -  SDL_Finger** fingers;
    1.46 -    
    1.47 -  void *driverdata;
    1.48 -} SDL_Touch;
    1.49 -
    1.50  /* Used as the device ID for mouse events simulated with touch input */
    1.51  #define SDL_TOUCH_MOUSEID ((Uint32)-1)
    1.52  
    1.53 @@ -93,14 +58,24 @@
    1.54  /* Function prototypes */
    1.55  
    1.56  /**
    1.57 - *  \brief Get the touch object with the given id.
    1.58 + *  \brief Get the number of registered touch devices.
    1.59   */
    1.60 -extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
    1.61 +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices();
    1.62  
    1.63  /**
    1.64 - *  \brief Get the finger object of the given touch, with the given id.
    1.65 + *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
    1.66   */
    1.67 -extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
    1.68 +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
    1.69 +
    1.70 +/**
    1.71 + *  \brief Get the number of active fingers for a given touch device.
    1.72 + */
    1.73 +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
    1.74 +
    1.75 +/**
    1.76 + *  \brief Get the finger object of the given touch, with the given index.
    1.77 + */
    1.78 +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
    1.79  
    1.80  /* Ends C function definitions when using C++ */
    1.81  #ifdef __cplusplus