Skip to content

Commit

Permalink
Merge pull request #103 from hwsmm/update-bindings
Browse files Browse the repository at this point in the history
Update bindings (no merging needed)
  • Loading branch information
smoogipoo authored Jul 31, 2024
2 parents 12d09ea + 1b1c590 commit 7455e1c
Show file tree
Hide file tree
Showing 38 changed files with 386 additions and 281 deletions.
48 changes: 17 additions & 31 deletions SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ 3. This notice may not be removed or altered from any source distribution.

namespace SDL
{
[NativeTypeName("int")]
public enum SDL_AudioFormat : uint
{
SDL_AUDIO_U8 = 0x0008U,
SDL_AUDIO_S8 = 0x8008U,
SDL_AUDIO_S16LE = 0x8010U,
SDL_AUDIO_S16BE = 0x9010U,
SDL_AUDIO_S32LE = 0x8020U,
SDL_AUDIO_S32BE = 0x9020U,
SDL_AUDIO_F32LE = 0x8120U,
SDL_AUDIO_F32BE = 0x9120U,
}

public partial struct SDL_AudioSpec
{
public SDL_AudioFormat format;
Expand Down Expand Up @@ -68,7 +81,6 @@ public static unsafe partial class SDL3
public static extern int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int* count);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
Expand Down Expand Up @@ -132,11 +144,9 @@ public static unsafe partial class SDL3
public static extern int SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamInputChannelMap(SDL_AudioStream* stream, int* count);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
Expand Down Expand Up @@ -205,30 +215,6 @@ public static unsafe partial class SDL3
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSilenceValueForFormat(SDL_AudioFormat format);

[NativeTypeName("#define SDL_AUDIO_U8 0x0008u")]
public const uint SDL_AUDIO_U8 = 0x0008U;

[NativeTypeName("#define SDL_AUDIO_S8 0x8008u")]
public const uint SDL_AUDIO_S8 = 0x8008U;

[NativeTypeName("#define SDL_AUDIO_S16LE 0x8010u")]
public const uint SDL_AUDIO_S16LE = 0x8010U;

[NativeTypeName("#define SDL_AUDIO_S16BE 0x9010u")]
public const uint SDL_AUDIO_S16BE = 0x9010U;

[NativeTypeName("#define SDL_AUDIO_S32LE 0x8020u")]
public const uint SDL_AUDIO_S32LE = 0x8020U;

[NativeTypeName("#define SDL_AUDIO_S32BE 0x9020u")]
public const uint SDL_AUDIO_S32BE = 0x9020U;

[NativeTypeName("#define SDL_AUDIO_F32LE 0x8120u")]
public const uint SDL_AUDIO_F32LE = 0x8120U;

[NativeTypeName("#define SDL_AUDIO_F32BE 0x9120u")]
public const uint SDL_AUDIO_F32BE = 0x9120U;

[NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFFu)")]
public const uint SDL_AUDIO_MASK_BITSIZE = (0xFFU);

Expand All @@ -241,10 +227,10 @@ public static unsafe partial class SDL3
[NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1u<<15)")]
public const uint SDL_AUDIO_MASK_SIGNED = (1U << 15);

[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK ((SDL_AudioDeviceID) 0xFFFFFFFF)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK = ((SDL_AudioDeviceID)(0xFFFFFFFF));
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK ((SDL_AudioDeviceID) 0xFFFFFFFFu)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK = ((SDL_AudioDeviceID)(0xFFFFFFFFU));

[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFE)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFE));
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFEu)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFEU));
}
}
6 changes: 6 additions & 0 deletions SDL3-CS/SDL3/ClangSharp/SDL_blendmode.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ public static partial class SDL3
[NativeTypeName("#define SDL_BLENDMODE_BLEND 0x00000001u")]
public const uint SDL_BLENDMODE_BLEND = 0x00000001U;

[NativeTypeName("#define SDL_BLENDMODE_BLEND_PREMULTIPLIED 0x00000010u")]
public const uint SDL_BLENDMODE_BLEND_PREMULTIPLIED = 0x00000010U;

