Skip to content

Commit

Permalink
Merge pull request #47 from Susko3/update-bindings
Browse files Browse the repository at this point in the history
Update SDL3 bindings
  • Loading branch information
smoogipoo authored Apr 17, 2024
2 parents 7b24554 + d35c803 commit 2e09656
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
9 changes: 0 additions & 9 deletions SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,15 +662,6 @@ public partial struct SDL_CameraDeviceEvent
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
Expand Down
3 changes: 0 additions & 3 deletions SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,5 @@ public static unsafe partial class SDL3

[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;
}
}
5 changes: 1 addition & 4 deletions SDL3-CS/SDL3/ClangSharp/SDL_touch.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public static unsafe partial class SDL3
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);
}
}
8 changes: 8 additions & 0 deletions SDL3-CS/SDL3/SDL_touch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,13 @@ public static partial class SDL3
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);
}
}
}

0 comments on commit 2e09656

Please sign in to comment.