Skip to content

Commit

Permalink
Adjust for lang version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
M. P. Halpin authored and M. P. Halpin committed Oct 16, 2024
1 parent c9485a5 commit ca55f2c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/FNAPlatform/SDL3_FNAPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,8 @@ public static TouchPanelCapabilities GetTouchCapabilities()
public static unsafe void UpdateTouchPanelState()
{
// Poll the touch device for all active fingers
IntPtr fingerArray = SDL.SDL_GetTouchFingers(GetTouchDeviceId(0), out int fingers);
int fingers;
IntPtr fingerArray = SDL.SDL_GetTouchFingers(GetTouchDeviceId(0), out fingers);

for (int i = 0; i < TouchPanel.MAX_TOUCHES; i += 1)
{
Expand Down Expand Up @@ -2236,13 +2237,15 @@ public static unsafe void UpdateTouchPanelState()

public static int GetNumTouchFingers()
{
SDL.SDL_free(SDL.SDL_GetTouchFingers(GetTouchDeviceId(0), out int fingers));
int fingers;
SDL.SDL_free(SDL.SDL_GetTouchFingers(GetTouchDeviceId(0), out fingers));
return fingers;
}

private static unsafe ulong GetTouchDeviceId(int index)
{
IntPtr touchDeviceIDs = SDL.SDL_GetTouchDevices(out int touchDeviceCount);
int touchDeviceCount;
IntPtr touchDeviceIDs = SDL.SDL_GetTouchDevices(out touchDeviceCount);
ulong result = index >= 0 && index < touchDeviceCount ? ((ulong*) touchDeviceIDs)[index] : 0;
SDL.SDL_free(touchDeviceIDs);
return result;
Expand Down

0 comments on commit ca55f2c

Please sign in to comment.