SDL 2.0
SDL_touch.c File Reference
#include "../SDL_internal.h"
#include "SDL_assert.h"
#include "SDL_events.h"
#include "SDL_events_c.h"
#include "../video/SDL_sysvideo.h"
+ Include dependency graph for SDL_touch.c:

Go to the source code of this file.

Macros

#define SYNTHESIZE_TOUCH_TO_MOUSE   1
 

Functions

int SDL_TouchInit (void)
 
int SDL_GetNumTouchDevices (void)
 Get the number of registered touch devices. More...
 
SDL_TouchID SDL_GetTouchDevice (int index)
 Get the touch ID with the given index, or 0 if the index is invalid. More...
 
static int SDL_GetTouchIndex (SDL_TouchID id)
 
SDL_TouchSDL_GetTouch (SDL_TouchID id)
 
SDL_TouchDeviceType SDL_GetTouchDeviceType (SDL_TouchID id)
 Get the type of the given touch device. More...
 
static int SDL_GetFingerIndex (const SDL_Touch *touch, SDL_FingerID fingerid)
 
static SDL_FingerSDL_GetFinger (const SDL_Touch *touch, SDL_FingerID id)
 
int SDL_GetNumTouchFingers (SDL_TouchID touchID)
 Get the number of active fingers for a given touch device. More...
 
SDL_FingerSDL_GetTouchFinger (SDL_TouchID touchID, int index)
 Get the finger object of the given touch, with the given index. More...
 
int SDL_AddTouch (SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name)
 
static int SDL_AddFinger (SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure)
 
static int SDL_DelFinger (SDL_Touch *touch, SDL_FingerID fingerid)
 
int SDL_SendTouch (SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, float x, float y, float pressure)
 
int SDL_SendTouchMotion (SDL_TouchID id, SDL_FingerID fingerid, float x, float y, float pressure)
 
void SDL_DelTouch (SDL_TouchID id)
 
void SDL_TouchQuit (void)
 

Variables

static int SDL_num_touch = 0
 
static SDL_Touch ** SDL_touchDevices = NULL
 
static SDL_bool finger_touching = SDL_FALSE
 
static SDL_FingerID track_fingerid
 
static SDL_TouchID track_touchid
 

Macro Definition Documentation

◆ SYNTHESIZE_TOUCH_TO_MOUSE

#define SYNTHESIZE_TOUCH_TO_MOUSE   1

Definition at line 36 of file SDL_touch.c.

Function Documentation

◆ SDL_AddFinger()

static int SDL_AddFinger ( SDL_Touch touch,
SDL_FingerID  fingerid,
float  x,
float  y,
float  pressure 
)
static

Definition at line 198 of file SDL_touch.c.

199{
200 SDL_Finger *finger;
201
202 if (touch->num_fingers == touch->max_fingers) {
203 SDL_Finger **new_fingers;
204 new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers));
205 if (!new_fingers) {
206 return SDL_OutOfMemory();
207 }
208 touch->fingers = new_fingers;
209 touch->fingers[touch->max_fingers] = (SDL_Finger *)SDL_malloc(sizeof(*finger));
210 if (!touch->fingers[touch->max_fingers]) {
211 return SDL_OutOfMemory();
212 }
213 touch->max_fingers++;
214 }
215
216 finger = touch->fingers[touch->num_fingers++];
217 finger->id = fingerid;
218 finger->x = x;
219 finger->y = y;
220 finger->pressure = pressure;
221 return 0;
222}
#define SDL_malloc
#define SDL_realloc
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
float y
Definition: SDL_touch.h:56
float pressure
Definition: SDL_touch.h:57
SDL_FingerID id
Definition: SDL_touch.h:54
float x
Definition: SDL_touch.h:55
int max_fingers
Definition: SDL_touch_c.h:32
SDL_Finger ** fingers
Definition: SDL_touch_c.h:33
int num_fingers
Definition: SDL_touch_c.h:31

References SDL_Touch::fingers, SDL_Finger::id, SDL_Touch::max_fingers, SDL_Touch::num_fingers, SDL_Finger::pressure, SDL_malloc, SDL_OutOfMemory, SDL_realloc, SDL_Finger::x, and SDL_Finger::y.