[NativeTypeName("#define SDL_BLENDMODE_ADD 0x00000002u")]
public const uint SDL_BLENDMODE_ADD = 0x00000002U;

[NativeTypeName("#define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u")]
public const uint SDL_BLENDMODE_ADD_PREMULTIPLIED = 0x00000020U;

[NativeTypeName("#define SDL_BLENDMODE_MOD 0x00000004u")]
public const uint SDL_BLENDMODE_MOD = 0x00000004U;

Expand Down
14 changes: 7 additions & 7 deletions SDL3-CS/SDL3/ClangSharp/SDL_camera.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,26 @@ public static unsafe partial class SDL3
public static extern byte* Unsafe_SDL_GetCurrentCameraDriver();

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraDeviceID* SDL_GetCameraDevices(int* count);
public static extern SDL_CameraID* SDL_GetCameras(int* count);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraSpec* SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int* count);
public static extern SDL_CameraSpec** SDL_GetCameraSupportedFormats(SDL_CameraID devid, int* count);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCameraDeviceName", ExactSpelling = true)]
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCameraName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id);
public static extern byte* Unsafe_SDL_GetCameraName(SDL_CameraID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraPosition SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id);
public static extern SDL_CameraPosition SDL_GetCameraPosition(SDL_CameraID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Camera* SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, [NativeTypeName("const SDL_CameraSpec *")] SDL_CameraSpec* spec);
public static extern SDL_Camera* SDL_OpenCamera(SDL_CameraID instance_id, [NativeTypeName("const SDL_CameraSpec *")] SDL_CameraSpec* spec);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCameraPermissionState(SDL_Camera* camera);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraDeviceID SDL_GetCameraInstanceID(SDL_Camera* camera);
public static extern SDL_CameraID SDL_GetCameraID(SDL_Camera* camera);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera* camera);
Expand Down
15 changes: 9 additions & 6 deletions SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public enum SDL_EventType
SDL_EVENT_DISPLAY_ADDED,
SDL_EVENT_DISPLAY_REMOVED,
SDL_EVENT_DISPLAY_MOVED,
SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED,
SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED,
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION,
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
Expand All @@ -54,6 +56,7 @@ public enum SDL_EventType
SDL_EVENT_WINDOW_MOVED,
SDL_EVENT_WINDOW_RESIZED,
SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED,
SDL_EVENT_WINDOW_METAL_VIEW_RESIZED,
SDL_EVENT_WINDOW_MINIMIZED,
SDL_EVENT_WINDOW_MAXIMIZED,
SDL_EVENT_WINDOW_RESTORED,
Expand All @@ -66,6 +69,7 @@ public enum SDL_EventType
SDL_EVENT_WINDOW_ICCPROF_CHANGED,
SDL_EVENT_WINDOW_DISPLAY_CHANGED,
SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED,
SDL_EVENT_WINDOW_SAFE_AREA_CHANGED,
SDL_EVENT_WINDOW_OCCLUDED,
SDL_EVENT_WINDOW_ENTER_FULLSCREEN,
SDL_EVENT_WINDOW_LEAVE_FULLSCREEN,
Expand All @@ -74,7 +78,7 @@ public enum SDL_EventType
SDL_EVENT_WINDOW_PEN_LEAVE,
SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_PEN_LEAVE,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
SDL_EVENT_KEY_DOWN = 0x300,
SDL_EVENT_KEY_UP,
SDL_EVENT_TEXT_EDITING,
Expand Down Expand Up @@ -166,6 +170,9 @@ public partial struct SDL_DisplayEvent

[NativeTypeName("Sint32")]
public int data1;

[NativeTypeName("Sint32")]
public int data2;
}

public partial struct SDL_WindowEvent
Expand Down Expand Up @@ -685,7 +692,7 @@ public partial struct SDL_CameraDeviceEvent
[NativeTypeName("Uint64")]
public ulong timestamp;

public SDL_CameraDeviceID which;
public SDL_CameraID which;
}

