diff --git a/src/SDL2.cs b/src/SDL2.cs index 103397b..434d1ed 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -4338,6 +4338,45 @@ namespace SDL2 #endregion + #region SDL_touch.h + + public const uint SDL_TOUCH_MOUSEID = uint.MaxValue; + + public struct SDL_Finger + { + public long id; // SDL_FingerID + public float x; + public float y; + public float pressure; + } + + /** + * \brief Get the number of registered touch devices. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_GetNumTouchDevices(); + + /** + * \brief Get the touch ID with the given index, or 0 if the index is invalid. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern long SDL_GetTouchDevice(int index); + + /** + * \brief Get the number of active fingers for a given touch device. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_GetNumTouchFingers(long touchID); + + /** + * \brief Get the finger object of the given touch, with the given index. + * Returns pointer to SDL_Finger. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr SDL_GetTouchFinger(long touchID, int index); + + #endregion + #region SDL_joystick.h public const byte SDL_HAT_CENTERED = 0x00;