comparison include/SDL_touch.h @ 4678:f8431f66613d

Added SDL_TouchID, SDL_FingerID, SDL_GestureID types. Converted to integer cioordinates (<- not working).
author jimtla
date Sat, 31 Jul 2010 20:02:54 +0400
parents 99b4560b7aa1
children 5ee96ba0c01e
comparison
equal deleted inserted replaced
4677:31607094315c 4678:f8431f66613d
40 extern "C" { 40 extern "C" {
41 /* *INDENT-ON* */ 41 /* *INDENT-ON* */
42 #endif 42 #endif
43 43
44 44
45 typedef Uint64 SDL_TouchID;
46 typedef Uint64 SDL_FingerID;
47
48
45 struct SDL_Finger { 49 struct SDL_Finger {
46 long id; 50 SDL_FingerID id;
47 float x; 51 Uint16 x;
48 float y; 52 Uint16 y;
49 float xdelta; 53 Uint16 xdelta;
50 float ydelta; 54 Uint16 ydelta;
51 float last_x, last_y,last_pressure; /* the last reported coordinates */ 55 Uint16 last_x, last_y,last_pressure; /* the last reported coordinates */
52 SDL_bool down; 56 SDL_bool down;
53 float pressure; 57 Uint16 pressure;
54 }; 58 };
55 59
56 typedef struct SDL_Touch SDL_Touch; 60 typedef struct SDL_Touch SDL_Touch;
57 typedef struct SDL_Finger SDL_Finger; 61 typedef struct SDL_Finger SDL_Finger;
58 62
64 68
65 /* data common for tablets */ 69 /* data common for tablets */
66 float pressure_max, pressure_min; 70 float pressure_max, pressure_min;
67 float x_max,x_min; 71 float x_max,x_min;
68 float y_max,y_min; 72 float y_max,y_min;
69 float xres,yres,pressureres; 73 Uint16 xres,yres,pressureres;
74 float native_xres,native_yres,native_pressureres;
70 float tilt; /* for future use */ 75 float tilt; /* for future use */
71 float rotation; /* for future use */ 76 float rotation; /* for future use */
72 77
73 /* Data common to all touch */ 78 /* Data common to all touch */
74 long id; 79 SDL_TouchID id;
75 SDL_Window *focus; 80 SDL_Window *focus;
76 81
77 char *name; 82 char *name;
78 Uint8 buttonstate; 83 Uint8 buttonstate;
79 SDL_bool relative_mode; 84 SDL_bool relative_mode;
93 /** 98 /**
94 * \brief Get the touch object at the given id. 99 * \brief Get the touch object at the given id.
95 * 100 *
96 * 101 *
97 */ 102 */
98 extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(long id); 103 extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(SDL_TouchID id);
99 104
100 105
101 106
102 /** 107 /**
103 * \brief Get the finger object of the given touch, at the given id. 108 * \brief Get the finger object of the given touch, at the given id.
104 * 109 *
105 * 110 *
106 */ 111 */
107 extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, long id); 112 extern
113 DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, SDL_FingerID id);
108 114
109 /* Ends C function definitions when using C++ */ 115 /* Ends C function definitions when using C++ */
110 #ifdef __cplusplus 116 #ifdef __cplusplus
111 /* *INDENT-OFF* */ 117 /* *INDENT-OFF* */
112 } 118 }