public partial struct SDL_TouchFingerEvent
Expand Down Expand Up @@ -1103,10 +1110,6 @@ public static unsafe partial class SDL3
[return: NativeTypeName("Uint32")]
public static extern uint SDL_RegisterEvents(int numevents);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_AllocateEventMemory([NativeTypeName("size_t")] nuint size);

[NativeTypeName("#define SDL_RELEASED 0")]
public const int SDL_RELEASED = 0;

Expand Down
8 changes: 6 additions & 2 deletions SDL3-CS/SDL3/ClangSharp/SDL_filesystem.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public enum SDL_Folder
SDL_FOLDER_SCREENSHOTS,
SDL_FOLDER_TEMPLATES,
SDL_FOLDER_VIDEOS,
SDL_FOLDER_TOTAL,
}

public enum SDL_PathType
Expand Down Expand Up @@ -68,15 +69,15 @@ public partial struct SDL_PathInfo
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetBasePath", ExactSpelling = true)]
[return: NativeTypeName("char *")]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetBasePath();

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPrefPath", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetPrefPath([NativeTypeName("const char *")] byte* org, [NativeTypeName("const char *")] byte* app);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetUserFolder", ExactSpelling = true)]
[return: NativeTypeName("char *")]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetUserFolder(SDL_Folder folder);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
Expand All @@ -91,6 +92,9 @@ public static unsafe partial class SDL3
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CopyFile([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);

Expand Down
33 changes: 16 additions & 17 deletions SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static unsafe partial class SDL3

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadMappingForGUID", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetGamepadMappingForGUID([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid);
public static extern byte* Unsafe_SDL_GetGamepadMappingForGUID(SDL_GUID guid);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadMapping", ExactSpelling = true)]
[return: NativeTypeName("char *")]
Expand All @@ -215,48 +215,47 @@ public static unsafe partial class SDL3
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadInstanceName", ExactSpelling = true)]
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadNameForID", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
public static extern byte* Unsafe_SDL_GetGamepadNameForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadInstancePath", ExactSpelling = true)]
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadPathForID", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
public static extern byte* Unsafe_SDL_GetGamepadPathForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
public static extern int SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_JoystickGUID")]
public static extern SDL_GUID SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
public static extern SDL_GUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint16")]
public static extern ushort SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
public static extern ushort SDL_GetGamepadVendorForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint16")]
public static extern ushort SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
public static extern ushort SDL_GetGamepadProductForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint16")]
public static extern ushort SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
public static extern ushort SDL_GetGamepadProductVersionForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GamepadType SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
public static extern SDL_GamepadType SDL_GetGamepadTypeForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GamepadType SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id);
public static extern SDL_GamepadType SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadInstanceMapping", ExactSpelling = true)]
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadMappingForID", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
public static extern byte* Unsafe_SDL_GetGamepadMappingForID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Gamepad* SDL_OpenGamepad(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Gamepad* SDL_GetGamepadFromInstanceID(SDL_JoystickID instance_id);
public static extern SDL_Gamepad* SDL_GetGamepadFromID(SDL_JoystickID instance_id);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Gamepad* SDL_GetGamepadFromPlayerIndex(int player_index);
Expand All @@ -265,7 +264,7 @@ public static unsafe partial class SDL3
public static extern SDL_PropertiesID SDL_GetGamepadProperties(SDL_Gamepad* gamepad);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID SDL_GetGamepadInstanceID(SDL_Gamepad* gamepad);
public static extern SDL_JoystickID SDL_GetGamepadID(SDL_Gamepad* gamepad);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
Expand Down
4 changes: 2 additions & 2 deletions SDL3-CS/SDL3/ClangSharp/SDL_guid.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public partial struct _data_e__FixedBuffer
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] byte* pszGUID, int cbGUID);
public static extern void SDL_GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] byte* pszGUID, int cbGUID);

[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GUID SDL_GUIDFromString([NativeTypeName("const char *")] byte* pchGUID);
public static extern SDL_GUID SDL_StringToGUID([NativeTypeName("const char *")] byte* pchGUID);
}
}
Loading

0 comments on commit 7455e1c

Please sign in to comment.