Referenced by SDL_SendTouch().

◆ SDL_AddTouch()

int SDL_AddTouch ( SDL_TouchID  touchID,
SDL_TouchDeviceType  type,
const char *  name 
)

Definition at line 155 of file SDL_touch.c.

156{
157 SDL_Touch **touchDevices;
158 int index;
159
160 index = SDL_GetTouchIndex(touchID);
161 if (index >= 0) {
162 return index;
163 }
164
165 /* Add the touch to the list of touch */
166 touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices,
167 (SDL_num_touch + 1) * sizeof(*touchDevices));
168 if (!touchDevices) {
169 return SDL_OutOfMemory();
170 }
171
172 SDL_touchDevices = touchDevices;
174
176 if (!SDL_touchDevices[index]) {
177 return SDL_OutOfMemory();
178 }
179
180 /* Added touch to list */
182
183 /* we're setting the touch properties */
184 SDL_touchDevices[index]->id = touchID;
189
190 /* Record this touch device for gestures */
191 /* We could do this on the fly in the gesture code if we wanted */
192 SDL_GestureAddTouch(touchID);
193
194 return index;
195}
int SDL_GestureAddTouch(SDL_TouchID touchId)
Definition: SDL_gesture.c:450
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571
GLuint index
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:32
static int SDL_GetTouchIndex(SDL_TouchID id)
Definition: SDL_touch.c:68
static int SDL_num_touch
Definition: SDL_touch.c:31
#define NULL
Definition: begin_code.h:167
SDL_TouchID id
Definition: SDL_touch_c.h:29
SDL_TouchDeviceType type
Definition: SDL_touch_c.h:30

References SDL_Touch::fingers, SDL_Touch::id, SDL_Touch::max_fingers, NULL, SDL_Touch::num_fingers, SDL_GestureAddTouch(), SDL_GetTouchIndex(), SDL_malloc, SDL_num_touch, SDL_OutOfMemory, SDL_realloc, SDL_touchDevices, and SDL_Touch::type.

Referenced by SDL_MouseTouchEventsChanged().

◆ SDL_DelFinger()

static int SDL_DelFinger ( SDL_Touch touch,
SDL_FingerID  fingerid 
)
static

Definition at line 225 of file SDL_touch.c.

226{
227 SDL_Finger *temp;
228
229 int index = SDL_GetFingerIndex(touch, fingerid);
230 if (index < 0) {
231 return -1;
232 }
233
234 touch->num_fingers--;
235 temp = touch->fingers[index];
236 touch->fingers[index] = touch->fingers[touch->num_fingers];
237 touch->fingers[touch->num_fingers] = temp;
238 return 0;
239}
static int SDL_GetFingerIndex(const SDL_Touch *touch, SDL_FingerID fingerid)
Definition: SDL_touch.c:109

References SDL_Touch::fingers, SDL_Touch::num_fingers, and SDL_GetFingerIndex().

Referenced by SDL_SendTouch().

◆ SDL_DelTouch()

void SDL_DelTouch ( SDL_TouchID  id)

Definition at line 449 of file SDL_touch.c.

450{
451 int i;
452 int index = SDL_GetTouchIndex(id);
453 SDL_Touch *touch = SDL_GetTouch(id);
454
455 if (!touch) {
456 return;
457 }
458
459 for (i = 0; i < touch->max_fingers; ++i) {
460 SDL_free(touch->fingers[i]);
461 }
462 SDL_free(touch->fingers);
463 SDL_free(touch);
464
467
468 /* Delete this touch device for gestures */
470}
#define SDL_free
int SDL_GestureDelTouch(SDL_TouchID touchId)
Definition: SDL_gesture.c:468
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:83
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50

References SDL_Touch::fingers, i, SDL_Touch::max_fingers, SDL_free, SDL_GestureDelTouch(), SDL_GetTouch(), SDL_GetTouchIndex(), SDL_num_touch, and SDL_touchDevices.

Referenced by SDL_TouchQuit().

◆ SDL_GetFinger()

static SDL_Finger * SDL_GetFinger ( const SDL_Touch touch,
SDL_FingerID  id 
)
static

