SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_assert.h"
#include "SDL_events.h"
#include "SDL_events_c.h"
#include "../video/SDL_sysvideo.h"
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) |
static 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 |
|
static |
Definition at line 178 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().
int SDL_AddTouch | ( | SDL_TouchID | touchID, |
const char * | name | ||
) |
Definition at line 136 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.
|
static |
Definition at line 205 of file SDL_touch.c.
References SDL_Touch::fingers, SDL_Touch::num_fingers, and SDL_GetFingerIndex().
Referenced by SDL_SendTouch().
void SDL_DelTouch | ( | SDL_TouchID | id | ) |
Definition at line 337 of file SDL_touch.c.
References SDL_Touch::fingers, i, SDL_Touch::max_fingers, SDL_free, SDL_GestureDelTouch(), SDL_GetTouch(), SDL_GetTouchIndex(), and SDL_num_touch.
Referenced by SDL_TouchQuit().
|
static |
Definition at line 102 of file SDL_touch.c.
References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, and SDL_GetFingerIndex().
Referenced by SDL_SendTouch(), and SDL_SendTouchMotion().
|
static |
Definition at line 90 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 SDL_GetNumTouchDevices | ( | void | ) |
Get the number of registered touch devices.
Definition at line 43 of file SDL_touch.c.
References SDL_num_touch.
int SDL_GetNumTouchFingers | ( | SDL_TouchID | touchID | ) |
Get the number of active fingers for a given touch device.
Definition at line 112 of file SDL_touch.c.
References SDL_Touch::num_fingers, and SDL_GetTouch().
SDL_Touch* SDL_GetTouch | ( | SDL_TouchID | id | ) |
Definition at line 74 of file SDL_touch.c.
References NULL, SDL_VideoDevice::ResetTouch, SDL_GetTouchIndex(), SDL_GetVideoDevice(), SDL_num_touch, and SDL_SetError.
Referenced by SDL_DelTouch(), SDL_GetNumTouchFingers(), SDL_GetTouchFinger(), SDL_SendTouch(), and SDL_SendTouchMotion().
SDL_TouchID SDL_GetTouchDevice | ( | int | index | ) |
Get the touch ID with the given index, or 0 if the index is invalid.
Definition at line 49 of file SDL_touch.c.
References SDL_Touch::id, SDL_num_touch, and SDL_SetError.
SDL_Finger* SDL_GetTouchFinger | ( | SDL_TouchID | touchID, |
int | index | ||
) |
Get the finger object of the given touch, with the given index.
Definition at line 122 of file SDL_touch.c.
References SDL_Touch::fingers, NULL, SDL_Touch::num_fingers, SDL_GetTouch(), and SDL_SetError.
|
static |
Definition at line 59 of file SDL_touch.c.
References SDL_Touch::id, and SDL_num_touch.
Referenced by SDL_AddTouch(), SDL_DelTouch(), and SDL_GetTouch().
int SDL_SendTouch | ( | SDL_TouchID | id, |
SDL_FingerID | fingerid, | ||
SDL_bool | down, | ||
float | x, | ||
float | y, | ||
float | pressure | ||
) |
Definition at line 222 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 SDL_SendTouchMotion | ( | SDL_TouchID | id, |
SDL_FingerID | fingerid, | ||
float | x, | ||
float | y, | ||
float | pressure | ||
) |
Definition at line 284 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.
int SDL_TouchInit | ( | void | ) |
Definition at line 361 of file SDL_touch.c.
References i, NULL, SDL_assert, SDL_DelTouch(), SDL_free, SDL_GestureQuit(), and SDL_num_touch.
Referenced by SDL_VideoQuit().
|
static |
Definition at line 31 of file SDL_touch.c.
Referenced by SDL_AddTouch(), SDL_DelTouch(), SDL_GetNumTouchDevices(), SDL_GetTouch(), SDL_GetTouchDevice(), SDL_GetTouchIndex(), and SDL_TouchQuit().
Definition at line 32 of file SDL_touch.c.