SDL_touch.c File Reference
`#include "../SDL_internal.h"`
`#include "SDL_assert.h"`
`#include "SDL_events.h"`
`#include "SDL_events_c.h"`
Include dependency graph for SDL_touch.c:

Go to the source code of this file.

## 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_Touch * | SDL_GetTouch (SDL_TouchID id)
static int | SDL_GetFingerIndex (const SDL_Touch *touch, SDL_FingerID fingerid)
SDL_Finger * | SDL_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_Finger * | SDL_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, 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

## Function Documentation

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

static

Definition at line 172 of file SDL_touch.c.

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_Finger *finger;
if (touch->num_fingers == touch->max_fingers) {
SDL_Finger **new_fingers;
new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers));
if (!new_fingers) {
return SDL_OutOfMemory();
}
touch->fingers = new_fingers;
touch->fingers[touch->max_fingers] = (SDL_Finger *)SDL_malloc(sizeof(*finger));
if (!touch->fingers[touch->max_fingers]) {
return SDL_OutOfMemory();
}
touch->max_fingers++;
}
finger = touch->fingers[touch->num_fingers++];
finger->id = fingerid;
finger->x = x;
finger->y = y;
finger->pressure = pressure;
return 0;
}
SDL_Touch::max_fingers
int max_fingers
Definition: SDL_touch_c.h:31
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
SDL_realloc
#define SDL_realloc
Definition: SDL_dynapi_overrides.h:382
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
SDL_Finger::y
float y
Definition: SDL_touch.h:48
SDL_Finger
Definition: SDL_touch.h:44
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_Finger::id
SDL_FingerID id
Definition: SDL_touch.h:46
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:380
SDL_Finger::pressure
float pressure
Definition: SDL_touch.h:49
SDL_Finger::x
float x
Definition: SDL_touch.h:47

int SDL_AddTouch | ( | SDL_TouchID | touchID,
|  | const char * | name
| ) |  |

Definition at line 130 of file SDL_touch.c.

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, and SDL_realloc.

{
SDL_Touch **touchDevices;
int index;
index = SDL_GetTouchIndex(touchID);
if (index >= 0) {
return index;
}
/* Add the touch to the list of touch */
touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices,
(SDL_num_touch + 1) * sizeof(*touchDevices));
if (!touchDevices) {
return SDL_OutOfMemory();
}
SDL_touchDevices = touchDevices;
index = SDL_num_touch;
SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index]));
if (!SDL_touchDevices[index]) {
return SDL_OutOfMemory();
}
/* Added touch to list */
++SDL_num_touch;
/* we're setting the touch properties */
SDL_touchDevices[index]->id = touchID;
SDL_touchDevices[index]->num_fingers = 0;
SDL_touchDevices[index]->max_fingers = 0;
SDL_touchDevices[index]->fingers = NULL;
/* Record this touch device for gestures */
/* We could do this on the fly in the gesture code if we wanted */
SDL_GestureAddTouch(touchID);
return index;
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_Touch::max_fingers
int max_fingers
Definition: SDL_touch_c.h:31
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
SDL_realloc
#define SDL_realloc
Definition: SDL_dynapi_overrides.h:382
SDL_Touch::id
SDL_TouchID id
Definition: SDL_touch_c.h:29
SDL_GetTouchIndex
static int SDL_GetTouchIndex(SDL_TouchID id)
Definition: SDL_touch.c:58
SDL_GestureAddTouch
int SDL_GestureAddTouch(SDL_TouchID touchId)
Definition: SDL_gesture.c:442
index
GLuint index
Definition: SDL_opengl_glext.h:660
NULL
#define NULL
Definition: begin_code.h:143
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:380
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31

static int SDL_DelFinger | ( | SDL_Touch * | touch,
|  | SDL_FingerID | fingerid
| ) |  |

static

Definition at line 199 of file SDL_touch.c.

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

Referenced by SDL_SendTouch().

{
SDL_Finger *temp;
int index = SDL_GetFingerIndex(touch, fingerid);
if (index < 0) {
return -1;
}
touch->num_fingers--;
temp = touch->fingers[index];
touch->fingers[index] = touch->fingers[touch->num_fingers];
touch->fingers[touch->num_fingers] = temp;
return 0;
}
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
index
GLuint index
Definition: SDL_opengl_glext.h:660
SDL_Finger
Definition: SDL_touch.h:44
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_GetFingerIndex
static int SDL_GetFingerIndex(const SDL_Touch *touch, SDL_FingerID fingerid)
Definition: SDL_touch.c:84