Definition at line 121 of file SDL_touch.c.

122{
123 int index = SDL_GetFingerIndex(touch, id);
124 if (index < 0 || index >= touch->num_fingers) {
125 return NULL;
126 }
127 return touch->fingers[index];
128}

References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, and SDL_GetFingerIndex().

Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().

◆ SDL_GetFingerIndex()

static int SDL_GetFingerIndex ( const SDL_Touch touch,
SDL_FingerID  fingerid 
)
static

Definition at line 109 of file SDL_touch.c.

110{
111 int index;
112 for (index = 0; index < touch->num_fingers; ++index) {
113 if (touch->fingers[index]->id == fingerid) {
114 return index;
115 }
116 }
117 return -1;
118}

References SDL_Touch::fingers, SDL_Finger::id, and SDL_Touch::num_fingers.

Referenced by SDL_DelFinger(), and SDL_GetFinger().

◆ SDL_GetNumTouchDevices()

int SDL_GetNumTouchDevices ( void  )

Get the number of registered touch devices.

Definition at line 52 of file SDL_touch.c.

53{
54 return SDL_num_touch;
55}

References SDL_num_touch.

◆ SDL_GetNumTouchFingers()

int SDL_GetNumTouchFingers ( SDL_TouchID  touchID)

Get the number of active fingers for a given touch device.

Definition at line 131 of file SDL_touch.c.

132{
133 SDL_Touch *touch = SDL_GetTouch(touchID);
134 if (touch) {
135 return touch->num_fingers;
136 }
137 return 0;
138}

References SDL_Touch::num_fingers, and SDL_GetTouch().

◆ SDL_GetTouch()

SDL_Touch * SDL_GetTouch ( SDL_TouchID  id)

Definition at line 83 of file SDL_touch.c.

84{
85 int index = SDL_GetTouchIndex(id);
87 if (SDL_GetVideoDevice()->ResetTouch != NULL) {
88 SDL_SetError("Unknown touch id %d, resetting", (int) id);
90 } else {
91 SDL_SetError("Unknown touch device id %d, cannot reset", (int) id);
92 }
93 return NULL;
94 }
95 return SDL_touchDevices[index];
96}
#define SDL_SetError
SDL_VideoDevice * SDL_GetVideoDevice(void)
Definition: SDL_video.c:583
void(* ResetTouch)(_THIS)
Definition: SDL_sysvideo.h:172

References NULL, SDL_VideoDevice::ResetTouch, SDL_GetTouchIndex(), SDL_GetVideoDevice(), SDL_num_touch, SDL_SetError, and SDL_touchDevices.

Referenced by SDL_DelTouch(), SDL_GetNumTouchFingers(), SDL_GetTouchDeviceType(), SDL_GetTouchFinger(), SDL_SendTouch(), and SDL_SendTouchMotion().

◆ SDL_GetTouchDevice()

SDL_TouchID SDL_GetTouchDevice ( int  index)

Get the touch ID with the given index, or 0 if the index is invalid.

Definition at line 58 of file SDL_touch.c.

59{
61 SDL_SetError("Unknown touch device index %d", index);
62 return 0;
63 }
64 return SDL_touchDevices[index]->id;
65}

References SDL_Touch::id, SDL_num_touch, SDL_SetError, and SDL_touchDevices.

◆ SDL_GetTouchDeviceType()

SDL_TouchDeviceType SDL_GetTouchDeviceType ( SDL_TouchID  id)

Get the type of the given touch device.

Definition at line 99 of file SDL_touch.c.

100{
101 SDL_Touch *touch = SDL_GetTouch(id);
102 if (touch) {
103 return touch->type;
104 }
106}
@ SDL_TOUCH_DEVICE_INVALID
Definition: SDL_touch.h:46

References SDL_GetTouch(), SDL_TOUCH_DEVICE_INVALID, and SDL_Touch::type.

◆ SDL_GetTouchFinger()

SDL_Finger * SDL_GetTouchFinger ( SDL_TouchID  touchID,
int  index 
)

Get the finger object of the given touch, with the given index.

Definition at line 141 of file SDL_touch.c.

