Go to the source code of this file.
|
int | SDL_TouchInit (void) |
|
int | SDL_AddTouch (SDL_TouchID id, const char *name) |
|
SDL_Touch * | SDL_GetTouch (SDL_TouchID id) |
|
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) |
|
◆ SDL_AddTouch()
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 int SDL_GetTouchIndex(SDL_TouchID id)
int SDL_GestureAddTouch(SDL_TouchID touchId)
#define SDL_OutOfMemory()
static SDL_Touch ** SDL_touchDevices
◆ SDL_DelTouch()
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().
int SDL_GestureDelTouch(SDL_TouchID touchId)
static int SDL_GetTouchIndex(SDL_TouchID id)
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)
static SDL_Touch ** SDL_touchDevices
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
◆ SDL_GetTouch()
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().
79 SDL_SetError(
"Unknown touch id %d, resetting", (
int)
id);
82 SDL_SetError(
"Unknown touch device id %d, cannot reset", (
int)
id);
static int SDL_GetTouchIndex(SDL_TouchID id)
void(* ResetTouch)(_THIS)
SDL_VideoDevice * SDL_GetVideoDevice(void)
static SDL_Touch ** SDL_touchDevices
◆ SDL_SendTouch()
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().
248 event.tfinger.touchId =
id;
249 event.tfinger.fingerId = fingerid;
252 event.tfinger.dx = 0;
253 event.tfinger.dy = 0;
254 event.tfinger.pressure = pressure;
267 event.tfinger.touchId =
id;
268 event.tfinger.fingerId = fingerid;
270 event.tfinger.x = finger->
x;
271 event.tfinger.y = finger->
y;
272 event.tfinger.dx = 0;
273 event.tfinger.dy = 0;
274 event.tfinger.pressure = pressure;
GLint GLint GLint GLint GLint x
static int SDL_DelFinger(SDL_Touch *touch, SDL_FingerID fingerid)
static SDL_Finger * SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id)
#define SDL_GetEventState(type)
static int SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure)
GLint GLint GLint GLint GLint GLint y
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
◆ SDL_SendTouchMotion()
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.
290 float xrel, yrel, prel;
302 xrel =
x - finger->
x;
303 yrel =
y - finger->
y;
307 if (!xrel && !yrel && !prel) {
309 printf(
"Touch event didn't change state - dropped!\n");
324 event.tfinger.touchId =
id;
325 event.tfinger.fingerId = fingerid;
328 event.tfinger.dx = xrel;
329 event.tfinger.dy = yrel;
330 event.tfinger.pressure = pressure;
GLint GLint GLint GLint GLint x
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, float x, float y, float pressure)
static SDL_Finger * SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id)
#define SDL_GetEventState(type)
GLint GLint GLint GLint GLint GLint y
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
◆ SDL_TouchInit()
int SDL_TouchInit |
( |
void |
| ) |
|
◆ SDL_TouchQuit()
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().
void SDL_DelTouch(SDL_TouchID id)
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)
#define SDL_assert(condition)
static SDL_Touch ** SDL_touchDevices