Merge pull request #46 from jameson-ernst/master

Bind touch API
pull/47/head
Ethan Lee 2013-10-29 03:00:02 -07:00
commit 70af91f844
1 changed files with 39 additions and 0 deletions

View File

@ -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;