142{
143 SDL_Touch *touch = SDL_GetTouch(touchID);
144 if (!touch) {
145 return NULL;
146 }
147 if (index < 0 || index >= touch->num_fingers) {
148 SDL_SetError("Unknown touch finger");
149 return NULL;
150 }
151 return touch->fingers[index];
152}

References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, SDL_GetTouch(), and SDL_SetError.

◆ SDL_GetTouchIndex()

static int SDL_GetTouchIndex ( SDL_TouchID  id)
static

Definition at line 68 of file SDL_touch.c.

69{
70 int index;
71 SDL_Touch *touch;
72
73 for (index = 0; index < SDL_num_touch; ++index) {
74 touch = SDL_touchDevices[index];
75 if (touch->id == id) {
76 return index;
77 }
78 }
79 return -1;
80}

References SDL_Touch::id, SDL_num_touch, and SDL_touchDevices.

Referenced by SDL_AddTouch(), SDL_DelTouch(), and SDL_GetTouch().

◆ SDL_SendTouch()

int SDL_SendTouch ( SDL_TouchID  id,
SDL_FingerID  fingerid,
SDL_bool  down,
float  x,
float  y,
float  pressure 
)

Definition at line 242 of file SDL_touch.c.

244{
245 int posted;
246 SDL_Finger *finger;
247 SDL_Mouse *mouse;
248
249 SDL_Touch* touch = SDL_GetTouch(id);
250 if (!touch) {
251 return -1;
252 }
253
254 mouse = SDL_GetMouse();
255
256#if SYNTHESIZE_TOUCH_TO_MOUSE
257 /* SDL_HINT_TOUCH_MOUSE_EVENTS: controlling whether touch events should generate synthetic mouse events */
258 {
259 if (mouse->touch_mouse_events) {
260 /* FIXME: maybe we should only restrict to a few SDL_TouchDeviceType */
261 if (id != SDL_MOUSE_TOUCHID) {
263 if (window == NULL) {
264 /* Mouse focus may have been lost by e.g. the window resizing
265 * due to device orientation change while the mouse state is
266 * pressed (because its position is now out of the window).
267 * SendMouse* will update mouse focus again after that, but
268 * if those are never called then SDL might think the
269 * 'mouse' has no focus at all. */
271 }
272 if (window) {
273 if (down) {
274 if (finger_touching == SDL_FALSE) {
275 int pos_x = (int)(x * (float)window->w);
276 int pos_y = (int)(y * (float)window->h);
277 if (pos_x < 0) pos_x = 0;
278 if (pos_x > window->w - 1) pos_x = window->w - 1;
279 if (pos_y < 0) pos_y = 0;
280 if (pos_y > window->h - 1) pos_y = window->h - 1;
283 }
284 } else {
285 if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) {
287 }
288 }
289 }
290 if (down) {
291 if (finger_touching == SDL_FALSE) {
294 track_fingerid = fingerid;
295 }
296 } else {
297 if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) {
299 }
300 }
301 }
302 }
303 }
304#endif
305
306 /* SDL_HINT_MOUSE_TOUCH_EVENTS: if not set, discard synthetic touch events coming from platform layer */
307 if (mouse->mouse_touch_events == 0) {
308 if (id == SDL_MOUSE_TOUCHID) {
309 return 0;
310 }
311 }
312
313 finger = SDL_GetFinger(touch, fingerid);
314 if (down) {
315 if (finger) {
316 /* This finger is already down */
317 return 0;
318 }
319
320 if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) {
321 return 0;
322 }
323
324 posted = 0;
327 event.tfinger.type = SDL_FINGERDOWN;
328 event.tfinger.touchId = id;
329 event.tfinger.fingerId = fingerid;
330 event.tfinger.x = x;
331 event.tfinger.y = y;
332 event.tfinger.dx = 0;
333 event.tfinger.dy = 0;
334 event.tfinger.pressure = pressure;
335 posted = (SDL_PushEvent(&event) > 0);
336 }
337 } else {
338 if (!finger) {
339 /* This finger is already up */
340 return 0;
341 }
342
343 posted = 0;
346 event.tfinger.type = SDL_FINGERUP;
347 event.tfinger.touchId = id;
348 event.tfinger.fingerId = fingerid;
349 /* I don't trust the coordinates passed on fingerUp */
350 event.tfinger.x = finger->x;
351 event.tfinger.y = finger->y;
352 event.tfinger.dx = 0;
353 event.tfinger.dy = 0;
354 event.tfinger.pressure = pressure;
355 posted = (SDL_PushEvent(&event) > 0);
356 }
357
358 SDL_DelFinger(touch, fingerid);
359 }
360 return posted;
361}
#define SDL_PushEvent
#define SDL_GetKeyboardFocus
#define SDL_GetMouseFocus
@ SDL_FINGERUP
Definition: SDL_events.h:129
@ SDL_FINGERDOWN
Definition: SDL_events.h:128
#define SDL_GetEventState(type)
Definition: SDL_events.h:772
#define SDL_RELEASED
Definition: SDL_events.h:49
#define SDL_ENABLE
Definition: SDL_events.h:759
#define SDL_PRESSED
Definition: SDL_events.h:50
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
Definition: SDL_mouse.c:605
SDL_Mouse * SDL_GetMouse(void)
Definition: SDL_mouse.c:178
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
Definition: SDL_mouse.c:301
#define SDL_BUTTON_LEFT
Definition: SDL_mouse.h:282
struct _cl_event * event
GLuint id
@ SDL_TRUE
Definition: SDL_stdinc.h:164
@ SDL_FALSE
Definition: SDL_stdinc.h:163
static int SDL_DelFinger(SDL_Touch *touch, SDL_FingerID fingerid)
Definition: SDL_touch.c:225
static SDL_Finger * SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id)
Definition: SDL_touch.c:121
static SDL_TouchID track_touchid
Definition: SDL_touch.c:41
static SDL_FingerID track_fingerid
Definition: SDL_touch.c:40
static int SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure)
Definition: SDL_touch.c:198
static SDL_bool finger_touching
Definition: SDL_touch.c:39
#define SDL_MOUSE_TOUCHID
Definition: SDL_touch.h:64
#define SDL_TOUCH_MOUSEID
Definition: SDL_touch.h:61
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_bool touch_mouse_events
Definition: SDL_mouse_c.h:95
SDL_bool mouse_touch_events
Definition: SDL_mouse_c.h:96
The type used to identify a window.
Definition: SDL_sysvideo.h:74
General event structure.
Definition: SDL_events.h:558

