mirror of
https://github.com/encounter/SDL.git
synced 2025-12-16 08:27:05 +00:00
Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates). Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
This commit is contained in:
@@ -72,7 +72,7 @@ void Android_InitTouch(void)
|
||||
|
||||
if (0 < number) {
|
||||
for (i = 0; i < number; ++i) {
|
||||
SDL_AddTouch((SDL_TouchID) ids[i], ""); /* no error handling */
|
||||
SDL_AddTouch((SDL_TouchID) ids[i], SDL_TOUCH_DEVICE_DIRECT, ""); /* no error handling */
|
||||
}
|
||||
SDL_free(ids);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int actio
|
||||
}
|
||||
|
||||
touchDeviceId = (SDL_TouchID)touch_device_id_in;
|
||||
if (SDL_AddTouch(touchDeviceId, "") < 0) {
|
||||
if (SDL_AddTouch(touchDeviceId, SDL_TOUCH_DEVICE_DIRECT, "") < 0) {
|
||||
SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user