Merge pull request #47 from Susko3/update-bindings

Update SDL3 bindings
This commit is contained in:
Dan Balasescu 2024-04-18 01:43:05 +09:00 committed by GitHub
commit 2e0965609a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 16 deletions

View File

@ -662,15 +662,6 @@ namespace SDL
public ulong timestamp;
public SDL_CameraDeviceID which;
[NativeTypeName("Uint8")]
public byte padding1;
[NativeTypeName("Uint8")]
public byte padding2;
[NativeTypeName("Uint8")]
public byte padding3;
}
public partial struct SDL_TouchFingerEvent

View File

@ -109,8 +109,5 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction")] delegate* unmanaged[Cdecl]<IntPtr, SDL_LogCategory, SDL_LogPriority, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[NativeTypeName("#define SDL_MAX_LOG_MESSAGE 4096")]
public const int SDL_MAX_LOG_MESSAGE = 4096;
}
}

View File

@ -59,9 +59,6 @@ namespace SDL
public static extern SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetNumTouchFingers(SDL_TouchID touchID);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Finger* SDL_GetTouchFinger(SDL_TouchID touchID, int index);
public static extern SDL_Finger** SDL_GetTouchFingers(SDL_TouchID touchID, int* count);
}
}

View File

@ -27,5 +27,13 @@ namespace SDL
var array = SDL_GetTouchDevices(&count);
return SDLArray.Create(array, count);
}
[MustDisposeResource]
public static unsafe SDLPointerArray<SDL_Finger>? SDL_GetTouchFingers(SDL_TouchID touchID)
{
int count;
var array = SDL_GetTouchFingers(touchID, &count);
return SDLArray.Create(array, count);
}
}
}