void SDL_DelTouch | ( | SDL_TouchID | id | ) |

Definition at line 331 of file SDL_touch.c.

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

Referenced by SDL_TouchQuit().

{
int i;
int index = SDL_GetTouchIndex(id);
SDL_Touch *touch = SDL_GetTouch(id);
if (!touch) {
return;
}
for (i = 0; i < touch->max_fingers; ++i) {
SDL_free(touch->fingers[i]);
}
SDL_free(touch->fingers);
SDL_free(touch);
SDL_num_touch--;
SDL_touchDevices[index] = SDL_touchDevices[SDL_num_touch];
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_Touch::max_fingers
int max_fingers
Definition: SDL_touch_c.h:31
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
SDL_GetTouchIndex
static int SDL_GetTouchIndex(SDL_TouchID id)
Definition: SDL_touch.c:58
SDL_free
void SDL_free(void *mem)
index
GLuint index
Definition: SDL_opengl_glext.h:660
i
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:42
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31
SDL_GetTouch
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:73

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

Definition at line 96 of file SDL_touch.c.

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

Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().

{
int index = SDL_GetFingerIndex(touch, id);
if (index < 0 || index >= touch->num_fingers) {
return NULL;
}
return touch->fingers[index];
}
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
index
GLuint index
Definition: SDL_opengl_glext.h:660
NULL
#define NULL
Definition: begin_code.h:143
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_GetFingerIndex
static int SDL_GetFingerIndex(const SDL_Touch *touch, SDL_FingerID fingerid)
Definition: SDL_touch.c:84

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

static

Definition at line 84 of file SDL_touch.c.

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

Referenced by SDL_DelFinger(), and SDL_GetFinger().

{
int index;
for (index = 0; index < touch->num_fingers; ++index) {
if (touch->fingers[index]->id == fingerid) {
return index;
}
}
return -1;
}
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
index
GLuint index
Definition: SDL_opengl_glext.h:660
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_Finger::id
SDL_FingerID id
Definition: SDL_touch.h:46

int SDL_GetNumTouchDevices | ( | void |  | ) |

Get the number of registered touch devices.

Definition at line 42 of file SDL_touch.c.

References SDL_num_touch.

{
return SDL_num_touch;
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30

int SDL_GetNumTouchFingers | ( | SDL_TouchID | touchID | ) |

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

Definition at line 106 of file SDL_touch.c.

References SDL_Touch::num_fingers, and SDL_GetTouch().

{
SDL_Touch *touch = SDL_GetTouch(touchID);
if (touch) {
return touch->num_fingers;
}
return 0;
}
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_GetTouch
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:73

SDL_Touch* SDL_GetTouch | ( | SDL_TouchID | id | ) |

Definition at line 73 of file SDL_touch.c.

References NULL, SDL_GetTouchIndex(), SDL_num_touch, and SDL_SetError.

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

{
int index = SDL_GetTouchIndex(id);
if (index < 0 || index >= SDL_num_touch) {
SDL_SetError("Unknown touch device");
return NULL;
}
return SDL_touchDevices[index];
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_GetTouchIndex
static int SDL_GetTouchIndex(SDL_TouchID id)
Definition: SDL_touch.c:58
index
GLuint index
Definition: SDL_opengl_glext.h:660
NULL
#define NULL
Definition: begin_code.h:143
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:36
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31

SDL_TouchID SDL_GetTouchDevice | ( | int | index | ) |

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

Definition at line 48 of file SDL_touch.c.

References SDL_Touch::id, SDL_num_touch, and SDL_SetError.

{
if (index < 0 || index >= SDL_num_touch) {
SDL_SetError("Unknown touch device");
return 0;
}
return SDL_touchDevices[index]->id;
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_Touch::id
SDL_TouchID id
Definition: SDL_touch_c.h:29
index
GLuint index
Definition: SDL_opengl_glext.h:660
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:36
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31

SDL_Finger* SDL_GetTouchFinger | ( | SDL_TouchID | touchID,
|  | int | index
| ) |  |

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

Definition at line 116 of file SDL_touch.c.

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

{
SDL_Touch *touch = SDL_GetTouch(touchID);
if (!touch) {
return NULL;
}
if (index < 0 || index >= touch->num_fingers) {
SDL_SetError("Unknown touch finger");
return NULL;
}
return touch->fingers[index];
}
SDL_Touch::fingers
SDL_Finger ** fingers
Definition: SDL_touch_c.h:32
index
GLuint index
Definition: SDL_opengl_glext.h:660
NULL
#define NULL
Definition: begin_code.h:143
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:36
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_Touch::num_fingers
int num_fingers
Definition: SDL_touch_c.h:30
SDL_GetTouch
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:73

static int SDL_GetTouchIndex | ( | SDL_TouchID | id | ) |

static

Definition at line 58 of file SDL_touch.c.

References SDL_Touch::id, and SDL_num_touch.

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

{
int index;
SDL_Touch *touch;
for (index = 0; index < SDL_num_touch; ++index) {
touch = SDL_touchDevices[index];
if (touch->id == id) {
return index;
}
}
return -1;
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_Touch::id
SDL_TouchID id
Definition: SDL_touch_c.h:29
index
GLuint index
Definition: SDL_opengl_glext.h:660
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31

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

Definition at line 216 of file SDL_touch.c.

References SDL_AddFinger(), SDL_DelFinger(), SDL_ENABLE, SDL_FINGERDOWN, SDL_FINGERUP, SDL_GetEventState, SDL_GetFinger(), SDL_GetTouch(), SDL_PushEvent, SDL_Finger::x, and SDL_Finger::y.

Referenced by SDL_SendTouchMotion().

{
int posted;
SDL_Finger *finger;
SDL_Touch* touch = SDL_GetTouch(id);
if (!touch) {
return -1;
}
finger = SDL_GetFinger(touch, fingerid);
if (down) {
if (finger) {
/* This finger is already down */
return 0;
}
if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) {
return 0;
}
posted = 0;
if (SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
SDL_Event event;
event.tfinger.type = SDL_FINGERDOWN;
event.tfinger.touchId = id;
event.tfinger.fingerId = fingerid;
event.tfinger.x = x;
event.tfinger.y = y;
event.tfinger.dx = 0;
event.tfinger.dy = 0;
event.tfinger.pressure = pressure;
posted = (SDL_PushEvent(&event) > 0);
}
} else {
if (!finger) {
/* This finger is already up */
return 0;
}
posted = 0;
if (SDL_GetEventState(SDL_FINGERUP) == SDL_ENABLE) {
SDL_Event event;
event.tfinger.type = SDL_FINGERUP;
event.tfinger.touchId = id;
event.tfinger.fingerId = fingerid;
/* I don't trust the coordinates passed on fingerUp */
event.tfinger.x = finger->x;
event.tfinger.y = finger->y;
event.tfinger.dx = 0;
event.tfinger.dy = 0;
event.tfinger.pressure = pressure;
posted = (SDL_PushEvent(&event) > 0);
}
SDL_DelFinger(touch, fingerid);
}
return posted;
}
id
GLuint id
Definition: SDL_opengl_glext.h:528
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
SDL_DelFinger
static int SDL_DelFinger(SDL_Touch *touch, SDL_FingerID fingerid)
Definition: SDL_touch.c:199
SDL_ENABLE
#define SDL_ENABLE
Definition: SDL_events.h:718
SDL_GetFinger
SDL_Finger * SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id)
Definition: SDL_touch.c:96
SDL_FINGERDOWN
Definition: SDL_events.h:125
SDL_GetEventState
#define SDL_GetEventState(type)
Definition: SDL_events.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
event
struct _cl_event * event
Definition: SDL_opengl_glext.h:2649
SDL_PushEvent
#define SDL_PushEvent
Definition: SDL_dynapi_overrides.h:131
SDL_AddFinger
static int SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure)
Definition: SDL_touch.c:172
SDL_Finger::y
float y
Definition: SDL_touch.h:48
SDL_Finger
Definition: SDL_touch.h:44
SDL_FINGERUP
Definition: SDL_events.h:126
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_Event
General event structure.
Definition: SDL_events.h:521
SDL_GetTouch
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:73
SDL_Finger::x
float x
Definition: SDL_touch.h:47

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

Definition at line 278 of file SDL_touch.c.

References SDL_Finger::pressure, SDL_ENABLE, SDL_FINGERMOTION, SDL_GetEventState, SDL_GetFinger(), SDL_GetTouch(), SDL_PushEvent, SDL_SendTouch(), SDL_TRUE, SDL_Finger::x, and SDL_Finger::y.

{
SDL_Touch *touch;
SDL_Finger *finger;
int posted;
float xrel, yrel, prel;
touch = SDL_GetTouch(id);
if (!touch) {
return -1;
}
finger = SDL_GetFinger(touch,fingerid);
if (!finger) {
return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure);
}
xrel = x - finger->x;
yrel = y - finger->y;
prel = pressure - finger->pressure;
/* Drop events that don't change state */
if (!xrel && !yrel && !prel) {
#if 0
printf("Touch event didn't change state - dropped!\n");
#endif
return 0;
}
/* Update internal touch coordinates */
finger->x = x;
finger->y = y;
finger->pressure = pressure;
/* Post the event, if desired */
posted = 0;
if (SDL_GetEventState(SDL_FINGERMOTION) == SDL_ENABLE) {
SDL_Event event;
event.tfinger.type = SDL_FINGERMOTION;
event.tfinger.touchId = id;
event.tfinger.fingerId = fingerid;
event.tfinger.x = x;
event.tfinger.y = y;
event.tfinger.dx = xrel;
event.tfinger.dy = yrel;
event.tfinger.pressure = pressure;
posted = (SDL_PushEvent(&event) > 0);
}
return posted;
}
id
GLuint id
Definition: SDL_opengl_glext.h:528
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
SDL_SendTouch
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, float x, float y, float pressure)
Definition: SDL_touch.c:216
SDL_ENABLE
#define SDL_ENABLE
Definition: SDL_events.h:718
SDL_GetFinger
SDL_Finger * SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id)
Definition: SDL_touch.c:96
SDL_GetEventState
#define SDL_GetEventState(type)
Definition: SDL_events.h:731
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
event
struct _cl_event * event
Definition: SDL_opengl_glext.h:2649
SDL_PushEvent
#define SDL_PushEvent
Definition: SDL_dynapi_overrides.h:131
SDL_TRUE
Definition: SDL_stdinc.h:129
SDL_FINGERMOTION
Definition: SDL_events.h:127
SDL_Finger::y
float y
Definition: SDL_touch.h:48
SDL_Finger
Definition: SDL_touch.h:44
SDL_Touch
Definition: SDL_touch_c.h:27
SDL_Event
General event structure.
Definition: SDL_events.h:521
SDL_Finger::pressure
float pressure
Definition: SDL_touch.h:49
SDL_GetTouch
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
Definition: SDL_touch.c:73
SDL_Finger::x
float x
Definition: SDL_touch.h:47