References finger_touching, SDL_Mouse::mouse_touch_events, NULL, SDL_AddFinger(), SDL_BUTTON_LEFT, SDL_DelFinger(), SDL_ENABLE, SDL_FALSE, SDL_FINGERDOWN, SDL_FINGERUP, SDL_GetEventState, SDL_GetFinger(), SDL_GetKeyboardFocus, SDL_GetMouse(), SDL_GetMouseFocus, SDL_GetTouch(), SDL_MOUSE_TOUCHID, SDL_PRESSED, SDL_PushEvent, SDL_RELEASED, SDL_SendMouseButton(), SDL_SendMouseMotion(), SDL_TOUCH_MOUSEID, SDL_TRUE, SDL_Mouse::touch_mouse_events, track_fingerid, track_touchid, SDL_Finger::x, and SDL_Finger::y.

Referenced by SDL_PrivateSendMouseButton(), and SDL_SendTouchMotion().

◆ SDL_SendTouchMotion()

int SDL_SendTouchMotion ( SDL_TouchID  id,
SDL_FingerID  fingerid,
float  x,
float  y,
float  pressure 
)

Definition at line 364 of file SDL_touch.c.

366{
367 SDL_Touch *touch;
368 SDL_Finger *finger;
369 SDL_Mouse *mouse;
370 int posted;
371 float xrel, yrel, prel;
372
373 touch = SDL_GetTouch(id);
374 if (!touch) {
375 return -1;
376 }
377
378 mouse = SDL_GetMouse();
379
380#if SYNTHESIZE_TOUCH_TO_MOUSE
381 /* SDL_HINT_TOUCH_MOUSE_EVENTS: controlling whether touch events should generate synthetic mouse events */
382 {
383 if (mouse->touch_mouse_events) {
384 if (id != SDL_MOUSE_TOUCHID) {
386 if (window) {
387 if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) {
388 int pos_x = (int)(x * (float)window->w);
389 int pos_y = (int)(y * (float)window->h);
390 if (pos_x < 0) pos_x = 0;
391 if (pos_x > window->w - 1) pos_x = window->w - 1;
392 if (pos_y < 0) pos_y = 0;
393 if (pos_y > window->h - 1) pos_y = window->h - 1;
395 }
396 }
397 }
398 }
399 }
400#endif
401
402 /* SDL_HINT_MOUSE_TOUCH_EVENTS: if not set, discard synthetic touch events coming from platform layer */
403 if (mouse->mouse_touch_events == 0) {
404 if (id == SDL_MOUSE_TOUCHID) {
405 return 0;
406 }
407 }
408
409 finger = SDL_GetFinger(touch,fingerid);
410 if (!finger) {
411 return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure);
412 }
413
414 xrel = x - finger->x;
415 yrel = y - finger->y;
416 prel = pressure - finger->pressure;
417
418 /* Drop events that don't change state */
419 if (xrel == 0.0f && yrel == 0.0f && prel == 0.0f) {
420#if 0
421 printf("Touch event didn't change state - dropped!\n");
422#endif
423 return 0;
424 }
425
426 /* Update internal touch coordinates */
427 finger->x = x;
428 finger->y = y;
429 finger->pressure = pressure;
430
431 /* Post the event, if desired */
432 posted = 0;
435 event.tfinger.type = SDL_FINGERMOTION;
436 event.tfinger.touchId = id;
437 event.tfinger.fingerId = fingerid;
438 event.tfinger.x = x;
439 event.tfinger.y = y;
440 event.tfinger.dx = xrel;
441 event.tfinger.dy = yrel;
442 event.tfinger.pressure = pressure;
443 posted = (SDL_PushEvent(&event) > 0);
444 }
445 return posted;
446}
@ SDL_FINGERMOTION
Definition: SDL_events.h:130
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, float x, float y, float pressure)
Definition: SDL_touch.c:242

