diff --git a/SDL3/README/migration.md b/SDL3/README/migration.md index 4d5590e50..38a739988 100644 --- a/SDL3/README/migration.md +++ b/SDL3/README/migration.md @@ -1631,15 +1631,19 @@ If you were using this macro for other things besides SDL ticks values, you can ## SDL_touch.h -SDL_GetNumTouchFingers() returns a negative error code if there was an error. - SDL_GetTouchName is replaced with SDL_GetTouchDeviceName(), which takes an SDL_TouchID instead of an index. SDL_TouchID and SDL_FingerID are now Uint64 with 0 being an invalid value. +Rather than iterating over touch devices using an index, there is a new function SDL_GetTouchDevices() to get the available devices. + +Rather than iterating over touch fingers using an index, there is a new function SDL_GetTouchFingers() to get the current set of active fingers. + The following functions have been removed: * SDL_GetNumTouchDevices() - replaced with SDL_GetTouchDevices() +* SDL_GetNumTouchFingers() - replaced with SDL_GetTouchFingers() * SDL_GetTouchDevice() - replaced with SDL_GetTouchDevices() +* SDL_GetTouchFinger() - replaced with SDL_GetTouchFingers() ## SDL_version.h diff --git a/SDL3/SDL_GetTouchFingers.md b/SDL3/SDL_GetTouchFingers.md new file mode 100644 index 000000000..ee1c75203 --- /dev/null +++ b/SDL3/SDL_GetTouchFingers.md @@ -0,0 +1,36 @@ +###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) +# SDL_GetTouchFingers + +Get a list of active fingers for a given touch device. + +## Header File + +Defined in [SDL_touch.h](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_touch.h), but apps should use `#include ` + +## Syntax + +```c +extern DECLSPEC SDL_Finger **SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count); + +``` + +## Function Parameters + +| | | +| --------------- | --------------------------------------------------------------------- | +| **touchID** | the ID of a touch device | +| **count** | a pointer filled in with the number of fingers returned, can be NULL. | + +## Return Value + +Returns a NULL terminated array of [SDL_Finger](SDL_Finger) pointers which +should be freed with [SDL_free](SDL_free)(), or NULL on error; call +[SDL_GetError](SDL_GetError)() for more details. + +## Version + +This function is available since SDL 3.0.0. + +---- +[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction) +