Bind touch API. Use frameworks on OS X

This commit is contained in:
Jameson Ernst 2013-10-28 13:09:42 -07:00
parent 5b575f02a0
commit b5762af567
2 changed files with 48 additions and 5 deletions

View file

@ -1,22 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<dllmap dll="SDL2.dll" os="windows" target="SDL2.dll"/>
<dllmap dll="SDL2.dll" os="osx" target="libSDL2-2.0.0.dylib"/>
<dllmap dll="SDL2.dll" os="osx" target="SDL2.framework/SDL2"/>
<dllmap dll="SDL2.dll" os="linux" target="libSDL2-2.0.so.0"/>
<dllmap dll="SDL2_image.dll" os="windows" target="SDL2_image.dll"/>
<dllmap dll="SDL2_image.dll" os="osx" target="libSDL2_image-2.0.0.dylib"/>
<dllmap dll="SDL2_image.dll" os="osx" target="SDL2_image.framework/SDL2_image"/>
<dllmap dll="SDL2_image.dll" os="linux" target="libSDL2_image-2.0.so.0"/>
<dllmap dll="SDL2_mixer.dll" os="windows" target="SDL2_mixer.dll"/>
<dllmap dll="SDL2_mixer.dll" os="osx" target="libSDL2_mixer-2.0.0.dylib"/>
<dllmap dll="SDL2_mixer.dll" os="osx" target="SDL2_mixer.framework/SDL2_mixer"/>
<dllmap dll="SDL2_mixer.dll" os="linux" target="libSDL2_mixer-2.0.so.0"/>
<dllmap dll="SDL2_ttf.dll" os="windows" target="SDL2_ttf.dll"/>
<dllmap dll="SDL2_ttf.dll" os="osx" target="libSDL2_ttf-2.0.0.dylib"/>
<dllmap dll="SDL2_ttf.dll" os="osx" target="SDL2_ttf.framework/SDL_ttf"/>
<dllmap dll="SDL2_ttf.dll" os="linux" target="libSDL2_ttf-2.0.so.0"/>
<dllmap dll="opengl32.dll" os="windows" target="opengl32.dll"/>
<dllmap dll="opengl32.dll" os="osx" target="OpenGL.framework/OpenGL"/>
<dllmap dll="opengl32.dll" os="linux" target="libGL.so.1"/>
<dllmap dll="openal32.dll" os="windows" target="openal32.dll"/>
<dllmap dll="openal32.dll" os="osx" target="libopenal.1.dylib"/>
<dllmap dll="openal32.dll" os="osx" target="OpenAL.framework/OpenAL"/>
<dllmap dll="openal32.dll" os="linux" target="libopenal.so.1"/>
</configuration>

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;