References finger_touching, SDL_Mouse::mouse_touch_events, SDL_Finger::pressure, SDL_ENABLE, SDL_FINGERMOTION, SDL_GetEventState, SDL_GetFinger(), SDL_GetMouse(), SDL_GetMouseFocus, SDL_GetTouch(), SDL_MOUSE_TOUCHID, SDL_PushEvent, SDL_SendMouseMotion(), SDL_SendTouch(), SDL_TOUCH_MOUSEID, SDL_TRUE, SDL_Mouse::touch_mouse_events, track_fingerid, track_touchid, SDL_Finger::x, and SDL_Finger::y.

Referenced by SDL_PrivateSendMouseMotion().

◆ SDL_TouchInit()

int SDL_TouchInit ( void  )

Definition at line 46 of file SDL_touch.c.

47{
48 return (0);
49}

Referenced by SDL_VideoInit().

◆ SDL_TouchQuit()

void SDL_TouchQuit ( void  )

Definition at line 473 of file SDL_touch.c.

474{
475 int i;
476
477 for (i = SDL_num_touch; i--; ) {
479 }
481
485}
#define SDL_assert(condition)
Definition: SDL_assert.h:169
void SDL_GestureQuit()
Definition: SDL_gesture.c:104
void SDL_DelTouch(SDL_TouchID id)
Definition: SDL_touch.c:449

References i, NULL, SDL_assert, SDL_DelTouch(), SDL_free, SDL_GestureQuit(), SDL_num_touch, and SDL_touchDevices.

Referenced by SDL_VideoQuit().

Variable Documentation

◆ finger_touching

SDL_bool finger_touching = SDL_FALSE
static

Definition at line 39 of file SDL_touch.c.

Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().

◆ SDL_num_touch

int SDL_num_touch = 0
static

◆ SDL_touchDevices

SDL_Touch** SDL_touchDevices = NULL
static

◆ track_fingerid

SDL_FingerID track_fingerid
static

Definition at line 40 of file SDL_touch.c.

Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().

◆ track_touchid

SDL_TouchID track_touchid
static

Definition at line 41 of file SDL_touch.c.

Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().