int SDL_TouchInit | ( | void |  | ) |

Definition at line 36 of file SDL_touch.c.

Referenced by SDL_VideoInit().

{
return (0);
}

void SDL_TouchQuit | ( | void |  | ) |

Definition at line 352 of file SDL_touch.c.

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

Referenced by SDL_VideoQuit().

{
int i;
for (i = SDL_num_touch; i--; ) {
SDL_DelTouch(SDL_touchDevices[i]->id);
}
SDL_assert(SDL_num_touch == 0);
SDL_free(SDL_touchDevices);
SDL_touchDevices = NULL;
}
SDL_num_touch
static int SDL_num_touch
Definition: SDL_touch.c:30
SDL_free
void SDL_free(void *mem)
SDL_DelTouch
void SDL_DelTouch(SDL_TouchID id)
Definition: SDL_touch.c:331
i
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:42
SDL_assert
#define SDL_assert(condition)
Definition: SDL_assert.h:167
NULL
#define NULL
Definition: begin_code.h:143
SDL_touchDevices
static SDL_Touch ** SDL_touchDevices
Definition: SDL_touch.c:31

## Variable Documentation

int SDL_num_touch = 0

static

Definition at line 30 of file SDL_touch.c.

Referenced by SDL_AddTouch(), SDL_DelTouch(), SDL_GetNumTouchDevices(), SDL_GetTouch(), SDL_GetTouchDevice(), SDL_GetTouchIndex(), and SDL_TouchQuit().

SDL_Touch** SDL_touchDevices = NULL

static

Definition at line 31 of file SDL_touch.c.