diff --git a/SDL3-CS.Tests/MainCallbacksTest.cs b/SDL3-CS.Tests/MainCallbacksTest.cs index 246cf5c..34dc62f 100644 --- a/SDL3-CS.Tests/MainCallbacksTest.cs +++ b/SDL3-CS.Tests/MainCallbacksTest.cs @@ -22,24 +22,20 @@ namespace SDL.Tests SDL3.SDL_EnterAppMainCallbacks(0, (byte**)objectHandle.Handle, &AppInit, &AppIterate, &AppEvent, &AppQuit); } - protected virtual int Init() + protected virtual SDL_AppResult Init() { SDL3.SDL_SetLogPriorities(SDL_LogPriority.SDL_LOG_PRIORITY_VERBOSE); SDL3.SDL_SetLogOutputFunction(&LogOutput, IntPtr.Zero); - return CONTINUE; + return SDL_AppResult.SDL_APP_CONTINUE; } - protected const int TERMINATE_ERROR = -1; - protected const int CONTINUE = 0; - protected const int TERMINATE_SUCCESS = 1; - - protected virtual int Iterate() + protected virtual SDL_AppResult Iterate() { Thread.Sleep(10); - return CONTINUE; + return SDL_AppResult.SDL_APP_CONTINUE; } - protected virtual int Event(SDL_Event e) + protected virtual SDL_AppResult Event(SDL_Event e) { switch (e.Type) { @@ -47,10 +43,10 @@ namespace SDL.Tests case SDL_EventType.SDL_EVENT_WINDOW_CLOSE_REQUESTED: case SDL_EventType.SDL_EVENT_TERMINATING: case SDL_EventType.SDL_EVENT_KEY_DOWN when e.key.key == SDL_Keycode.SDLK_ESCAPE: - return TERMINATE_SUCCESS; + return SDL_AppResult.SDL_APP_SUCCESS; } - return CONTINUE; + return SDL_AppResult.SDL_APP_CONTINUE; } protected virtual void Quit() @@ -64,7 +60,7 @@ namespace SDL.Tests } [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] - private static int AppInit(IntPtr* appState, int argc, byte** argv) + private static SDL_AppResult AppInit(IntPtr* appState, int argc, byte** argv) { IntPtr handle = (IntPtr)argv; *appState = handle; @@ -73,27 +69,27 @@ namespace SDL.Tests if (objectHandle.GetTarget(out var target)) return target.Init(); - return TERMINATE_ERROR; + return SDL_AppResult.SDL_APP_FAILURE; } [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] - private static int AppIterate(IntPtr appState) + private static SDL_AppResult AppIterate(IntPtr appState) { var objectHandle = new ObjectHandle(appState, true); if (objectHandle.GetTarget(out var target)) return target.Iterate(); - return TERMINATE_ERROR; + return SDL_AppResult.SDL_APP_FAILURE; } [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] - private static int AppEvent(IntPtr appState, SDL_Event* e) + private static SDL_AppResult AppEvent(IntPtr appState, SDL_Event* e) { var objectHandle = new ObjectHandle(appState, true); if (objectHandle.GetTarget(out var target)) return target.Event(*e); - return TERMINATE_ERROR; + return SDL_AppResult.SDL_APP_FAILURE; } [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] diff --git a/SDL3-CS.Tests/MyWindow.cs b/SDL3-CS.Tests/MyWindow.cs index ec34ac2..a5ae375 100644 --- a/SDL3-CS.Tests/MyWindow.cs +++ b/SDL3-CS.Tests/MyWindow.cs @@ -19,7 +19,7 @@ namespace SDL.Tests public MyWindow() { - if (SDL_InitSubSystem(init_flags) < 0) + if (SDL_InitSubSystem(init_flags) == SDL_bool.SDL_FALSE) throw new InvalidOperationException($"failed to initialise SDL. Error: {SDL_GetError()}"); initSuccess = true; @@ -51,18 +51,18 @@ namespace SDL.Tests // ReSharper disable once UseCollectionExpression [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })] - private static int nativeFilter(IntPtr userdata, SDL_Event* e) + private static SDL_bool nativeFilter(IntPtr userdata, SDL_Event* e) { var handle = new ObjectHandle(userdata); if (handle.GetTarget(out var window)) return window.handleEventFromFilter(e); - return 1; + return SDL_bool.SDL_TRUE; } public Action? EventFilter; - private int handleEventFromFilter(SDL_Event* e) + private SDL_bool handleEventFromFilter(SDL_Event* e) { switch (e->Type) { @@ -76,7 +76,7 @@ namespace SDL.Tests break; } - return 1; + return SDL_bool.SDL_TRUE; } private void handleKeyFromFilter(SDL_KeyboardEvent e) @@ -105,8 +105,8 @@ namespace SDL.Tests switch (e.key.key) { case SDL_Keycode.SDLK_R: - bool old = SDL_GetRelativeMouseMode() == SDL_bool.SDL_TRUE; - SDL_SetRelativeMouseMode(old ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE); + bool old = SDL_GetWindowRelativeMouseMode(sdlWindowHandle) == SDL_bool.SDL_TRUE; + SDL_SetWindowRelativeMouseMode(sdlWindowHandle, old ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE); break; case SDL_Keycode.SDLK_V: @@ -170,14 +170,8 @@ namespace SDL.Tests Console.WriteLine($"gamepad added: {e.gdevice.which}"); break; - case SDL_EventType.SDL_EVENT_WINDOW_PEN_ENTER: - SDL_PenCapabilityInfo info; - var cap = SDL_GetPenCapabilities((SDL_PenID)e.window.data1, &info); - - if (cap.HasFlag(SDL_PenCapabilityFlags.SDL_PEN_AXIS_XTILT_MASK)) - Console.WriteLine("has pen xtilt axis"); - - Console.WriteLine(info.max_tilt); + case SDL_EventType.SDL_EVENT_PEN_PROXIMITY_IN: + Console.WriteLine($"pen proximity in: {e.pproximity.which}"); break; } } diff --git a/SDL3-CS.Tests/Program.cs b/SDL3-CS.Tests/Program.cs index 9cac63d..0a63be5 100644 --- a/SDL3-CS.Tests/Program.cs +++ b/SDL3-CS.Tests/Program.cs @@ -14,6 +14,9 @@ namespace SDL.Tests if (OperatingSystem.IsWindows()) Console.OutputEncoding = Encoding.UTF8; + Console.WriteLine($"SDL_FALSE is represented as 0x{SDL_OutOfMemory():X} (expected 0x{SDL_bool.SDL_FALSE:X})"); + Console.WriteLine($"SDL_TRUE is represented as 0x{SDL_ClearError():X} (expected 0x{SDL_bool.SDL_TRUE:X})"); + SDL_SetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, "null byte \0 in string"u8); Debug.Assert(SDL_GetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4) == "null byte "); diff --git a/SDL3-CS.Tests/TestClipboard.cs b/SDL3-CS.Tests/TestClipboard.cs index cb99d2f..674694b 100644 --- a/SDL3-CS.Tests/TestClipboard.cs +++ b/SDL3-CS.Tests/TestClipboard.cs @@ -24,7 +24,7 @@ namespace SDL.Tests [Test] public unsafe void TestClipboardData() { - int ret = SDL3.SDL_SetClipboardData(&dataCallback, &cleanupCallback, IntPtr.Zero, "test/one", "test/two"); + var ret = SDL3.SDL_SetClipboardData(&dataCallback, &cleanupCallback, IntPtr.Zero, "test/one", "test/two"); Assert.That(ret, Is.EqualTo(0), SDL3.SDL_GetError); Assert.That(SDL3.SDL_HasClipboardData("test/one"), Is.EqualTo(SDL_bool.SDL_TRUE)); @@ -46,7 +46,7 @@ namespace SDL.Tests } ret = SDL3.SDL_ClearClipboardData(); - Assert.That(ret, Is.EqualTo(0), SDL3.SDL_GetError); + Assert.That(ret, Is.EqualTo(SDL_bool.SDL_TRUE), SDL3.SDL_GetError); Assert.That(cleanups, Is.EqualTo(1)); diff --git a/SDL3-CS.Tests/TestPositionalInputVisualisation.cs b/SDL3-CS.Tests/TestPositionalInputVisualisation.cs index 182b53f..fa844c9 100644 --- a/SDL3-CS.Tests/TestPositionalInputVisualisation.cs +++ b/SDL3-CS.Tests/TestPositionalInputVisualisation.cs @@ -11,12 +11,11 @@ namespace SDL.Tests private SDL_Window* window; private SDL_Renderer* renderer; - protected override int Init() + protected override SDL_AppResult Init() { // decouple pen, mouse and touch events SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0"); SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); - SDL_SetHint(SDL_HINT_PEN_NOT_MOUSE, "2"); SDL_Init(SDL_InitFlags.SDL_INIT_VIDEO); @@ -48,7 +47,7 @@ namespace SDL.Tests SDL_RenderFillRect(renderer, &r); } - protected override int Iterate() + protected override SDL_AppResult Iterate() { const float gray = 0.1f; SDL_SetRenderDrawColorFloat(renderer, gray, gray, gray, 1.0f); @@ -86,7 +85,7 @@ namespace SDL.Tests return base.Iterate(); } - protected override int Event(SDL_Event e) + protected override SDL_AppResult Event(SDL_Event e) { SDL_ConvertEventToRenderCoordinates(renderer, &e); @@ -117,7 +116,7 @@ namespace SDL.Tests switch (e.key.key) { case SDL_Keycode.SDLK_R: - SDL_SetRelativeMouseMode(SDL_GetRelativeMouseMode() == SDL_bool.SDL_TRUE ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE); + SDL_SetWindowRelativeMouseMode(window, SDL_GetWindowRelativeMouseMode(window) == SDL_bool.SDL_TRUE ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE); break; case SDL_Keycode.SDLK_F: diff --git a/SDL3-CS.Tests/TestSDLBool.cs b/SDL3-CS.Tests/TestSDLBool.cs new file mode 100644 index 0000000..a0413c7 --- /dev/null +++ b/SDL3-CS.Tests/TestSDLBool.cs @@ -0,0 +1,39 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; + +namespace SDL.Tests +{ + [TestFixture] + public class TestSDLBool + { + private SDL_bool invert(SDL_bool value) => value == SDL_bool.SDL_TRUE ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE; + + [Test] + public void TestFalse() + { + Assert.That(SDL3.SDL_OutOfMemory(), Is.EqualTo(SDL_bool.SDL_FALSE)); + } + + [Test] + public void TestTrue() + { + Assert.That(SDL3.SDL_ClearError(), Is.EqualTo(SDL_bool.SDL_TRUE)); + } + + [Test] + public void TestStoreLoad([Values] SDL_bool value) + { + var props = SDL3.SDL_CreateProperties(); + Assume.That(props, Is.Not.EqualTo(0)); + + var ret = SDL3.SDL_SetBooleanProperty(props, "test", value); + Assume.That(ret, Is.EqualTo(SDL_bool.SDL_TRUE)); + + Assert.That(SDL3.SDL_GetBooleanProperty(props, "test", invert(value)), Is.EqualTo(value)); + + SDL3.SDL_DestroyProperties(props); + } + } +} diff --git a/SDL3-CS.sln.DotSettings b/SDL3-CS.sln.DotSettings index 099f4aa..d84e1d3 100644 --- a/SDL3-CS.sln.DotSettings +++ b/SDL3-CS.sln.DotSettings @@ -785,5 +785,6 @@ See the LICENCE file in the repository root for full licence text. True True True + True True True \ No newline at end of file diff --git a/SDL3-CS/SDL-use-proper-types.patch b/SDL3-CS/SDL-use-proper-types.patch index d13fa39..97f181f 100644 --- a/SDL3-CS/SDL-use-proper-types.patch +++ b/SDL3-CS/SDL-use-proper-types.patch @@ -1,5 +1,5 @@ diff --git a/include/SDL3/SDL.h b/include/SDL3/SDL.h -index 6cda579f7..bc2952a4e 100644 +index 4e18f6382..d737c7a9a 100644 --- a/include/SDL3/SDL.h +++ b/include/SDL3/SDL.h @@ -28,6 +28,8 @@ @@ -12,10 +12,10 @@ index 6cda579f7..bc2952a4e 100644 #include #include diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h -index 3ded311ff..42760135f 100644 +index 3c0e80f38..44f58add3 100644 --- a/include/SDL3/SDL_log.h +++ b/include/SDL3/SDL_log.h -@@ -372,7 +372,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, +@@ -407,7 +407,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LogMessageV(int category, * * \since This datatype is available since SDL 3.0.0. */ @@ -25,28 +25,24 @@ index 3ded311ff..42760135f 100644 /** * Get the current log output function. diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h -index 00a54a139..847b50ecb 100644 +index 5539f2a81..3155f3f31 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h -@@ -146,7 +146,7 @@ void *alloca(size_t); +@@ -194,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ --#define SDL_FALSE 0 +-#define SDL_FALSE false +#define SDL_FALSE (SDL_bool)0 /** * A boolean true. -@@ -155,7 +155,7 @@ void *alloca(size_t); +@@ -203,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ --#define SDL_TRUE 1 +-#define SDL_TRUE true +#define SDL_TRUE (SDL_bool)1 /** * A boolean type: true or false. - -base-commit: 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 --- -2.40.0.windows.1 diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs index 6b324fe..8013f26 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_atomic.g.cs @@ -67,10 +67,10 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] - public static extern IntPtr SDL_AtomicSetPtr([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v); + public static extern IntPtr SDL_AtomicSetPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] - public static extern IntPtr SDL_AtomicGetPtr([NativeTypeName("void **")] IntPtr* a); + public static extern IntPtr SDL_AtomicGetPointer([NativeTypeName("void **")] IntPtr* a); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs index 0c2d9c0..dcb348e 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs @@ -31,6 +31,7 @@ namespace SDL [NativeTypeName("int")] public enum SDL_AudioFormat : uint { + SDL_AUDIO_UNKNOWN = 0x0000U, SDL_AUDIO_U8 = 0x0008U, SDL_AUDIO_S8 = 0x8008U, SDL_AUDIO_S16LE = 0x8010U, @@ -78,7 +79,7 @@ namespace SDL public static extern byte* Unsafe_SDL_GetAudioDeviceName(SDL_AudioDeviceID devid); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames); + public static extern SDL_bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int* SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int* count); @@ -87,10 +88,10 @@ namespace SDL public static extern SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PauseAudioDevice(SDL_AudioDeviceID dev); + public static extern SDL_bool SDL_PauseAudioDevice(SDL_AudioDeviceID dev); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); + public static extern SDL_bool SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID dev); @@ -99,16 +100,16 @@ namespace SDL public static extern float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); + public static extern SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CloseAudioDevice(SDL_AudioDeviceID devid); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream** streams, int num_streams); + public static extern SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream** streams, int num_streams); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream* stream); + public static extern SDL_bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnbindAudioStreams(SDL_AudioStream** streams, int num_streams); @@ -126,22 +127,22 @@ namespace SDL public static extern SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec); + public static extern SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamFormat(SDL_AudioStream* stream, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec); + public static extern SDL_bool SDL_SetAudioStreamFormat(SDL_AudioStream* stream, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio); + public static extern SDL_bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float SDL_GetAudioStreamGain(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain); + public static extern SDL_bool SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int* SDL_GetAudioStreamInputChannelMap(SDL_AudioStream* stream, int* count); @@ -150,13 +151,13 @@ namespace SDL public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count); + public static extern SDL_bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count); + public static extern SDL_bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len); + public static extern SDL_bool SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_GetAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("void*")] IntPtr buf, int len); @@ -168,28 +169,28 @@ namespace SDL public static extern int SDL_GetAudioStreamQueued(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FlushAudioStream(SDL_AudioStream* stream); + public static extern SDL_bool SDL_FlushAudioStream(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearAudioStream(SDL_AudioStream* stream); + public static extern SDL_bool SDL_ClearAudioStream(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PauseAudioStreamDevice(SDL_AudioStream* stream); + public static extern SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream); + public static extern SDL_bool SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LockAudioStream(SDL_AudioStream* stream); + public static extern SDL_bool SDL_LockAudioStream(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UnlockAudioStream(SDL_AudioStream* stream); + public static extern SDL_bool SDL_UnlockAudioStream(SDL_AudioStream* stream); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyAudioStream(SDL_AudioStream* stream); @@ -198,19 +199,23 @@ namespace SDL public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LoadWAV_IO(SDL_IOStream* src, SDL_bool closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); + public static extern SDL_bool SDL_LoadWAV_IO(SDL_IOStream* src, SDL_bool closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LoadWAV([NativeTypeName("const char *")] byte* path, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); + public static extern SDL_bool SDL_LoadWAV([NativeTypeName("const char *")] byte* path, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, SDL_AudioFormat format, [NativeTypeName("Uint32")] uint len, float volume); + public static extern SDL_bool SDL_MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, SDL_AudioFormat format, [NativeTypeName("Uint32")] uint len, float volume); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ConvertAudioSamples([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const Uint8 *")] byte* src_data, int src_len, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec, [NativeTypeName("Uint8 **")] byte** dst_data, int* dst_len); + public static extern SDL_bool SDL_ConvertAudioSamples([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const Uint8 *")] byte* src_data, int src_len, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec, [NativeTypeName("Uint8 **")] byte** dst_data, int* dst_len); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioFormatName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern byte* Unsafe_SDL_GetAudioFormatName(SDL_AudioFormat format); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_GetSilenceValueForFormat(SDL_AudioFormat format); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_camera.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_camera.g.cs index 6327e4b..171d832 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_camera.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_camera.g.cs @@ -92,13 +92,13 @@ namespace SDL public static extern SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera* camera); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetCameraFormat(SDL_Camera* camera, SDL_CameraSpec* spec); + public static extern SDL_bool SDL_GetCameraFormat(SDL_Camera* camera, SDL_CameraSpec* spec); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Surface* SDL_AcquireCameraFrame(SDL_Camera* camera, [NativeTypeName("Uint64 *")] ulong* timestampNS); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ReleaseCameraFrame(SDL_Camera* camera, SDL_Surface* frame); + public static extern void SDL_ReleaseCameraFrame(SDL_Camera* camera, SDL_Surface* frame); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CloseCamera(SDL_Camera* camera); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_clipboard.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_clipboard.g.cs index eecc249..3111879 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_clipboard.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_clipboard.g.cs @@ -31,7 +31,7 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetClipboardText([NativeTypeName("const char *")] byte* text); + public static extern SDL_bool SDL_SetClipboardText([NativeTypeName("const char *")] byte* text); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)] [return: NativeTypeName("char *")] @@ -41,7 +41,7 @@ namespace SDL public static extern SDL_bool SDL_HasClipboardText(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text); + public static extern SDL_bool SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPrimarySelectionText", ExactSpelling = true)] [return: NativeTypeName("char *")] @@ -51,10 +51,10 @@ namespace SDL public static extern SDL_bool SDL_HasPrimarySelectionText(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl] cleanup, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("const char **")] byte** mime_types, [NativeTypeName("size_t")] nuint num_mime_types); + public static extern SDL_bool SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl] cleanup, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("const char **")] byte** mime_types, [NativeTypeName("size_t")] nuint num_mime_types); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearClipboardData(); + public static extern SDL_bool SDL_ClearClipboardData(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_error.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_error.g.cs index a1f326e..64a8664 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_error.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_error.g.cs @@ -30,16 +30,16 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist); + public static extern SDL_bool SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_OutOfMemory(); + public static extern SDL_bool SDL_OutOfMemory(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)] [return: NativeTypeName("const char *")] public static extern byte* Unsafe_SDL_GetError(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearError(); + public static extern SDL_bool SDL_ClearError(); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs index 4d7d2d8..38c1e0c 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs @@ -74,8 +74,6 @@ namespace SDL SDL_EVENT_WINDOW_ENTER_FULLSCREEN, SDL_EVENT_WINDOW_LEAVE_FULLSCREEN, SDL_EVENT_WINDOW_DESTROYED, - SDL_EVENT_WINDOW_PEN_ENTER, - 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_HDR_STATE_CHANGED, @@ -127,11 +125,14 @@ namespace SDL SDL_EVENT_AUDIO_DEVICE_REMOVED, SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED, SDL_EVENT_SENSOR_UPDATE = 0x1200, - SDL_EVENT_PEN_DOWN = 0x1300, + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, + SDL_EVENT_PEN_PROXIMITY_OUT, + SDL_EVENT_PEN_DOWN, SDL_EVENT_PEN_UP, - SDL_EVENT_PEN_MOTION, SDL_EVENT_PEN_BUTTON_DOWN, SDL_EVENT_PEN_BUTTON_UP, + SDL_EVENT_PEN_MOTION, + SDL_EVENT_PEN_AXIS, SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, @@ -230,11 +231,9 @@ namespace SDL [NativeTypeName("Uint16")] public ushort raw; - [NativeTypeName("Uint8")] - public byte state; + public SDL_bool down; - [NativeTypeName("Uint8")] - public byte repeat; + public SDL_bool repeat; } public unsafe partial struct SDL_TextEditingEvent @@ -281,6 +280,15 @@ namespace SDL public int selected_candidate; public SDL_bool horizontal; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; } public unsafe partial struct SDL_TextInputEvent @@ -354,8 +362,7 @@ namespace SDL [NativeTypeName("Uint8")] public byte button; - [NativeTypeName("Uint8")] - public byte state; + public SDL_bool down; [NativeTypeName("Uint8")] public byte clicks; @@ -495,8 +502,7 @@ namespace SDL [NativeTypeName("Uint8")] public byte button; - [NativeTypeName("Uint8")] - public byte state; + public SDL_bool down; [NativeTypeName("Uint8")] public byte padding1; @@ -581,8 +587,7 @@ namespace SDL [NativeTypeName("Uint8")] public byte button; - [NativeTypeName("Uint8")] - public byte state; + public SDL_bool down; [NativeTypeName("Uint8")] public byte padding1; @@ -669,8 +674,7 @@ namespace SDL public SDL_AudioDeviceID which; - [NativeTypeName("Uint8")] - public byte recording; + public SDL_bool recording; [NativeTypeName("Uint8")] public byte padding1; @@ -722,7 +726,7 @@ namespace SDL public SDL_WindowID windowID; } - public partial struct SDL_PenTipEvent + public partial struct SDL_PenProximityEvent { public SDL_EventType type; @@ -735,28 +739,6 @@ namespace SDL public SDL_WindowID windowID; public SDL_PenID which; - - [NativeTypeName("Uint8")] - public byte tip; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint16")] - public ushort pen_state; - - public float x; - - public float y; - - [NativeTypeName("float[6]")] - public _axes_e__FixedBuffer axes; - - [InlineArray(6)] - public partial struct _axes_e__FixedBuffer - { - public float e0; - } } public partial struct SDL_PenMotionEvent @@ -773,27 +755,36 @@ namespace SDL public SDL_PenID which; - [NativeTypeName("Uint8")] - public byte padding1; + public SDL_PenInputFlags pen_state; - [NativeTypeName("Uint8")] - public byte padding2; + public float x; - [NativeTypeName("Uint16")] - public ushort pen_state; + public float y; + } + + public partial struct SDL_PenTouchEvent + { + public SDL_EventType type; + + [NativeTypeName("Uint32")] + public uint reserved; + + [NativeTypeName("Uint64")] + public ulong timestamp; + + public SDL_WindowID windowID; + + public SDL_PenID which; + + public SDL_PenInputFlags pen_state; public float x; public float y; - [NativeTypeName("float[6]")] - public _axes_e__FixedBuffer axes; + public SDL_bool eraser; - [InlineArray(6)] - public partial struct _axes_e__FixedBuffer - { - public float e0; - } + public SDL_bool down; } public partial struct SDL_PenButtonEvent @@ -810,27 +801,41 @@ namespace SDL public SDL_PenID which; - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint16")] - public ushort pen_state; + public SDL_PenInputFlags pen_state; public float x; public float y; - [NativeTypeName("float[6]")] - public _axes_e__FixedBuffer axes; + [NativeTypeName("Uint8")] + public byte button; - [InlineArray(6)] - public partial struct _axes_e__FixedBuffer - { - public float e0; - } + public SDL_bool down; + } + + public partial struct SDL_PenAxisEvent + { + public SDL_EventType type; + + [NativeTypeName("Uint32")] + public uint reserved; + + [NativeTypeName("Uint64")] + public ulong timestamp; + + public SDL_WindowID windowID; + + public SDL_PenID which; + + public SDL_PenInputFlags pen_state; + + public float x; + + public float y; + + public SDL_PenAxis axis; + + public float value; } public unsafe partial struct SDL_DropEvent @@ -1021,7 +1026,10 @@ namespace SDL public SDL_TouchFingerEvent tfinger; [FieldOffset(0)] - public SDL_PenTipEvent ptip; + public SDL_PenProximityEvent pproximity; + + [FieldOffset(0)] + public SDL_PenTouchEvent ptouch; [FieldOffset(0)] public SDL_PenMotionEvent pmotion; @@ -1029,6 +1037,9 @@ namespace SDL [FieldOffset(0)] public SDL_PenButtonEvent pbutton; + [FieldOffset(0)] + public SDL_PenAxisEvent paxis; + [FieldOffset(0)] public SDL_DropEvent drop; @@ -1083,22 +1094,22 @@ namespace SDL public static extern SDL_bool SDL_WaitEventTimeout(SDL_Event* @event, [NativeTypeName("Sint32")] int timeoutMS); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PushEvent(SDL_Event* @event); + public static extern SDL_bool SDL_PushEvent(SDL_Event* @event); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_bool SDL_GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]* filter, [NativeTypeName("void **")] IntPtr* userdata); + public static extern SDL_bool SDL_GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]* filter, [NativeTypeName("void **")] IntPtr* userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_RemoveEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_SetEventEnabled([NativeTypeName("Uint32")] uint type, SDL_bool enabled); @@ -1112,11 +1123,5 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Window* SDL_GetWindowFromEvent([NativeTypeName("const SDL_Event *")] SDL_Event* @event); - - [NativeTypeName("#define SDL_RELEASED 0")] - public const int SDL_RELEASED = 0; - - [NativeTypeName("#define SDL_PRESSED 1")] - public const int SDL_PRESSED = 1; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_filesystem.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_filesystem.g.cs index ed05c18..7f0dd77 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_filesystem.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_filesystem.g.cs @@ -41,7 +41,7 @@ namespace SDL SDL_FOLDER_SCREENSHOTS, SDL_FOLDER_TEMPLATES, SDL_FOLDER_VIDEOS, - SDL_FOLDER_TOTAL, + SDL_FOLDER_COUNT, } public enum SDL_PathType @@ -81,22 +81,22 @@ namespace SDL public static extern byte* Unsafe_SDL_GetUserFolder(SDL_Folder folder); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CreateDirectory([NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_CreateDirectory([NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RemovePath([NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_RemovePath([NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath); + public static extern SDL_bool 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); + public static extern SDL_bool 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); + public static extern SDL_bool SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("char **")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs index 639e98c..ec6880c 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs @@ -45,7 +45,7 @@ namespace SDL SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, - SDL_GAMEPAD_TYPE_MAX, + SDL_GAMEPAD_TYPE_COUNT, } public enum SDL_GamepadButton @@ -77,7 +77,7 @@ namespace SDL SDL_GAMEPAD_BUTTON_MISC4, SDL_GAMEPAD_BUTTON_MISC5, SDL_GAMEPAD_BUTTON_MISC6, - SDL_GAMEPAD_BUTTON_MAX, + SDL_GAMEPAD_BUTTON_COUNT, } public enum SDL_GamepadButtonLabel @@ -102,7 +102,7 @@ namespace SDL SDL_GAMEPAD_AXIS_RIGHTY, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, - SDL_GAMEPAD_AXIS_MAX, + SDL_GAMEPAD_AXIS_COUNT, } public enum SDL_GamepadBindingType @@ -117,12 +117,12 @@ namespace SDL { public SDL_GamepadBindingType input_type; - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L245_C5")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L247_C5")] public _input_e__Union input; public SDL_GamepadBindingType output_type; - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L265_C5")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L267_C5")] public _output_e__Union output; [StructLayout(LayoutKind.Explicit)] @@ -132,11 +132,11 @@ namespace SDL public int button; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L249_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L251_C9")] public _axis_e__Struct axis; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L256_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L258_C9")] public _hat_e__Struct hat; public partial struct _axis_e__Struct @@ -163,7 +163,7 @@ namespace SDL public SDL_GamepadButton button; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L269_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L271_C9")] public _axis_e__Struct axis; public partial struct _axis_e__Struct @@ -189,7 +189,7 @@ namespace SDL public static extern int SDL_AddGamepadMappingsFromFile([NativeTypeName("const char *")] byte* file); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ReloadGamepadMappings(); + public static extern SDL_bool SDL_ReloadGamepadMappings(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("char **")] @@ -204,7 +204,7 @@ namespace SDL public static extern byte* Unsafe_SDL_GetGamepadMapping(SDL_Gamepad* gamepad); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetGamepadMapping(SDL_JoystickID instance_id, [NativeTypeName("const char *")] byte* mapping); + public static extern SDL_bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, [NativeTypeName("const char *")] byte* mapping); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_HasGamepad(); @@ -284,7 +284,7 @@ namespace SDL public static extern int SDL_GetGamepadPlayerIndex(SDL_Gamepad* gamepad); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index); + public static extern SDL_bool SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint16")] @@ -366,8 +366,7 @@ namespace SDL public static extern SDL_bool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button); + public static extern SDL_bool SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_GamepadButtonLabel SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button); @@ -382,13 +381,13 @@ namespace SDL public static extern int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad* gamepad, int touchpad); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, [NativeTypeName("Uint8 *")] byte* state, float* x, float* y, float* pressure); + public static extern SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, SDL_bool* down, float* x, float* y, float* pressure); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_GamepadHasSensor(SDL_Gamepad* gamepad, SDL_SensorType type); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, SDL_bool enabled); + public static extern SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, SDL_bool enabled); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type); @@ -397,19 +396,19 @@ namespace SDL public static extern float SDL_GetGamepadSensorDataRate(SDL_Gamepad* gamepad, SDL_SensorType type); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values); + public static extern SDL_bool SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RumbleGamepad(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); + public static extern SDL_bool SDL_RumbleGamepad(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); + public static extern SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetGamepadLED(SDL_Gamepad* gamepad, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); + public static extern SDL_bool SDL_SetGamepadLED(SDL_Gamepad* gamepad, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SendGamepadEffect(SDL_Gamepad* gamepad, [NativeTypeName("const void *")] IntPtr data, int size); + public static extern SDL_bool SDL_SendGamepadEffect(SDL_Gamepad* gamepad, [NativeTypeName("const void *")] IntPtr data, int size); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CloseGamepad(SDL_Gamepad* gamepad); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs new file mode 100644 index 0000000..81c281c --- /dev/null +++ b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs @@ -0,0 +1,1410 @@ +/* + + C# bindings for Simple DirectMedia Layer. + Original copyright notice of input files: + + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +using System; +using System.Runtime.InteropServices; + +namespace SDL +{ + public partial struct SDL_GPUDevice + { + } + + public partial struct SDL_GPUBuffer + { + } + + public partial struct SDL_GPUTransferBuffer + { + } + + public partial struct SDL_GPUTexture + { + } + + public partial struct SDL_GPUSampler + { + } + + public partial struct SDL_GPUShader + { + } + + public partial struct SDL_GPUComputePipeline + { + } + + public partial struct SDL_GPUGraphicsPipeline + { + } + + public partial struct SDL_GPUCommandBuffer + { + } + + public partial struct SDL_GPURenderPass + { + } + + public partial struct SDL_GPUComputePass + { + } + + public partial struct SDL_GPUCopyPass + { + } + + public partial struct SDL_GPUFence + { + } + + public enum SDL_GPUPrimitiveType + { + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_POINTLIST, + } + + public enum SDL_GPULoadOp + { + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE, + } + + public enum SDL_GPUStoreOp + { + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE, + } + + public enum SDL_GPUIndexElementSize + { + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT, + } + + public enum SDL_GPUTextureFormat + { + SDL_GPU_TEXTUREFORMAT_INVALID, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_R8G8_UNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_R16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM, + SDL_GPU_TEXTUREFORMAT_BC4_R_UNORM, + SDL_GPU_TEXTUREFORMAT_BC5_RG_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM, + SDL_GPU_TEXTUREFORMAT_BC6H_RGB_FLOAT, + SDL_GPU_TEXTUREFORMAT_BC6H_RGB_UFLOAT, + SDL_GPU_TEXTUREFORMAT_R8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + SDL_GPU_TEXTUREFORMAT_R16_SNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_SNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_SNORM, + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R11G11B10_UFLOAT, + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + SDL_GPU_TEXTUREFORMAT_R8_INT, + SDL_GPU_TEXTUREFORMAT_R8G8_INT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_INT, + SDL_GPU_TEXTUREFORMAT_R16_INT, + SDL_GPU_TEXTUREFORMAT_R16G16_INT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_INT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC1_RGBA_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC2_RGBA_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC3_RGBA_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_RGBA_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT, + } + + public enum SDL_GPUTextureType + { + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE, + SDL_GPU_TEXTURETYPE_CUBE_ARRAY, + } + + public enum SDL_GPUSampleCount + { + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8, + } + + public enum SDL_GPUCubeMapFace + { + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ, + } + + public enum SDL_GPUTransferBufferUsage + { + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD, + } + + public enum SDL_GPUShaderStage + { + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT, + } + + public enum SDL_GPUVertexElementFormat + { + SDL_GPU_VERTEXELEMENTFORMAT_INVALID, + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4, + } + + public enum SDL_GPUVertexInputRate + { + SDL_GPU_VERTEXINPUTRATE_VERTEX, + SDL_GPU_VERTEXINPUTRATE_INSTANCE, + } + + public enum SDL_GPUFillMode + { + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE, + } + + public enum SDL_GPUCullMode + { + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK, + } + + public enum SDL_GPUFrontFace + { + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE, + } + + public enum SDL_GPUCompareOp + { + SDL_GPU_COMPAREOP_INVALID, + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS, + } + + public enum SDL_GPUStencilOp + { + SDL_GPU_STENCILOP_INVALID, + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP, + } + + public enum SDL_GPUBlendOp + { + SDL_GPU_BLENDOP_INVALID, + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX, + } + + public enum SDL_GPUBlendFactor + { + SDL_GPU_BLENDFACTOR_INVALID, + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE, + } + + public enum SDL_GPUFilter + { + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR, + } + + public enum SDL_GPUSamplerMipmapMode + { + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, + } + + public enum SDL_GPUSamplerAddressMode + { + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE, + } + + public enum SDL_GPUPresentMode + { + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX, + } + + public enum SDL_GPUSwapchainComposition + { + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048, + } + + public partial struct SDL_GPUViewport + { + public float x; + + public float y; + + public float w; + + public float h; + + public float min_depth; + + public float max_depth; + } + + public unsafe partial struct SDL_GPUTextureTransferInfo + { + public SDL_GPUTransferBuffer* transfer_buffer; + + [NativeTypeName("Uint32")] + public uint offset; + + [NativeTypeName("Uint32")] + public uint pixels_per_row; + + [NativeTypeName("Uint32")] + public uint rows_per_layer; + } + + public unsafe partial struct SDL_GPUTransferBufferLocation + { + public SDL_GPUTransferBuffer* transfer_buffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUTextureLocation + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mip_level; + + [NativeTypeName("Uint32")] + public uint layer; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint z; + } + + public unsafe partial struct SDL_GPUTextureRegion + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mip_level; + + [NativeTypeName("Uint32")] + public uint layer; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint z; + + [NativeTypeName("Uint32")] + public uint w; + + [NativeTypeName("Uint32")] + public uint h; + + [NativeTypeName("Uint32")] + public uint d; + } + + public unsafe partial struct SDL_GPUBlitRegion + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mip_level; + + [NativeTypeName("Uint32")] + public uint layer_or_depth_plane; + + [NativeTypeName("Uint32")] + public uint x; + + [NativeTypeName("Uint32")] + public uint y; + + [NativeTypeName("Uint32")] + public uint w; + + [NativeTypeName("Uint32")] + public uint h; + } + + public unsafe partial struct SDL_GPUBufferLocation + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUBufferRegion + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + + [NativeTypeName("Uint32")] + public uint size; + } + + public partial struct SDL_GPUIndirectDrawCommand + { + [NativeTypeName("Uint32")] + public uint num_vertices; + + [NativeTypeName("Uint32")] + public uint num_instances; + + [NativeTypeName("Uint32")] + public uint first_vertex; + + [NativeTypeName("Uint32")] + public uint first_instance; + } + + public partial struct SDL_GPUIndexedIndirectDrawCommand + { + [NativeTypeName("Uint32")] + public uint num_indices; + + [NativeTypeName("Uint32")] + public uint num_instances; + + [NativeTypeName("Uint32")] + public uint first_index; + + [NativeTypeName("Sint32")] + public int vertex_offset; + + [NativeTypeName("Uint32")] + public uint first_instance; + } + + public partial struct SDL_GPUIndirectDispatchCommand + { + [NativeTypeName("Uint32")] + public uint groupcount_x; + + [NativeTypeName("Uint32")] + public uint groupcount_y; + + [NativeTypeName("Uint32")] + public uint groupcount_z; + } + + public partial struct SDL_GPUSamplerCreateInfo + { + public SDL_GPUFilter min_filter; + + public SDL_GPUFilter mag_filter; + + public SDL_GPUSamplerMipmapMode mipmap_mode; + + public SDL_GPUSamplerAddressMode address_mode_u; + + public SDL_GPUSamplerAddressMode address_mode_v; + + public SDL_GPUSamplerAddressMode address_mode_w; + + public float mip_lod_bias; + + public float max_anisotropy; + + public SDL_GPUCompareOp compare_op; + + public float min_lod; + + public float max_lod; + + public SDL_bool enable_anisotropy; + + public SDL_bool enable_compare; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUVertexBufferDescription + { + [NativeTypeName("Uint32")] + public uint slot; + + [NativeTypeName("Uint32")] + public uint pitch; + + public SDL_GPUVertexInputRate input_rate; + + [NativeTypeName("Uint32")] + public uint instance_step_rate; + } + + public partial struct SDL_GPUVertexAttribute + { + [NativeTypeName("Uint32")] + public uint location; + + [NativeTypeName("Uint32")] + public uint buffer_slot; + + public SDL_GPUVertexElementFormat format; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUVertexInputState + { + [NativeTypeName("const SDL_GPUVertexBufferDescription *")] + public SDL_GPUVertexBufferDescription* vertex_buffer_descriptions; + + [NativeTypeName("Uint32")] + public uint num_vertex_buffers; + + [NativeTypeName("const SDL_GPUVertexAttribute *")] + public SDL_GPUVertexAttribute* vertex_attributes; + + [NativeTypeName("Uint32")] + public uint num_vertex_attributes; + } + + public partial struct SDL_GPUStencilOpState + { + public SDL_GPUStencilOp fail_op; + + public SDL_GPUStencilOp pass_op; + + public SDL_GPUStencilOp depth_fail_op; + + public SDL_GPUCompareOp compare_op; + } + + public partial struct SDL_GPUColorTargetBlendState + { + public SDL_GPUBlendFactor src_color_blendfactor; + + public SDL_GPUBlendFactor dst_color_blendfactor; + + public SDL_GPUBlendOp color_blend_op; + + public SDL_GPUBlendFactor src_alpha_blendfactor; + + public SDL_GPUBlendFactor dst_alpha_blendfactor; + + public SDL_GPUBlendOp alpha_blend_op; + + public SDL_GPUColorComponentFlags color_write_mask; + + public SDL_bool enable_blend; + + public SDL_bool enable_color_write_mask; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public unsafe partial struct SDL_GPUShaderCreateInfo + { + [NativeTypeName("size_t")] + public nuint code_size; + + [NativeTypeName("const Uint8 *")] + public byte* code; + + [NativeTypeName("const char *")] + public byte* entrypoint; + + public SDL_GPUShaderFormat format; + + public SDL_GPUShaderStage stage; + + [NativeTypeName("Uint32")] + public uint num_samplers; + + [NativeTypeName("Uint32")] + public uint num_storage_textures; + + [NativeTypeName("Uint32")] + public uint num_storage_buffers; + + [NativeTypeName("Uint32")] + public uint num_uniform_buffers; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUTextureCreateInfo + { + public SDL_GPUTextureType type; + + public SDL_GPUTextureFormat format; + + public SDL_GPUTextureUsageFlags usage; + + [NativeTypeName("Uint32")] + public uint width; + + [NativeTypeName("Uint32")] + public uint height; + + [NativeTypeName("Uint32")] + public uint layer_count_or_depth; + + [NativeTypeName("Uint32")] + public uint num_levels; + + public SDL_GPUSampleCount sample_count; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUBufferCreateInfo + { + public SDL_GPUBufferUsageFlags usage; + + [NativeTypeName("Uint32")] + public uint size; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPUTransferBufferCreateInfo + { + public SDL_GPUTransferBufferUsage usage; + + [NativeTypeName("Uint32")] + public uint size; + + public SDL_PropertiesID props; + } + + public partial struct SDL_GPURasterizerState + { + public SDL_GPUFillMode fill_mode; + + public SDL_GPUCullMode cull_mode; + + public SDL_GPUFrontFace front_face; + + public float depth_bias_constant_factor; + + public float depth_bias_clamp; + + public float depth_bias_slope_factor; + + public SDL_bool enable_depth_bias; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public partial struct SDL_GPUMultisampleState + { + public SDL_GPUSampleCount sample_count; + + [NativeTypeName("Uint32")] + public uint sample_mask; + + public SDL_bool enable_mask; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public partial struct SDL_GPUDepthStencilState + { + public SDL_GPUCompareOp compare_op; + + public SDL_GPUStencilOpState back_stencil_state; + + public SDL_GPUStencilOpState front_stencil_state; + + [NativeTypeName("Uint8")] + public byte compare_mask; + + [NativeTypeName("Uint8")] + public byte write_mask; + + public SDL_bool enable_depth_test; + + public SDL_bool enable_depth_write; + + public SDL_bool enable_stencil_test; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public partial struct SDL_GPUColorTargetDescription + { + public SDL_GPUTextureFormat format; + + public SDL_GPUColorTargetBlendState blend_state; + } + + public unsafe partial struct SDL_GpuGraphicsPipelineTargetInfo + { + [NativeTypeName("const SDL_GPUColorTargetDescription *")] + public SDL_GPUColorTargetDescription* color_target_descriptions; + + [NativeTypeName("Uint32")] + public uint num_color_targets; + + public SDL_GPUTextureFormat depth_stencil_format; + + public SDL_bool has_depth_stencil_target; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public unsafe partial struct SDL_GPUGraphicsPipelineCreateInfo + { + public SDL_GPUShader* vertex_shader; + + public SDL_GPUShader* fragment_shader; + + public SDL_GPUVertexInputState vertex_input_state; + + public SDL_GPUPrimitiveType primitive_type; + + public SDL_GPURasterizerState rasterizer_state; + + public SDL_GPUMultisampleState multisample_state; + + public SDL_GPUDepthStencilState depth_stencil_state; + + public SDL_GpuGraphicsPipelineTargetInfo target_info; + + public SDL_PropertiesID props; + } + + public unsafe partial struct SDL_GPUComputePipelineCreateInfo + { + [NativeTypeName("size_t")] + public nuint code_size; + + [NativeTypeName("const Uint8 *")] + public byte* code; + + [NativeTypeName("const char *")] + public byte* entrypoint; + + public SDL_GPUShaderFormat format; + + [NativeTypeName("Uint32")] + public uint num_samplers; + + [NativeTypeName("Uint32")] + public uint num_readonly_storage_textures; + + [NativeTypeName("Uint32")] + public uint num_readonly_storage_buffers; + + [NativeTypeName("Uint32")] + public uint num_writeonly_storage_textures; + + [NativeTypeName("Uint32")] + public uint num_writeonly_storage_buffers; + + [NativeTypeName("Uint32")] + public uint num_uniform_buffers; + + [NativeTypeName("Uint32")] + public uint threadcount_x; + + [NativeTypeName("Uint32")] + public uint threadcount_y; + + [NativeTypeName("Uint32")] + public uint threadcount_z; + + public SDL_PropertiesID props; + } + + public unsafe partial struct SDL_GPUColorTargetInfo + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mip_level; + + [NativeTypeName("Uint32")] + public uint layer_or_depth_plane; + + public SDL_FColor clear_color; + + public SDL_GPULoadOp load_op; + + public SDL_GPUStoreOp store_op; + + public SDL_bool cycle; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public unsafe partial struct SDL_GPUDepthStencilTargetInfo + { + public SDL_GPUTexture* texture; + + public float clear_depth; + + public SDL_GPULoadOp load_op; + + public SDL_GPUStoreOp store_op; + + public SDL_GPULoadOp stencil_load_op; + + public SDL_GPUStoreOp stencil_store_op; + + public SDL_bool cycle; + + [NativeTypeName("Uint8")] + public byte clear_stencil; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } + + public partial struct SDL_GPUBlitInfo + { + public SDL_GPUBlitRegion source; + + public SDL_GPUBlitRegion destination; + + public SDL_GPULoadOp load_op; + + public SDL_FColor clear_color; + + public SDL_FlipMode flip_mode; + + public SDL_GPUFilter filter; + + public SDL_bool cycle; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public unsafe partial struct SDL_GPUBufferBinding + { + public SDL_GPUBuffer* buffer; + + [NativeTypeName("Uint32")] + public uint offset; + } + + public unsafe partial struct SDL_GPUTextureSamplerBinding + { + public SDL_GPUTexture* texture; + + public SDL_GPUSampler* sampler; + } + + public unsafe partial struct SDL_GPUStorageBufferWriteOnlyBinding + { + public SDL_GPUBuffer* buffer; + + public SDL_bool cycle; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public unsafe partial struct SDL_GPUStorageTextureWriteOnlyBinding + { + public SDL_GPUTexture* texture; + + [NativeTypeName("Uint32")] + public uint mip_level; + + [NativeTypeName("Uint32")] + public uint layer; + + public SDL_bool cycle; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } + + public static unsafe partial class SDL3 + { + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUSupportsShaderFormats(SDL_GPUShaderFormat format_flags, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUSupportsProperties(SDL_PropertiesID props); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUDevice* SDL_CreateGPUDevice(SDL_GPUShaderFormat format_flags, SDL_bool debug_mode, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUDevice* SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DestroyGPUDevice(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int SDL_GetNumGPUDrivers(); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGPUDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern byte* Unsafe_SDL_GetGPUDriver(int index); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGPUDeviceDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern byte* Unsafe_SDL_GetGPUDeviceDriver(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUShaderFormat SDL_GetGPUShaderFormats(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUComputePipeline* SDL_CreateGPUComputePipeline(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUComputePipelineCreateInfo *")] SDL_GPUComputePipelineCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUGraphicsPipeline* SDL_CreateGPUGraphicsPipeline(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUGraphicsPipelineCreateInfo *")] SDL_GPUGraphicsPipelineCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUSampler* SDL_CreateGPUSampler(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUSamplerCreateInfo *")] SDL_GPUSamplerCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUShader* SDL_CreateGPUShader(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUShaderCreateInfo *")] SDL_GPUShaderCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTexture* SDL_CreateGPUTexture(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUTextureCreateInfo *")] SDL_GPUTextureCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUBuffer* SDL_CreateGPUBuffer(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUBufferCreateInfo *")] SDL_GPUBufferCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTransferBuffer* SDL_CreateGPUTransferBuffer(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUTransferBufferCreateInfo *")] SDL_GPUTransferBufferCreateInfo* createinfo); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUBufferName(SDL_GPUDevice* device, SDL_GPUBuffer* buffer, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUTextureName(SDL_GPUDevice* device, SDL_GPUTexture* texture, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_InsertGPUDebugLabel(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("const char *")] byte* text); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUDebugGroup(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PopGPUDebugGroup(SDL_GPUCommandBuffer* command_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUTexture(SDL_GPUDevice* device, SDL_GPUTexture* texture); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUSampler(SDL_GPUDevice* device, SDL_GPUSampler* sampler); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUBuffer(SDL_GPUDevice* device, SDL_GPUBuffer* buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transfer_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUComputePipeline(SDL_GPUDevice* device, SDL_GPUComputePipeline* compute_pipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUShader(SDL_GPUDevice* device, SDL_GPUShader* shader); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUGraphicsPipeline(SDL_GPUDevice* device, SDL_GPUGraphicsPipeline* graphics_pipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUCommandBuffer* SDL_AcquireGPUCommandBuffer(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUVertexUniformData(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("Uint32")] uint slot_index, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint length); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUFragmentUniformData(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("Uint32")] uint slot_index, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint length); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_PushGPUComputeUniformData(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("Uint32")] uint slot_index, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint length); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPURenderPass* SDL_BeginGPURenderPass(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("const SDL_GPUColorTargetInfo *")] SDL_GPUColorTargetInfo* color_target_infos, [NativeTypeName("Uint32")] uint num_color_targets, [NativeTypeName("const SDL_GPUDepthStencilTargetInfo *")] SDL_GPUDepthStencilTargetInfo* depth_stencil_target_info); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUGraphicsPipeline(SDL_GPURenderPass* render_pass, SDL_GPUGraphicsPipeline* graphics_pipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUViewport(SDL_GPURenderPass* render_pass, [NativeTypeName("const SDL_GPUViewport *")] SDL_GPUViewport* viewport); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUScissor(SDL_GPURenderPass* render_pass, [NativeTypeName("const SDL_Rect *")] SDL_Rect* scissor); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUBlendConstants(SDL_GPURenderPass* render_pass, SDL_FColor blend_constants); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SetGPUStencilReference(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint8")] byte reference); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexBuffers(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("const SDL_GPUBufferBinding *")] SDL_GPUBufferBinding* bindings, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUIndexBuffer(SDL_GPURenderPass* render_pass, [NativeTypeName("const SDL_GPUBufferBinding *")] SDL_GPUBufferBinding* binding, SDL_GPUIndexElementSize index_element_size); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexSamplers(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("const SDL_GPUTextureSamplerBinding *")] SDL_GPUTextureSamplerBinding* texture_sampler_bindings, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexStorageTextures(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUTexture *const *")] SDL_GPUTexture** storage_textures, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUVertexStorageBuffers(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUBuffer *const *")] SDL_GPUBuffer** storage_buffers, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentSamplers(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("const SDL_GPUTextureSamplerBinding *")] SDL_GPUTextureSamplerBinding* texture_sampler_bindings, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentStorageTextures(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUTexture *const *")] SDL_GPUTexture** storage_textures, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUFragmentStorageBuffers(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUBuffer *const *")] SDL_GPUBuffer** storage_buffers, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUIndexedPrimitives(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint num_indices, [NativeTypeName("Uint32")] uint num_instances, [NativeTypeName("Uint32")] uint first_index, [NativeTypeName("Sint32")] int vertex_offset, [NativeTypeName("Uint32")] uint first_instance); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUPrimitives(SDL_GPURenderPass* render_pass, [NativeTypeName("Uint32")] uint num_vertices, [NativeTypeName("Uint32")] uint num_instances, [NativeTypeName("Uint32")] uint first_vertex, [NativeTypeName("Uint32")] uint first_instance); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUPrimitivesIndirect(SDL_GPURenderPass* render_pass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offset, [NativeTypeName("Uint32")] uint draw_count); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DrawGPUIndexedPrimitivesIndirect(SDL_GPURenderPass* render_pass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offset, [NativeTypeName("Uint32")] uint draw_count); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPURenderPass(SDL_GPURenderPass* render_pass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUComputePass* SDL_BeginGPUComputePass(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("const SDL_GPUStorageTextureWriteOnlyBinding *")] SDL_GPUStorageTextureWriteOnlyBinding* storage_texture_bindings, [NativeTypeName("Uint32")] uint num_storage_texture_bindings, [NativeTypeName("const SDL_GPUStorageBufferWriteOnlyBinding *")] SDL_GPUStorageBufferWriteOnlyBinding* storage_buffer_bindings, [NativeTypeName("Uint32")] uint num_storage_buffer_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputePipeline(SDL_GPUComputePass* compute_pass, SDL_GPUComputePipeline* compute_pipeline); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputeSamplers(SDL_GPUComputePass* compute_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("const SDL_GPUTextureSamplerBinding *")] SDL_GPUTextureSamplerBinding* texture_sampler_bindings, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputeStorageTextures(SDL_GPUComputePass* compute_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUTexture *const *")] SDL_GPUTexture** storage_textures, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BindGPUComputeStorageBuffers(SDL_GPUComputePass* compute_pass, [NativeTypeName("Uint32")] uint first_slot, [NativeTypeName("SDL_GPUBuffer *const *")] SDL_GPUBuffer** storage_buffers, [NativeTypeName("Uint32")] uint num_bindings); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DispatchGPUCompute(SDL_GPUComputePass* compute_pass, [NativeTypeName("Uint32")] uint groupcount_x, [NativeTypeName("Uint32")] uint groupcount_y, [NativeTypeName("Uint32")] uint groupcount_z); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DispatchGPUComputeIndirect(SDL_GPUComputePass* compute_pass, SDL_GPUBuffer* buffer, [NativeTypeName("Uint32")] uint offset); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPUComputePass(SDL_GPUComputePass* compute_pass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("void*")] + public static extern IntPtr SDL_MapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transfer_buffer, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UnmapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transfer_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUCopyPass* SDL_BeginGPUCopyPass(SDL_GPUCommandBuffer* command_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UploadToGPUTexture(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTextureTransferInfo *")] SDL_GPUTextureTransferInfo* source, [NativeTypeName("const SDL_GPUTextureRegion *")] SDL_GPUTextureRegion* destination, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_UploadToGPUBuffer(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTransferBufferLocation *")] SDL_GPUTransferBufferLocation* source, [NativeTypeName("const SDL_GPUBufferRegion *")] SDL_GPUBufferRegion* destination, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_CopyGPUTextureToTexture(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTextureLocation *")] SDL_GPUTextureLocation* source, [NativeTypeName("const SDL_GPUTextureLocation *")] SDL_GPUTextureLocation* destination, [NativeTypeName("Uint32")] uint w, [NativeTypeName("Uint32")] uint h, [NativeTypeName("Uint32")] uint d, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_CopyGPUBufferToBuffer(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUBufferLocation *")] SDL_GPUBufferLocation* source, [NativeTypeName("const SDL_GPUBufferLocation *")] SDL_GPUBufferLocation* destination, [NativeTypeName("Uint32")] uint size, SDL_bool cycle); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DownloadFromGPUTexture(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTextureRegion *")] SDL_GPUTextureRegion* source, [NativeTypeName("const SDL_GPUTextureTransferInfo *")] SDL_GPUTextureTransferInfo* destination); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DownloadFromGPUBuffer(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUBufferRegion *")] SDL_GPUBufferRegion* source, [NativeTypeName("const SDL_GPUTransferBufferLocation *")] SDL_GPUTransferBufferLocation* destination); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_EndGPUCopyPass(SDL_GPUCopyPass* copy_pass); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_GenerateMipmapsForGPUTexture(SDL_GPUCommandBuffer* command_buffer, SDL_GPUTexture* texture); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_BlitGPUTexture(SDL_GPUCommandBuffer* command_buffer, [NativeTypeName("const SDL_GPUBlitInfo *")] SDL_GPUBlitInfo* info); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_WindowSupportsGPUSwapchainComposition(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUSwapchainComposition swapchain_composition); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_WindowSupportsGPUPresentMode(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUPresentMode present_mode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_ClaimWindowForGPUDevice(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseWindowFromGPUDevice(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_SetGPUSwapchainParameters(SDL_GPUDevice* device, SDL_Window* window, SDL_GPUSwapchainComposition swapchain_composition, SDL_GPUPresentMode present_mode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTextureFormat SDL_GetGPUSwapchainTextureFormat(SDL_GPUDevice* device, SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUTexture* SDL_AcquireGPUSwapchainTexture(SDL_GPUCommandBuffer* command_buffer, SDL_Window* window, [NativeTypeName("Uint32 *")] uint* w, [NativeTypeName("Uint32 *")] uint* h); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_SubmitGPUCommandBuffer(SDL_GPUCommandBuffer* command_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPUFence* SDL_SubmitGPUCommandBufferAndAcquireFence(SDL_GPUCommandBuffer* command_buffer); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_WaitForGPUIdle(SDL_GPUDevice* device); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_WaitForGPUFences(SDL_GPUDevice* device, SDL_bool wait_all, [NativeTypeName("SDL_GPUFence *const *")] SDL_GPUFence** fences, [NativeTypeName("Uint32")] uint num_fences); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_QueryGPUFence(SDL_GPUDevice* device, SDL_GPUFence* fence); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_ReleaseGPUFence(SDL_GPUDevice* device, SDL_GPUFence* fence); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint SDL_GPUTextureFormatTexelBlockSize(SDL_GPUTextureFormat format); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUTextureSupportsFormat(SDL_GPUDevice* device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_GPUTextureSupportsSampleCount(SDL_GPUDevice* device, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0)")] + public const uint SDL_GPU_TEXTUREUSAGE_SAMPLER = (1U << 0); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_COLOR_TARGET (1u << 1)")] + public const uint SDL_GPU_TEXTUREUSAGE_COLOR_TARGET = (1U << 1); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET (1u << 2)")] + public const uint SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET = (1U << 2); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ (1u << 3)")] + public const uint SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ = (1U << 3); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ (1u << 4)")] + public const uint SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ = (1U << 4); + + [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)")] + public const uint SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE = (1U << 5); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_VERTEX (1u << 0)")] + public const uint SDL_GPU_BUFFERUSAGE_VERTEX = (1U << 0); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_INDEX (1u << 1)")] + public const uint SDL_GPU_BUFFERUSAGE_INDEX = (1U << 1); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_INDIRECT (1u << 2)")] + public const uint SDL_GPU_BUFFERUSAGE_INDIRECT = (1U << 2); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ (1u << 3)")] + public const uint SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ = (1U << 3); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ (1u << 4)")] + public const uint SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ = (1U << 4); + + [NativeTypeName("#define SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE (1u << 5)")] + public const uint SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE = (1U << 5); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_INVALID 0")] + public const int SDL_GPU_SHADERFORMAT_INVALID = 0; + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0)")] + public const uint SDL_GPU_SHADERFORMAT_PRIVATE = (1U << 0); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 1)")] + public const uint SDL_GPU_SHADERFORMAT_SPIRV = (1U << 1); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2)")] + public const uint SDL_GPU_SHADERFORMAT_DXBC = (1U << 2); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3)")] + public const uint SDL_GPU_SHADERFORMAT_DXIL = (1U << 3); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_MSL (1u << 4)")] + public const uint SDL_GPU_SHADERFORMAT_MSL = (1U << 4); + + [NativeTypeName("#define SDL_GPU_SHADERFORMAT_METALLIB (1u << 5)")] + public const uint SDL_GPU_SHADERFORMAT_METALLIB = (1U << 5); + + [NativeTypeName("#define SDL_GPU_COLORCOMPONENT_R (1u << 0)")] + public const uint SDL_GPU_COLORCOMPONENT_R = (1U << 0); + + [NativeTypeName("#define SDL_GPU_COLORCOMPONENT_G (1u << 1)")] + public const uint SDL_GPU_COLORCOMPONENT_G = (1U << 1); + + [NativeTypeName("#define SDL_GPU_COLORCOMPONENT_B (1u << 2)")] + public const uint SDL_GPU_COLORCOMPONENT_B = (1U << 2); + + [NativeTypeName("#define SDL_GPU_COLORCOMPONENT_A (1u << 3)")] + public const uint SDL_GPU_COLORCOMPONENT_A = (1U << 3); + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT \"SDL.gpu.createtexture.d3d12.clear.r\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT => "SDL.gpu.createtexture.d3d12.clear.r"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT \"SDL.gpu.createtexture.d3d12.clear.g\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT => "SDL.gpu.createtexture.d3d12.clear.g"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT \"SDL.gpu.createtexture.d3d12.clear.b\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT => "SDL.gpu.createtexture.d3d12.clear.b"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT \"SDL.gpu.createtexture.d3d12.clear.a\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT => "SDL.gpu.createtexture.d3d12.clear.a"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT \"SDL.gpu.createtexture.d3d12.clear.depth\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT => "SDL.gpu.createtexture.d3d12.clear.depth"u8; + + [NativeTypeName("#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 \"SDL.gpu.createtexture.d3d12.clear.stencil\"")] + public static ReadOnlySpan SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 => "SDL.gpu.createtexture.d3d12.clear.stencil"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL \"SDL.gpu.device.create.debugmode\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL => "SDL.gpu.device.create.debugmode"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL \"SDL.gpu.device.create.preferlowpower\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL => "SDL.gpu.device.create.preferlowpower"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING \"SDL.gpu.device.create.name\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => "SDL.gpu.device.create.name"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL \"SDL.gpu.device.create.shaders.private\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL => "SDL.gpu.device.create.shaders.private"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL \"SDL.gpu.device.create.shaders.spirv\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL => "SDL.gpu.device.create.shaders.spirv"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL \"SDL.gpu.device.create.shaders.dxbc\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL => "SDL.gpu.device.create.shaders.dxbc"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL \"SDL.gpu.device.create.shaders.dxil\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL => "SDL.gpu.device.create.shaders.dxil"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL \"SDL.gpu.device.create.shaders.msl\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL => "SDL.gpu.device.create.shaders.msl"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL \"SDL.gpu.device.create.shaders.metallib\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL => "SDL.gpu.device.create.shaders.metallib"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING \"SDL.gpu.device.create.d3d12.semantic\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => "SDL.gpu.device.create.d3d12.semantic"u8; + } +} diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs index 7ff4ade..0337114 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs @@ -380,46 +380,46 @@ namespace SDL public static extern int SDL_CreateHapticEffect(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data); + public static extern SDL_bool SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations); + public static extern SDL_bool SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StopHapticEffect(SDL_Haptic* haptic, int effect); + public static extern SDL_bool SDL_StopHapticEffect(SDL_Haptic* haptic, int effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyHapticEffect(SDL_Haptic* haptic, int effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect); + public static extern SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetHapticGain(SDL_Haptic* haptic, int gain); + public static extern SDL_bool SDL_SetHapticGain(SDL_Haptic* haptic, int gain); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter); + public static extern SDL_bool SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PauseHaptic(SDL_Haptic* haptic); + public static extern SDL_bool SDL_PauseHaptic(SDL_Haptic* haptic); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ResumeHaptic(SDL_Haptic* haptic); + public static extern SDL_bool SDL_ResumeHaptic(SDL_Haptic* haptic); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StopHapticEffects(SDL_Haptic* haptic); + public static extern SDL_bool SDL_StopHapticEffects(SDL_Haptic* haptic); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_HapticRumbleSupported(SDL_Haptic* haptic); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_InitHapticRumble(SDL_Haptic* haptic); + public static extern SDL_bool SDL_InitHapticRumble(SDL_Haptic* haptic); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length); + public static extern SDL_bool SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StopHapticRumble(SDL_Haptic* haptic); + public static extern SDL_bool SDL_StopHapticRumble(SDL_Haptic* haptic); [NativeTypeName("#define SDL_HAPTIC_CONSTANT (1u<<0)")] public const uint SDL_HAPTIC_CONSTANT = (1U << 0); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs index 2dfc620..ce92dd5 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs @@ -38,13 +38,13 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetHintWithPriority([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_HintPriority priority); + public static extern SDL_bool SDL_SetHintWithPriority([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_HintPriority priority); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); + public static extern SDL_bool SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ResetHint([NativeTypeName("const char *")] byte* name); + public static extern SDL_bool SDL_ResetHint([NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_ResetHints(); @@ -57,10 +57,10 @@ namespace SDL public static extern SDL_bool SDL_GetHintBoolean([NativeTypeName("const char *")] byte* name, SDL_bool default_value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_DelHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern void SDL_RemoveHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"u8; @@ -221,6 +221,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_HIDAPI_UDEV \"SDL_HIDAPI_UDEV\"")] public static ReadOnlySpan SDL_HINT_HIDAPI_UDEV => "SDL_HIDAPI_UDEV"u8; + [NativeTypeName("#define SDL_HINT_GPU_DRIVER \"SDL_GPU_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_GPU_DRIVER => "SDL_GPU_DRIVER"u8; + [NativeTypeName("#define SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS \"SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS\"")] public static ReadOnlySpan SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS => "SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS"u8; @@ -257,6 +260,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED \"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED => "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMEINPUT \"SDL_JOYSTICK_GAMEINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMEINPUT => "SDL_JOYSTICK_GAMEINPUT"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES \"SDL_JOYSTICK_GAMECUBE_DEVICES\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_DEVICES => "SDL_JOYSTICK_GAMECUBE_DEVICES"u8; @@ -488,12 +494,6 @@ namespace SDL [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_ORIENTATIONS\"")] public static ReadOnlySpan SDL_HINT_ORIENTATIONS => "SDL_ORIENTATIONS"u8; - [NativeTypeName("#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON \"SDL_PEN_DELAY_MOUSE_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_PEN_DELAY_MOUSE_BUTTON => "SDL_PEN_DELAY_MOUSE_BUTTON"u8; - - [NativeTypeName("#define SDL_HINT_PEN_NOT_MOUSE \"SDL_PEN_NOT_MOUSE\"")] - public static ReadOnlySpan SDL_HINT_PEN_NOT_MOUSE => "SDL_PEN_NOT_MOUSE"u8; - [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => "SDL_POLL_SENTINEL"u8; @@ -512,6 +512,12 @@ namespace SDL [NativeTypeName("#define SDL_HINT_RENDER_VULKAN_DEBUG \"SDL_RENDER_VULKAN_DEBUG\"")] public static ReadOnlySpan SDL_HINT_RENDER_VULKAN_DEBUG => "SDL_RENDER_VULKAN_DEBUG"u8; + [NativeTypeName("#define SDL_HINT_RENDER_GPU_DEBUG \"SDL_RENDER_GPU_DEBUG\"")] + public static ReadOnlySpan SDL_HINT_RENDER_GPU_DEBUG => "SDL_RENDER_GPU_DEBUG"u8; + + [NativeTypeName("#define SDL_HINT_RENDER_GPU_LOW_POWER \"SDL_RENDER_GPU_LOW_POWER\"")] + public static ReadOnlySpan SDL_HINT_RENDER_GPU_LOW_POWER => "SDL_RENDER_GPU_LOW_POWER"u8; + [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => "SDL_RENDER_DRIVER"u8; @@ -695,6 +701,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => "SDL_WINDOWS_ENABLE_MESSAGELOOP"u8; + [NativeTypeName("#define SDL_HINT_WINDOWS_GAMEINPUT \"SDL_WINDOWS_GAMEINPUT\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_GAMEINPUT => "SDL_WINDOWS_GAMEINPUT"u8; + [NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD \"SDL_WINDOWS_RAW_KEYBOARD\"")] public static ReadOnlySpan SDL_HINT_WINDOWS_RAW_KEYBOARD => "SDL_WINDOWS_RAW_KEYBOARD"u8; @@ -713,15 +722,6 @@ namespace SDL [NativeTypeName("#define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE \"SDL_WINDOWS_ERASE_BACKGROUND_MODE\"")] public static ReadOnlySpan SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE => "SDL_WINDOWS_ERASE_BACKGROUND_MODE"u8; - [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => "SDL_WINRT_HANDLE_BACK_BUTTON"u8; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => "SDL_WINRT_PRIVACY_POLICY_LABEL"u8; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => "SDL_WINRT_PRIVACY_POLICY_URL"u8; - [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => "SDL_X11_FORCE_OVERRIDE_REDIRECT"u8; @@ -733,5 +733,8 @@ namespace SDL [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => "SDL_XINPUT_ENABLED"u8; + + [NativeTypeName("#define SDL_HINT_ASSERT \"SDL_ASSERT\"")] + public static ReadOnlySpan SDL_HINT_ASSERT => "SDL_ASSERT"u8; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_init.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_init.g.cs index 4e92f26..a471a98 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_init.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_init.g.cs @@ -28,13 +28,20 @@ using System.Runtime.InteropServices; namespace SDL { + public enum SDL_AppResult + { + SDL_APP_CONTINUE, + SDL_APP_SUCCESS, + SDL_APP_FAILURE, + } + public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_Init(SDL_InitFlags flags); + public static extern SDL_bool SDL_Init(SDL_InitFlags flags); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_InitSubSystem(SDL_InitFlags flags); + public static extern SDL_bool SDL_InitSubSystem(SDL_InitFlags flags); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_QuitSubSystem(SDL_InitFlags flags); @@ -46,10 +53,10 @@ namespace SDL public static extern void SDL_Quit(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAppMetadata([NativeTypeName("const char *")] byte* appname, [NativeTypeName("const char *")] byte* appversion, [NativeTypeName("const char *")] byte* appidentifier); + public static extern SDL_bool SDL_SetAppMetadata([NativeTypeName("const char *")] byte* appname, [NativeTypeName("const char *")] byte* appversion, [NativeTypeName("const char *")] byte* appidentifier); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetAppMetadataProperty([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); + public static extern SDL_bool SDL_SetAppMetadataProperty([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAppMetadataProperty", ExactSpelling = true)] [return: NativeTypeName("const char *")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs index 9cd8436..192c447 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs @@ -47,6 +47,9 @@ namespace SDL public unsafe partial struct SDL_IOStreamInterface { + [NativeTypeName("Uint32")] + public uint version; + [NativeTypeName("Sint64 (*)(void *)")] public delegate* unmanaged[Cdecl] size; @@ -59,8 +62,11 @@ namespace SDL [NativeTypeName("size_t (*)(void *, const void *, size_t, SDL_IOStatus *)")] public delegate* unmanaged[Cdecl] write; - [NativeTypeName("int (*)(void *)")] - public delegate* unmanaged[Cdecl] close; + [NativeTypeName("SDL_bool (*)(void *, SDL_IOStatus *)")] + public delegate* unmanaged[Cdecl] flush; + + [NativeTypeName("SDL_bool (*)(void *)")] + public delegate* unmanaged[Cdecl] close; } public partial struct SDL_IOStream @@ -85,7 +91,7 @@ namespace SDL public static extern SDL_IOStream* SDL_OpenIO([NativeTypeName("const SDL_IOStreamInterface *")] SDL_IOStreamInterface* iface, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CloseIO(SDL_IOStream* context); + public static extern SDL_bool SDL_CloseIO(SDL_IOStream* context); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream* context); @@ -121,6 +127,9 @@ namespace SDL [return: NativeTypeName("size_t")] public static extern nuint SDL_IOvprintf(SDL_IOStream* context, [NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_FlushIO(SDL_IOStream* context); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] public static extern IntPtr SDL_LoadFile_IO(SDL_IOStream* src, [NativeTypeName("size_t *")] nuint* datasize, SDL_bool closeio); @@ -219,6 +228,9 @@ namespace SDL [NativeTypeName("#define SDL_PROP_IOSTREAM_STDIO_FILE_POINTER \"SDL.iostream.stdio.file\"")] public static ReadOnlySpan SDL_PROP_IOSTREAM_STDIO_FILE_POINTER => "SDL.iostream.stdio.file"u8; + [NativeTypeName("#define SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER \"SDL.iostream.file_descriptor\"")] + public static ReadOnlySpan SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER => "SDL.iostream.file_descriptor"u8; + [NativeTypeName("#define SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER \"SDL.iostream.android.aasset\"")] public static ReadOnlySpan SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER => "SDL.iostream.android.aasset"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs index 93c33e7..29b227d 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs @@ -45,6 +45,7 @@ namespace SDL SDL_JOYSTICK_TYPE_DRUM_KIT, SDL_JOYSTICK_TYPE_ARCADE_PAD, SDL_JOYSTICK_TYPE_THROTTLE, + SDL_JOYSTICK_TYPE_COUNT, } public enum SDL_JoystickConnectionState @@ -79,6 +80,9 @@ namespace SDL public unsafe partial struct SDL_VirtualJoystickDesc { + [NativeTypeName("Uint32")] + public uint version; + [NativeTypeName("Uint16")] public ushort type; @@ -136,20 +140,23 @@ namespace SDL [NativeTypeName("void (*)(void *, int)")] public delegate* unmanaged[Cdecl] SetPlayerIndex; - [NativeTypeName("int (*)(void *, Uint16, Uint16)")] - public delegate* unmanaged[Cdecl] Rumble; + [NativeTypeName("SDL_bool (*)(void *, Uint16, Uint16)")] + public delegate* unmanaged[Cdecl] Rumble; - [NativeTypeName("int (*)(void *, Uint16, Uint16)")] - public delegate* unmanaged[Cdecl] RumbleTriggers; + [NativeTypeName("SDL_bool (*)(void *, Uint16, Uint16)")] + public delegate* unmanaged[Cdecl] RumbleTriggers; - [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8)")] - public delegate* unmanaged[Cdecl] SetLED; + [NativeTypeName("SDL_bool (*)(void *, Uint8, Uint8, Uint8)")] + public delegate* unmanaged[Cdecl] SetLED; - [NativeTypeName("int (*)(void *, const void *, int)")] - public delegate* unmanaged[Cdecl] SendEffect; + [NativeTypeName("SDL_bool (*)(void *, const void *, int)")] + public delegate* unmanaged[Cdecl] SendEffect; - [NativeTypeName("int (*)(void *, SDL_bool)")] - public delegate* unmanaged[Cdecl] SetSensorsEnabled; + [NativeTypeName("SDL_bool (*)(void *, SDL_bool)")] + public delegate* unmanaged[Cdecl] SetSensorsEnabled; + + [NativeTypeName("void (*)(void *)")] + public delegate* unmanaged[Cdecl] Cleanup; [InlineArray(2)] public partial struct _padding2_e__FixedBuffer @@ -214,28 +221,28 @@ namespace SDL public static extern SDL_JoystickID SDL_AttachVirtualJoystick([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_DetachVirtualJoystick(SDL_JoystickID instance_id); + public static extern SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); + public static extern SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickVirtualBall(SDL_Joystick* joystick, int ball, [NativeTypeName("Sint16")] short xrel, [NativeTypeName("Sint16")] short yrel); + public static extern SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick* joystick, int ball, [NativeTypeName("Sint16")] short xrel, [NativeTypeName("Sint16")] short yrel); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value); + public static extern SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, SDL_bool down); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); + public static extern SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, [NativeTypeName("Uint8")] byte state, float x, float y, float pressure); + public static extern SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SendJoystickVirtualSensorData(SDL_Joystick* joystick, SDL_SensorType type, [NativeTypeName("Uint64")] ulong sensor_timestamp, [NativeTypeName("const float *")] float* data, int num_values); + public static extern SDL_bool SDL_SendJoystickVirtualSensorData(SDL_Joystick* joystick, SDL_SensorType type, [NativeTypeName("Uint64")] ulong sensor_timestamp, [NativeTypeName("const float *")] float* data, int num_values); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_PropertiesID SDL_GetJoystickProperties(SDL_Joystick* joystick); @@ -252,7 +259,7 @@ namespace SDL public static extern int SDL_GetJoystickPlayerIndex(SDL_Joystick* joystick); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickPlayerIndex(SDL_Joystick* joystick, int player_index); + public static extern SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick* joystick, int player_index); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_GUID SDL_GetJoystickGUID(SDL_Joystick* joystick); @@ -318,27 +325,26 @@ namespace SDL public static extern SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetJoystickBall(SDL_Joystick* joystick, int ball, int* dx, int* dy); + public static extern SDL_bool SDL_GetJoystickBall(SDL_Joystick* joystick, int ball, int* dx, int* dy); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint8")] public static extern byte SDL_GetJoystickHat(SDL_Joystick* joystick, int hat); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte SDL_GetJoystickButton(SDL_Joystick* joystick, int button); + public static extern SDL_bool SDL_GetJoystickButton(SDL_Joystick* joystick, int button); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RumbleJoystick(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); + public static extern SDL_bool SDL_RumbleJoystick(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RumbleJoystickTriggers(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); + public static extern SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetJoystickLED(SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); + public static extern SDL_bool SDL_SetJoystickLED(SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SendJoystickEffect(SDL_Joystick* joystick, [NativeTypeName("const void *")] IntPtr data, int size); + public static extern SDL_bool SDL_SendJoystickEffect(SDL_Joystick* joystick, [NativeTypeName("const void *")] IntPtr data, int size); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CloseJoystick(SDL_Joystick* joystick); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_keyboard.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_keyboard.g.cs index 845b98a..1f53dd3 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_keyboard.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_keyboard.g.cs @@ -65,8 +65,8 @@ namespace SDL public static extern SDL_Window* SDL_GetKeyboardFocus(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const Uint8 *")] - public static extern byte* SDL_GetKeyboardState(int* numkeys); + [return: NativeTypeName("const SDL_bool *")] + public static extern SDL_bool* SDL_GetKeyboardState(int* numkeys); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_ResetKeyboard(); @@ -84,7 +84,7 @@ namespace SDL public static extern SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod* modstate); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name); + public static extern SDL_bool SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)] [return: NativeTypeName("const char *")] @@ -101,25 +101,25 @@ namespace SDL public static extern SDL_Keycode SDL_GetKeyFromName([NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StartTextInput(SDL_Window* window); + public static extern SDL_bool SDL_StartTextInput(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StartTextInputWithProperties(SDL_Window* window, SDL_PropertiesID props); + public static extern SDL_bool SDL_StartTextInputWithProperties(SDL_Window* window, SDL_PropertiesID props); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_TextInputActive(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_StopTextInput(SDL_Window* window); + public static extern SDL_bool SDL_StopTextInput(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearComposition(SDL_Window* window); + public static extern SDL_bool SDL_ClearComposition(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor); + public static extern SDL_bool SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor); + public static extern SDL_bool SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_HasScreenKeyboardSupport(); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs index f3c8092..5ff9d1b 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_log.g.cs @@ -39,7 +39,7 @@ namespace SDL SDL_LOG_CATEGORY_RENDER, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, - SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_RESERVED2, SDL_LOG_CATEGORY_RESERVED3, SDL_LOG_CATEGORY_RESERVED4, @@ -60,7 +60,7 @@ namespace SDL SDL_LOG_PRIORITY_WARN, SDL_LOG_PRIORITY_ERROR, SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES, + SDL_LOG_PRIORITY_COUNT, } public static unsafe partial class SDL3 @@ -78,7 +78,7 @@ namespace SDL public static extern void SDL_ResetLogPriorities(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetLogPriorityPrefix(SDL_LogPriority priority, [NativeTypeName("const char *")] byte* prefix); + public static extern SDL_bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, [NativeTypeName("const char *")] byte* prefix); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_Log([NativeTypeName("const char *")] byte* fmt, __arglist); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_main.GDK.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_main.GDK.g.cs new file mode 100644 index 0000000..6fecaff --- /dev/null +++ b/SDL3-CS/SDL3/ClangSharp/SDL_main.GDK.g.cs @@ -0,0 +1,37 @@ +/* + + C# bindings for Simple DirectMedia Layer. + Original copyright notice of input files: + + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +using System.Runtime.InteropServices; +using System.Runtime.Versioning; + +namespace SDL +{ + public static partial class SDL3 + { + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [SupportedOSPlatform("Windows")] + public static extern void SDL_GDKSuspendComplete(); + } +} diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_main.Windows.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_main.Windows.g.cs index d2e4bd4..9f31b69 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_main.Windows.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_main.Windows.g.cs @@ -33,14 +33,10 @@ namespace SDL { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] - public static extern int SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst); + public static extern SDL_bool SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] public static extern void SDL_UnregisterApp(); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [SupportedOSPlatform("Windows")] - public static extern void SDL_GDKSuspendComplete(); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs index de43933..47508a2 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs @@ -37,6 +37,6 @@ namespace SDL public static extern int SDL_RunApp(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_main_func")] delegate* unmanaged[Cdecl] mainFunction, [NativeTypeName("void*")] IntPtr reserved); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_EnterAppMainCallbacks(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_AppInit_func")] delegate* unmanaged[Cdecl] appinit, [NativeTypeName("SDL_AppIterate_func")] delegate* unmanaged[Cdecl] appiter, [NativeTypeName("SDL_AppEvent_func")] delegate* unmanaged[Cdecl] appevent, [NativeTypeName("SDL_AppQuit_func")] delegate* unmanaged[Cdecl] appquit); + public static extern int SDL_EnterAppMainCallbacks(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_AppInit_func")] delegate* unmanaged[Cdecl] appinit, [NativeTypeName("SDL_AppIterate_func")] delegate* unmanaged[Cdecl] appiter, [NativeTypeName("SDL_AppEvent_func")] delegate* unmanaged[Cdecl] appevent, [NativeTypeName("SDL_AppQuit_func")] delegate* unmanaged[Cdecl] appquit); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_messagebox.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_messagebox.g.cs index 31eac7f..32c4d59 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_messagebox.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_messagebox.g.cs @@ -57,7 +57,7 @@ namespace SDL SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, - SDL_MESSAGEBOX_COLOR_MAX, + SDL_MESSAGEBOX_COLOR_COUNT, } public partial struct SDL_MessageBoxColorScheme @@ -96,10 +96,10 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid); + public static extern SDL_bool SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, [NativeTypeName("const char *")] byte* title, [NativeTypeName("const char *")] byte* message, SDL_Window* window); + public static extern SDL_bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, [NativeTypeName("const char *")] byte* title, [NativeTypeName("const char *")] byte* message, SDL_Window* window); [NativeTypeName("#define SDL_MESSAGEBOX_ERROR 0x00000010u")] public const uint SDL_MESSAGEBOX_ERROR = 0x00000010U; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_misc.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_misc.g.cs index d4d6b7e..4ff0b8c 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_misc.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_misc.g.cs @@ -30,6 +30,6 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_OpenURL([NativeTypeName("const char *")] byte* url); + public static extern SDL_bool SDL_OpenURL([NativeTypeName("const char *")] byte* url); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs index ab78696..b9bcb0c 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs @@ -53,7 +53,7 @@ namespace SDL SDL_SYSTEM_CURSOR_S_RESIZE, SDL_SYSTEM_CURSOR_SW_RESIZE, SDL_SYSTEM_CURSOR_W_RESIZE, - SDL_NUM_SYSTEM_CURSORS, + SDL_SYSTEM_CURSOR_COUNT, } public enum SDL_MouseWheelDirection @@ -90,16 +90,16 @@ namespace SDL public static extern void SDL_WarpMouseInWindow(SDL_Window* window, float x, float y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WarpMouseGlobal(float x, float y); + public static extern SDL_bool SDL_WarpMouseGlobal(float x, float y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRelativeMouseMode(SDL_bool enabled); + public static extern SDL_bool SDL_SetWindowRelativeMouseMode(SDL_Window* window, SDL_bool enabled); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CaptureMouse(SDL_bool enabled); + public static extern SDL_bool SDL_GetWindowRelativeMouseMode(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_bool SDL_GetRelativeMouseMode(); + public static extern SDL_bool SDL_CaptureMouse(SDL_bool enabled); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Cursor* SDL_CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y); @@ -111,7 +111,7 @@ namespace SDL public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetCursor(SDL_Cursor* cursor); + public static extern SDL_bool SDL_SetCursor(SDL_Cursor* cursor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Cursor* SDL_GetCursor(); @@ -123,10 +123,10 @@ namespace SDL public static extern void SDL_DestroyCursor(SDL_Cursor* cursor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ShowCursor(); + public static extern SDL_bool SDL_ShowCursor(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_HideCursor(); + public static extern SDL_bool SDL_HideCursor(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_CursorVisible(); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_mutex.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_mutex.g.cs index 428bf48..fbb03d1 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_mutex.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_mutex.g.cs @@ -52,7 +52,7 @@ namespace SDL public static extern void SDL_LockMutex(SDL_Mutex* mutex); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_TryLockMutex(SDL_Mutex* mutex); + public static extern SDL_bool SDL_TryLockMutex(SDL_Mutex* mutex); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnlockMutex(SDL_Mutex* mutex); @@ -70,10 +70,10 @@ namespace SDL public static extern void SDL_LockRWLockForWriting(SDL_RWLock* rwlock); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_TryLockRWLockForReading(SDL_RWLock* rwlock); + public static extern SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock* rwlock); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock); + public static extern SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnlockRWLock(SDL_RWLock* rwlock); @@ -88,16 +88,16 @@ namespace SDL public static extern void SDL_DestroySemaphore(SDL_Semaphore* sem); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WaitSemaphore(SDL_Semaphore* sem); + public static extern void SDL_WaitSemaphore(SDL_Semaphore* sem); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_TryWaitSemaphore(SDL_Semaphore* sem); + public static extern SDL_bool SDL_TryWaitSemaphore(SDL_Semaphore* sem); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS); + public static extern SDL_bool SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SignalSemaphore(SDL_Semaphore* sem); + public static extern void SDL_SignalSemaphore(SDL_Semaphore* sem); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint32")] @@ -110,21 +110,15 @@ namespace SDL public static extern void SDL_DestroyCondition(SDL_Condition* cond); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SignalCondition(SDL_Condition* cond); + public static extern void SDL_SignalCondition(SDL_Condition* cond); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BroadcastCondition(SDL_Condition* cond); + public static extern void SDL_BroadcastCondition(SDL_Condition* cond); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WaitCondition(SDL_Condition* cond, SDL_Mutex* mutex); + public static extern void SDL_WaitCondition(SDL_Condition* cond, SDL_Mutex* mutex); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS); - - [NativeTypeName("#define SDL_MUTEX_TIMEDOUT 1")] - public const int SDL_MUTEX_TIMEDOUT = 1; - - [NativeTypeName("#define SDL_RWLOCK_TIMEDOUT SDL_MUTEX_TIMEDOUT")] - public const int SDL_RWLOCK_TIMEDOUT = 1; + public static extern SDL_bool SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_pen.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_pen.g.cs index 210a25b..0d7e382 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_pen.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_pen.g.cs @@ -23,125 +23,41 @@ 3. This notice may not be removed or altered from any source distribution. */ -using System.Runtime.InteropServices; -using static SDL.SDL_PenAxis; - namespace SDL { public enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, + SDL_PEN_AXIS_PRESSURE, SDL_PEN_AXIS_XTILT, SDL_PEN_AXIS_YTILT, SDL_PEN_AXIS_DISTANCE, SDL_PEN_AXIS_ROTATION, SDL_PEN_AXIS_SLIDER, - SDL_PEN_NUM_AXES, - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1, + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, + SDL_PEN_AXIS_COUNT, } - public enum SDL_PenSubtype + public static partial class SDL3 { - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, - SDL_PEN_TYPE_PEN, - SDL_PEN_TYPE_PENCIL, - SDL_PEN_TYPE_BRUSH, - SDL_PEN_TYPE_AIRBRUSH, - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH, - } + [NativeTypeName("#define SDL_PEN_INPUT_DOWN (1u << 0)")] + public const uint SDL_PEN_INPUT_DOWN = (1U << 0); - public partial struct SDL_PenCapabilityInfo - { - public float max_tilt; + [NativeTypeName("#define SDL_PEN_INPUT_BUTTON_1 (1u << 1)")] + public const uint SDL_PEN_INPUT_BUTTON_1 = (1U << 1); - [NativeTypeName("Uint32")] - public uint wacom_id; + [NativeTypeName("#define SDL_PEN_INPUT_BUTTON_2 (1u << 2)")] + public const uint SDL_PEN_INPUT_BUTTON_2 = (1U << 2); - [NativeTypeName("Sint8")] - public sbyte num_buttons; - } + [NativeTypeName("#define SDL_PEN_INPUT_BUTTON_3 (1u << 3)")] + public const uint SDL_PEN_INPUT_BUTTON_3 = (1U << 3); - public static unsafe partial class SDL3 - { - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_PenID* SDL_GetPens(int* count); + [NativeTypeName("#define SDL_PEN_INPUT_BUTTON_4 (1u << 4)")] + public const uint SDL_PEN_INPUT_BUTTON_4 = (1U << 4); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint SDL_GetPenStatus(SDL_PenID instance_id, float* x, float* y, float* axes, [NativeTypeName("size_t")] nuint num_axes); + [NativeTypeName("#define SDL_PEN_INPUT_BUTTON_5 (1u << 5)")] + public const uint SDL_PEN_INPUT_BUTTON_5 = (1U << 5); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_PenID SDL_GetPenFromGUID(SDL_GUID guid); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_GUID SDL_GetPenGUID(SDL_PenID instance_id); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_bool SDL_PenConnected(SDL_PenID instance_id); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPenName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Unsafe_SDL_GetPenName(SDL_PenID instance_id); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_PenCapabilityFlags SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo* capabilities); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_PenSubtype SDL_GetPenType(SDL_PenID instance_id); - - [NativeTypeName("#define SDL_PEN_INVALID ((SDL_PenID)0)")] - public const SDL_PenID SDL_PEN_INVALID = ((SDL_PenID)(0)); - - [NativeTypeName("#define SDL_PEN_INFO_UNKNOWN (-1)")] - public const int SDL_PEN_INFO_UNKNOWN = (-1); - - [NativeTypeName("#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13")] - public const int SDL_PEN_FLAG_DOWN_BIT_INDEX = 13; - - [NativeTypeName("#define SDL_PEN_FLAG_INK_BIT_INDEX 14")] - public const int SDL_PEN_FLAG_INK_BIT_INDEX = 14; - - [NativeTypeName("#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15")] - public const int SDL_PEN_FLAG_ERASER_BIT_INDEX = 15; - - [NativeTypeName("#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16")] - public const int SDL_PEN_FLAG_AXIS_BIT_OFFSET = 16; - - [NativeTypeName("#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX")] - public const int SDL_PEN_TIP_INK = 14; - - [NativeTypeName("#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX")] - public const int SDL_PEN_TIP_ERASER = 15; - - [NativeTypeName("#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX)")] - public const uint SDL_PEN_DOWN_MASK = (1U << (13)); - - [NativeTypeName("#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX)")] - public const uint SDL_PEN_INK_MASK = (1U << (14)); - - [NativeTypeName("#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX)")] - public const uint SDL_PEN_ERASER_MASK = (1U << (15)); - - [NativeTypeName("#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE)")] - public const uint SDL_PEN_AXIS_PRESSURE_MASK = (1U << ((int)(SDL_PEN_AXIS_PRESSURE) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT)")] - public const uint SDL_PEN_AXIS_XTILT_MASK = (1U << ((int)(SDL_PEN_AXIS_XTILT) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT)")] - public const uint SDL_PEN_AXIS_YTILT_MASK = (1U << ((int)(SDL_PEN_AXIS_YTILT) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE)")] - public const uint SDL_PEN_AXIS_DISTANCE_MASK = (1U << ((int)(SDL_PEN_AXIS_DISTANCE) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION)")] - public const uint SDL_PEN_AXIS_ROTATION_MASK = (1U << ((int)(SDL_PEN_AXIS_ROTATION) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER)")] - public const uint SDL_PEN_AXIS_SLIDER_MASK = (1U << ((int)(SDL_PEN_AXIS_SLIDER) + 16)); - - [NativeTypeName("#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK)")] - public const uint SDL_PEN_AXIS_BIDIRECTIONAL_MASKS = ((1U << ((int)(SDL_PEN_AXIS_XTILT) + 16)) | (1U << ((int)(SDL_PEN_AXIS_YTILT) + 16))); + [NativeTypeName("#define SDL_PEN_INPUT_ERASER_TIP (1u << 30)")] + public const uint SDL_PEN_INPUT_ERASER_TIP = (1U << 30); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs index 651f62e..1f3ae04 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs @@ -359,7 +359,7 @@ namespace SDL public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormat format); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); + public static extern SDL_bool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_PixelFormat SDL_GetPixelFormatForMasks(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); @@ -372,7 +372,7 @@ namespace SDL public static extern SDL_Palette* SDL_CreatePalette(int ncolors); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); + public static extern SDL_bool SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyPalette(SDL_Palette* palette); @@ -394,9 +394,15 @@ namespace SDL [NativeTypeName("#define SDL_ALPHA_OPAQUE 255")] public const int SDL_ALPHA_OPAQUE = 255; + [NativeTypeName("#define SDL_ALPHA_OPAQUE_FLOAT 1.0f")] + public const float SDL_ALPHA_OPAQUE_FLOAT = 1.0f; + [NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")] public const int SDL_ALPHA_TRANSPARENT = 0; + [NativeTypeName("#define SDL_ALPHA_TRANSPARENT_FLOAT 0.0f")] + public const float SDL_ALPHA_TRANSPARENT_FLOAT = 0.0f; + [NativeTypeName("#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888")] public const SDL_PixelFormat SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs new file mode 100644 index 0000000..01d7c5d --- /dev/null +++ b/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs @@ -0,0 +1,118 @@ +/* + + C# bindings for Simple DirectMedia Layer. + Original copyright notice of input files: + + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +using System; +using System.Runtime.InteropServices; + +namespace SDL +{ + public partial struct SDL_Process + { + } + + public enum SDL_ProcessIO + { + SDL_PROCESS_STDIO_INHERITED, + SDL_PROCESS_STDIO_NULL, + SDL_PROCESS_STDIO_APP, + SDL_PROCESS_STDIO_REDIRECT, + } + + public static unsafe partial class SDL3 + { + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_Process* SDL_CreateProcess([NativeTypeName("const char *const *")] byte** args, SDL_bool pipe_stdio); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_Process* SDL_CreateProcessWithProperties(SDL_PropertiesID props); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID SDL_GetProcessProperties(SDL_Process* process); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("void*")] + public static extern IntPtr SDL_ReadProcess(SDL_Process* process, [NativeTypeName("size_t *")] nuint* datasize, int* exitcode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_IOStream* SDL_GetProcessInput(SDL_Process* process); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_IOStream* SDL_GetProcessOutput(SDL_Process* process); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_KillProcess(SDL_Process* process, SDL_bool force); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_WaitProcess(SDL_Process* process, SDL_bool block, int* exitcode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DestroyProcess(SDL_Process* process); + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ARGS_POINTER \"SDL.process.create.args\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_ARGS_POINTER => "SDL.process.create.args"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER \"SDL.process.create.environment\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER => "SDL.process.create.environment"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_NUMBER \"SDL.process.create.stdin_option\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDIN_NUMBER => "SDL.process.create.stdin_option"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_POINTER \"SDL.process.create.stdin_source\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDIN_POINTER => "SDL.process.create.stdin_source"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER \"SDL.process.create.stdout_option\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER => "SDL.process.create.stdout_option"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_POINTER \"SDL.process.create.stdout_source\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDOUT_POINTER => "SDL.process.create.stdout_source"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_NUMBER \"SDL.process.create.stderr_option\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDERR_NUMBER => "SDL.process.create.stderr_option"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_POINTER \"SDL.process.create.stderr_source\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDERR_POINTER => "SDL.process.create.stderr_source"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN \"SDL.process.create.stderr_to_stdout\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN => "SDL.process.create.stderr_to_stdout"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN \"SDL.process.create.background\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN => "SDL.process.create.background"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_PID_NUMBER \"SDL.process.pid\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_PID_NUMBER => "SDL.process.pid"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_STDIN_POINTER \"SDL.process.stdin\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_STDIN_POINTER => "SDL.process.stdin"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_STDOUT_POINTER \"SDL.process.stdout\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_STDOUT_POINTER => "SDL.process.stdout"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_STDERR_POINTER \"SDL.process.stderr\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_STDERR_POINTER => "SDL.process.stderr"u8; + + [NativeTypeName("#define SDL_PROP_PROCESS_BACKGROUND_BOOLEAN \"SDL.process.background\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_BACKGROUND_BOOLEAN => "SDL.process.background"u8; + } +} diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs index eab1b75..8919bfa 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs @@ -47,31 +47,31 @@ namespace SDL public static extern SDL_PropertiesID SDL_CreateProperties(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); + public static extern SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LockProperties(SDL_PropertiesID props); + public static extern SDL_bool SDL_LockProperties(SDL_PropertiesID props); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnlockProperties(SDL_PropertiesID props); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl] cleanup, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl] cleanup, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value); + public static extern SDL_bool SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetStringProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); + public static extern SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value); + public static extern SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value); + public static extern SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool value); + public static extern SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_HasProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name); @@ -98,10 +98,10 @@ namespace SDL public static extern SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool default_value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name); + public static extern SDL_bool SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyProperties(SDL_PropertiesID props); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_rect.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_rect.g.cs index ae4d4ab..c3f6f53 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_rect.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_rect.g.cs @@ -95,7 +95,7 @@ namespace SDL public static extern SDL_bool SDL_GetRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRectUnion([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result); + public static extern SDL_bool SDL_GetRectUnion([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_GetRectEnclosingPoints([NativeTypeName("const SDL_Point *")] SDL_Point* points, int count, [NativeTypeName("const SDL_Rect *")] SDL_Rect* clip, SDL_Rect* result); @@ -130,7 +130,7 @@ namespace SDL public static extern SDL_bool SDL_GetRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRectUnionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result); + public static extern SDL_bool SDL_GetRectUnionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_GetRectEnclosingPointsFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count, [NativeTypeName("const SDL_FRect *")] SDL_FRect* clip, SDL_FRect* result); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs index 87cb504..527635a 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs @@ -71,7 +71,7 @@ namespace SDL public static extern byte* Unsafe_SDL_GetRenderDriver(int index); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CreateWindowAndRenderer([NativeTypeName("const char *")] byte* title, int width, int height, SDL_WindowFlags window_flags, SDL_Window** window, SDL_Renderer** renderer); + public static extern SDL_bool SDL_CreateWindowAndRenderer([NativeTypeName("const char *")] byte* title, int width, int height, SDL_WindowFlags window_flags, SDL_Window** window, SDL_Renderer** renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Renderer* SDL_CreateRenderer(SDL_Window* window, [NativeTypeName("const char *")] byte* name); @@ -96,10 +96,10 @@ namespace SDL public static extern SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h); + public static extern SDL_bool SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h); + public static extern SDL_bool SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, SDL_PixelFormat format, SDL_TextureAccess access, int w, int h); @@ -117,187 +117,187 @@ namespace SDL public static extern SDL_Renderer* SDL_GetRendererFromTexture(SDL_Texture* texture); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h); + public static extern SDL_bool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + public static extern SDL_bool SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b); + public static extern SDL_bool SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + public static extern SDL_bool SDL_GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b); + public static extern SDL_bool SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); + public static extern SDL_bool SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha); + public static extern SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); + public static extern SDL_bool SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha); + public static extern SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); + public static extern SDL_bool SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); + public static extern SDL_bool SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); + public static extern SDL_bool SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); + public static extern SDL_bool SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] IntPtr pixels, int pitch); + public static extern SDL_bool SDL_UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] IntPtr pixels, int pitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); + public static extern SDL_bool SDL_UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); + public static extern SDL_bool SDL_UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("void **")] IntPtr* pixels, int* pitch); + public static extern SDL_bool SDL_LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("void **")] IntPtr* pixels, int* pitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); + public static extern SDL_bool SDL_LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnlockTexture(SDL_Texture* texture); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); + public static extern SDL_bool SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Texture* SDL_GetRenderTarget(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderLogicalPresentation(SDL_Renderer* renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); + public static extern SDL_bool SDL_SetRenderLogicalPresentation(SDL_Renderer* renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode, SDL_ScaleMode* scale_mode); + public static extern SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode, SDL_ScaleMode* scale_mode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect); + public static extern SDL_bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y); + public static extern SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderCoordinatesToWindow(SDL_Renderer* renderer, float x, float y, float* window_x, float* window_y); + public static extern SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer* renderer, float x, float y, float* window_x, float* window_y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event); + public static extern SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + public static extern SDL_bool SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderViewport(SDL_Renderer* renderer, SDL_Rect* rect); + public static extern SDL_bool SDL_GetRenderViewport(SDL_Renderer* renderer, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_RenderViewportSet(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect); + public static extern SDL_bool SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + public static extern SDL_bool SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderClipRect(SDL_Renderer* renderer, SDL_Rect* rect); + public static extern SDL_bool SDL_GetRenderClipRect(SDL_Renderer* renderer, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_RenderClipEnabled(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY); + public static extern SDL_bool SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); + public static extern SDL_bool SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + public static extern SDL_bool SDL_SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a); + public static extern SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); + public static extern SDL_bool SDL_GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a); + public static extern SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale); + public static extern SDL_bool SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale); + public static extern SDL_bool SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); + public static extern SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); + public static extern SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderClear(SDL_Renderer* renderer); + public static extern SDL_bool SDL_RenderClear(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderPoint(SDL_Renderer* renderer, float x, float y); + public static extern SDL_bool SDL_RenderPoint(SDL_Renderer* renderer, float x, float y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + public static extern SDL_bool SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); + public static extern SDL_bool SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + public static extern SDL_bool SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + public static extern SDL_bool SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + public static extern SDL_bool SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + public static extern SDL_bool SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + public static extern SDL_bool SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderTexture(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); + public static extern SDL_bool SDL_RenderTexture(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderTextureRotated(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_FlipMode")] SDL_FlipMode flip); + public static extern SDL_bool SDL_RenderTextureRotated(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_FlipMode")] SDL_FlipMode flip); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderTextureTiled(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); + public static extern SDL_bool SDL_RenderTextureTiled(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderTexture9Grid(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); + public static extern SDL_bool SDL_RenderTexture9Grid(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderGeometry(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Vertex *")] SDL_Vertex* vertices, int num_vertices, [NativeTypeName("const int *")] int* indices, int num_indices); + public static extern SDL_bool SDL_RenderGeometry(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Vertex *")] SDL_Vertex* vertices, int num_vertices, [NativeTypeName("const int *")] int* indices, int num_indices); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices); + public static extern SDL_bool SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Surface* SDL_RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenderPresent(SDL_Renderer* renderer); + public static extern SDL_bool SDL_RenderPresent(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyTexture(SDL_Texture* texture); @@ -306,7 +306,7 @@ namespace SDL public static extern void SDL_DestroyRenderer(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FlushRenderer(SDL_Renderer* renderer); + public static extern SDL_bool SDL_FlushRenderer(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] @@ -317,49 +317,49 @@ namespace SDL public static extern IntPtr SDL_GetRenderMetalCommandEncoder(SDL_Renderer* renderer); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_AddVulkanRenderSemaphores(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint wait_stage_mask, [NativeTypeName("Sint64")] long wait_semaphore, [NativeTypeName("Sint64")] long signal_semaphore); + public static extern SDL_bool SDL_AddVulkanRenderSemaphores(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint wait_stage_mask, [NativeTypeName("Sint64")] long wait_semaphore, [NativeTypeName("Sint64")] long signal_semaphore); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync); + public static extern SDL_bool SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync); + public static extern SDL_bool SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync); [NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")] public static ReadOnlySpan SDL_SOFTWARE_RENDERER => "software"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"name\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_NAME_STRING => "name"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"SDL.renderer.create.name\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_NAME_STRING => "SDL.renderer.create.name"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER \"window\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_WINDOW_POINTER => "window"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER \"SDL.renderer.create.window\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_WINDOW_POINTER => "SDL.renderer.create.window"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER \"surface\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_SURFACE_POINTER => "surface"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER \"SDL.renderer.create.surface\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_SURFACE_POINTER => "SDL.renderer.create.surface"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER \"output_colorspace\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER => "output_colorspace"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.create.output_colorspace\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.create.output_colorspace"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"present_vsync\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "present_vsync"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"SDL.renderer.create.present_vsync\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "SDL.renderer.create.present_vsync"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER \"vulkan.instance\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => "vulkan.instance"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER \"SDL.renderer.create.vulkan.instance\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => "SDL.renderer.create.vulkan.instance"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER \"vulkan.surface\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER => "vulkan.surface"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER \"SDL.renderer.create.vulkan.surface\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER => "SDL.renderer.create.vulkan.surface"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER \"vulkan.physical_device\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER => "vulkan.physical_device"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER \"SDL.renderer.create.vulkan.physical_device\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER => "SDL.renderer.create.vulkan.physical_device"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER \"vulkan.device\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER => "vulkan.device"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER \"SDL.renderer.create.vulkan.device\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER => "SDL.renderer.create.vulkan.device"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER \"vulkan.graphics_queue_family_index\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER => "vulkan.graphics_queue_family_index"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER \"SDL.renderer.create.vulkan.graphics_queue_family_index\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER => "SDL.renderer.create.vulkan.graphics_queue_family_index"u8; - [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER \"vulkan.present_queue_family_index\"")] - public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER => "vulkan.present_queue_family_index"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER \"SDL.renderer.create.vulkan.present_queue_family_index\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER => "SDL.renderer.create.vulkan.present_queue_family_index"u8; [NativeTypeName("#define SDL_PROP_RENDERER_NAME_STRING \"SDL.renderer.name\"")] public static ReadOnlySpan SDL_PROP_RENDERER_NAME_STRING => "SDL.renderer.name"u8; @@ -430,74 +430,74 @@ namespace SDL [NativeTypeName("#define SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER \"SDL.renderer.vulkan.swapchain_image_count\"")] public static ReadOnlySpan SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER => "SDL.renderer.vulkan.swapchain_image_count"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER \"colorspace\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER => "colorspace"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER \"SDL.texture.create.colorspace\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER => "SDL.texture.create.colorspace"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER \"format\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER => "format"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER \"SDL.texture.create.format\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER => "SDL.texture.create.format"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER \"access\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER => "access"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER \"SDL.texture.create.access\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER => "SDL.texture.create.access"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER \"width\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER => "width"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER \"SDL.texture.create.width\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER => "SDL.texture.create.width"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"height\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "height"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"SDL.texture.create.height\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "SDL.texture.create.height"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDR_white_point\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDR_white_point"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDL.texture.create.SDR_white_point\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDL.texture.create.SDR_white_point"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT \"HDR_headroom\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT => "HDR_headroom"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT \"SDL.texture.create.HDR_headroom\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT => "SDL.texture.create.HDR_headroom"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER \"d3d11.texture\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER => "d3d11.texture"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER \"SDL.texture.create.d3d11.texture\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER => "SDL.texture.create.d3d11.texture"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER \"d3d11.texture_u\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER => "d3d11.texture_u"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER \"SDL.texture.create.d3d11.texture_u\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER => "SDL.texture.create.d3d11.texture_u"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER \"d3d11.texture_v\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER => "d3d11.texture_v"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER \"SDL.texture.create.d3d11.texture_v\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER => "SDL.texture.create.d3d11.texture_v"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER \"d3d12.texture\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER => "d3d12.texture"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER \"SDL.texture.create.d3d12.texture\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER => "SDL.texture.create.d3d12.texture"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER \"d3d12.texture_u\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER => "d3d12.texture_u"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER \"SDL.texture.create.d3d12.texture_u\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER => "SDL.texture.create.d3d12.texture_u"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER \"d3d12.texture_v\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER => "d3d12.texture_v"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER \"SDL.texture.create.d3d12.texture_v\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER => "SDL.texture.create.d3d12.texture_v"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER \"metal.pixelbuffer\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER => "metal.pixelbuffer"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER \"SDL.texture.create.metal.pixelbuffer\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER => "SDL.texture.create.metal.pixelbuffer"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER \"opengl.texture\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER => "opengl.texture"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER \"SDL.texture.create.opengl.texture\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER => "SDL.texture.create.opengl.texture"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER \"opengl.texture_uv\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER => "opengl.texture_uv"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER \"SDL.texture.create.opengl.texture_uv\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER => "SDL.texture.create.opengl.texture_uv"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER \"opengl.texture_u\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER => "opengl.texture_u"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER \"SDL.texture.create.opengl.texture_u\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER => "SDL.texture.create.opengl.texture_u"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER \"opengl.texture_v\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER => "opengl.texture_v"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER \"SDL.texture.create.opengl.texture_v\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER => "SDL.texture.create.opengl.texture_v"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER \"opengles2.texture\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER => "opengles2.texture"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER \"SDL.texture.create.opengles2.texture\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER => "SDL.texture.create.opengles2.texture"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER \"opengles2.texture_uv\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER => "opengles2.texture_uv"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER \"SDL.texture.create.opengles2.texture_uv\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER => "SDL.texture.create.opengles2.texture_uv"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER \"opengles2.texture_u\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER => "opengles2.texture_u"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER \"SDL.texture.create.opengles2.texture_u\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER => "SDL.texture.create.opengles2.texture_u"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER \"opengles2.texture_v\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER => "opengles2.texture_v"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER \"SDL.texture.create.opengles2.texture_v\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER => "SDL.texture.create.opengles2.texture_v"u8; - [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"vulkan.texture\"")] - public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "vulkan.texture"u8; + [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"SDL.texture.create.vulkan.texture\"")] + public static ReadOnlySpan SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "SDL.texture.create.vulkan.texture"u8; [NativeTypeName("#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER \"SDL.texture.colorspace\"")] public static ReadOnlySpan SDL_PROP_TEXTURE_COLORSPACE_NUMBER => "SDL.texture.colorspace"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_scancode.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_scancode.g.cs index ca1ccd8..ac15007 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_scancode.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_scancode.g.cs @@ -275,6 +275,6 @@ namespace SDL SDL_SCANCODE_CALL = 289, SDL_SCANCODE_ENDCALL = 290, SDL_SCANCODE_RESERVED = 400, - SDL_NUM_SCANCODES = 512, + SDL_SCANCODE_COUNT = 512, } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_sensor.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_sensor.g.cs index 4fcb8ce..0d1308c 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_sensor.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_sensor.g.cs @@ -81,7 +81,7 @@ namespace SDL public static extern SDL_SensorID SDL_GetSensorID(SDL_Sensor* sensor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSensorData(SDL_Sensor* sensor, float* data, int num_values); + public static extern SDL_bool SDL_GetSensorData(SDL_Sensor* sensor, float* data, int num_values); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CloseSensor(SDL_Sensor* sensor); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs index 7385e35..d41c1df 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs @@ -28,11 +28,24 @@ using System.Runtime.InteropServices; namespace SDL { + public partial struct SDL_alignment_test + { + [NativeTypeName("Uint8")] + public byte a; + + [NativeTypeName("void*")] + public IntPtr b; + } + public enum SDL_DUMMY_ENUM { DUMMY_ENUM_VALUE, } + public partial struct SDL_Environment + { + } + public partial struct SDL_iconv_data_t { } @@ -61,7 +74,7 @@ namespace SDL public static extern void SDL_GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl] malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl] calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl] realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl] free_func); + public static extern SDL_bool SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl] malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl] calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl] realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl] free_func); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("void*")] @@ -73,15 +86,41 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_GetNumAllocations(); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_getenv", ExactSpelling = true)] + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_Environment* SDL_GetEnvironment(); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_CleanupEnvironment(); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_Environment* SDL_CreateEnvironment(SDL_bool populated); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEnvironmentVariable", ExactSpelling = true)] [return: NativeTypeName("const char *")] - public static extern byte* Unsafe_SDL_getenv([NativeTypeName("const char *")] byte* name); + public static extern byte* Unsafe_SDL_GetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_setenv([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, int overwrite); + [return: NativeTypeName("char **")] + public static extern byte** SDL_GetEnvironmentVariables(SDL_Environment* env); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_unsetenv([NativeTypeName("const char *")] byte* name); + public static extern SDL_bool SDL_SetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_bool overwrite); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_UnsetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DestroyEnvironment(SDL_Environment* env); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_getenv_unsafe", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern byte* Unsafe_SDL_getenv_unsafe([NativeTypeName("const char *")] byte* name); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int SDL_setenv_unsafe([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, int overwrite); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int SDL_unsetenv_unsafe([NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_qsort([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback")] delegate* unmanaged[Cdecl] compare); @@ -303,11 +342,11 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_lltoa", ExactSpelling = true)] [return: NativeTypeName("char *")] - public static extern byte* Unsafe_SDL_lltoa([NativeTypeName("Sint64")] long value, [NativeTypeName("char *")] byte* str, int radix); + public static extern byte* Unsafe_SDL_lltoa([NativeTypeName("long long")] long value, [NativeTypeName("char *")] byte* str, int radix); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ulltoa", ExactSpelling = true)] [return: NativeTypeName("char *")] - public static extern byte* Unsafe_SDL_ulltoa([NativeTypeName("Uint64")] ulong value, [NativeTypeName("char *")] byte* str, int radix); + public static extern byte* Unsafe_SDL_ulltoa([NativeTypeName("unsigned long long")] ulong value, [NativeTypeName("char *")] byte* str, int radix); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_atoi([NativeTypeName("const char *")] byte* str); @@ -324,11 +363,11 @@ namespace SDL public static extern uint SDL_strtoul([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("Sint64")] + [return: NativeTypeName("long long")] public static extern long SDL_strtoll([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("Uint64")] + [return: NativeTypeName("unsigned long long")] public static extern ulong SDL_strtoull([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] @@ -346,6 +385,10 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_strncasecmp([NativeTypeName("const char *")] byte* str1, [NativeTypeName("const char *")] byte* str2, [NativeTypeName("size_t")] nuint maxlen); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strpbrk", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern byte* Unsafe_SDL_strpbrk([NativeTypeName("const char *")] byte* str, [NativeTypeName("const char *")] byte* breakset); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint32")] public static extern uint SDL_StepUTF8([NativeTypeName("const char **")] byte** pstr, [NativeTypeName("size_t *")] nuint* pslen); @@ -564,26 +607,26 @@ namespace SDL [return: NativeTypeName("char *")] public static extern byte* Unsafe_SDL_iconv_string([NativeTypeName("const char *")] byte* tocode, [NativeTypeName("const char *")] byte* fromcode, [NativeTypeName("const char *")] byte* inbuf, [NativeTypeName("size_t")] nuint inbytesleft); - public static int SDL_size_mul_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret) + public static SDL_bool SDL_size_mul_check_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret) { if (a != 0 && b > 0xffffffffffffffffUL / a) { - return -1; + return (SDL_bool)(0); } *ret = a * b; - return 0; + return (SDL_bool)(1); } - public static int SDL_size_add_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret) + public static SDL_bool SDL_size_add_check_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret) { if (b > 0xffffffffffffffffUL - a) { - return -1; + return (SDL_bool)(0); } *ret = a + b; - return 0; + return (SDL_bool)(1); } [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs index 42f8859..773b785 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs @@ -30,35 +30,38 @@ namespace SDL { public unsafe partial struct SDL_StorageInterface { - [NativeTypeName("int (*)(void *)")] - public delegate* unmanaged[Cdecl] close; + [NativeTypeName("Uint32")] + public uint version; + + [NativeTypeName("SDL_bool (*)(void *)")] + public delegate* unmanaged[Cdecl] close; [NativeTypeName("SDL_bool (*)(void *)")] public delegate* unmanaged[Cdecl] ready; - [NativeTypeName("int (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")] - public delegate* unmanaged[Cdecl], IntPtr, int> enumerate; + [NativeTypeName("SDL_bool (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")] + public delegate* unmanaged[Cdecl], IntPtr, SDL_bool> enumerate; - [NativeTypeName("int (*)(void *, const char *, SDL_PathInfo *)")] - public delegate* unmanaged[Cdecl] info; + [NativeTypeName("SDL_bool (*)(void *, const char *, SDL_PathInfo *)")] + public delegate* unmanaged[Cdecl] info; - [NativeTypeName("int (*)(void *, const char *, void *, Uint64)")] - public delegate* unmanaged[Cdecl] read_file; + [NativeTypeName("SDL_bool (*)(void *, const char *, void *, Uint64)")] + public delegate* unmanaged[Cdecl] read_file; - [NativeTypeName("int (*)(void *, const char *, const void *, Uint64)")] - public delegate* unmanaged[Cdecl] write_file; + [NativeTypeName("SDL_bool (*)(void *, const char *, const void *, Uint64)")] + public delegate* unmanaged[Cdecl] write_file; - [NativeTypeName("int (*)(void *, const char *)")] - public delegate* unmanaged[Cdecl] mkdir; + [NativeTypeName("SDL_bool (*)(void *, const char *)")] + public delegate* unmanaged[Cdecl] mkdir; - [NativeTypeName("int (*)(void *, const char *)")] - public delegate* unmanaged[Cdecl] remove; + [NativeTypeName("SDL_bool (*)(void *, const char *)")] + public delegate* unmanaged[Cdecl] remove; - [NativeTypeName("int (*)(void *, const char *, const char *)")] - public delegate* unmanaged[Cdecl] rename; + [NativeTypeName("SDL_bool (*)(void *, const char *, const char *)")] + public delegate* unmanaged[Cdecl] rename; - [NativeTypeName("int (*)(void *, const char *, const char *)")] - public delegate* unmanaged[Cdecl] copy; + [NativeTypeName("SDL_bool (*)(void *, const char *, const char *)")] + public delegate* unmanaged[Cdecl] copy; [NativeTypeName("Uint64 (*)(void *)")] public delegate* unmanaged[Cdecl] space_remaining; @@ -83,37 +86,37 @@ namespace SDL public static extern SDL_Storage* SDL_OpenStorage([NativeTypeName("const SDL_StorageInterface *")] SDL_StorageInterface* iface, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CloseStorage(SDL_Storage* storage); + public static extern SDL_bool SDL_CloseStorage(SDL_Storage* storage); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_StorageReady(SDL_Storage* storage); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length); + public static extern SDL_bool SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ReadStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("void*")] IntPtr destination, [NativeTypeName("Uint64")] ulong length); + public static extern SDL_bool SDL_ReadStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("void*")] IntPtr destination, [NativeTypeName("Uint64")] ulong length); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WriteStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("const void *")] IntPtr source, [NativeTypeName("Uint64")] ulong length); + public static extern SDL_bool SDL_WriteStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("const void *")] IntPtr source, [NativeTypeName("Uint64")] ulong length); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RenameStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath); + public static extern SDL_bool SDL_RenameStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_CopyStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath); + public static extern SDL_bool SDL_CopyStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info); + public static extern SDL_bool SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint64")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs index b540252..0cc3683 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs @@ -32,7 +32,6 @@ namespace SDL { SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR, - SDL_SCALEMODE_BEST, } public enum SDL_FlipMode @@ -81,7 +80,7 @@ namespace SDL public static extern SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace); + public static extern SDL_bool SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface* surface); @@ -90,13 +89,13 @@ namespace SDL public static extern SDL_Palette* SDL_CreateSurfacePalette(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); + public static extern SDL_bool SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Palette* SDL_GetSurfacePalette(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image); + public static extern SDL_bool SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_SurfaceHasAlternateImages(SDL_Surface* surface); @@ -108,7 +107,7 @@ namespace SDL public static extern void SDL_RemoveSurfaceAlternateImages(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_LockSurface(SDL_Surface* surface); + public static extern SDL_bool SDL_LockSurface(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnlockSurface(SDL_Surface* surface); @@ -120,52 +119,52 @@ namespace SDL public static extern SDL_Surface* SDL_LoadBMP([NativeTypeName("const char *")] byte* file); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, SDL_bool closeio); + public static extern SDL_bool SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, SDL_bool closeio); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file); + public static extern SDL_bool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled); + public static extern SDL_bool SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_SurfaceHasRLE(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key); + public static extern SDL_bool SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_SurfaceHasColorKey(SDL_Surface* surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); + public static extern SDL_bool SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + public static extern SDL_bool SDL_SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + public static extern SDL_bool SDL_GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); + public static extern SDL_bool SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); + public static extern SDL_bool SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); + public static extern SDL_bool SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); + public static extern SDL_bool SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_SetSurfaceClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect); + public static extern SDL_bool SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip); + public static extern SDL_bool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface); @@ -180,46 +179,46 @@ namespace SDL public static extern SDL_Surface* SDL_ConvertSurfaceAndColorspace(SDL_Surface* surface, SDL_PixelFormat format, SDL_Palette* palette, SDL_Colorspace colorspace, SDL_PropertiesID props); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch); + public static extern SDL_bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch); + public static extern SDL_bool SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch, SDL_bool linear); + public static extern SDL_bool SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch, SDL_bool linear); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, SDL_bool linear); + public static extern SDL_bool SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, SDL_bool linear); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a); + public static extern SDL_bool SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); + public static extern SDL_bool SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FillSurfaceRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); + public static extern SDL_bool SDL_FillSurfaceRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + public static extern SDL_bool SDL_BlitSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurfaceUnchecked(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + public static extern SDL_bool SDL_BlitSurfaceUnchecked(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurfaceScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode); + public static extern SDL_bool SDL_BlitSurfaceScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode); + public static extern SDL_bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurfaceTiled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + public static extern SDL_bool SDL_BlitSurfaceTiled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurfaceTiledWithScale(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + public static extern SDL_bool SDL_BlitSurfaceTiledWithScale(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_BlitSurface9Grid(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + public static extern SDL_bool SDL_BlitSurface9Grid(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("Uint32")] @@ -230,16 +229,16 @@ namespace SDL public static extern uint SDL_MapSurfaceRGBA(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); + public static extern SDL_bool SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a); + public static extern SDL_bool SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WriteSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + public static extern SDL_bool SDL_WriteSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a); + public static extern SDL_bool SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a); [NativeTypeName("#define SDL_SURFACE_PREALLOCATED 0x00000001u")] public const uint SDL_SURFACE_PREALLOCATED = 0x00000001U; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.Android.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.Android.g.cs index 98daba3..d0d4209 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.Android.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.Android.g.cs @@ -83,15 +83,15 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Android")] - public static extern int SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + public static extern SDL_bool SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Android")] - public static extern int SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset); + public static extern SDL_bool SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Android")] - public static extern int SDL_SendAndroidMessage([NativeTypeName("Uint32")] uint command, int param1); + public static extern SDL_bool SDL_SendAndroidMessage([NativeTypeName("Uint32")] uint command, int param1); [NativeTypeName("#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01")] public const int SDL_ANDROID_EXTERNAL_STORAGE_READ = 0x01; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.WinRT.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.GDK.g.cs similarity index 68% rename from SDL3-CS/SDL3/ClangSharp/SDL_system.WinRT.g.cs rename to SDL3-CS/SDL3/ClangSharp/SDL_system.GDK.g.cs index 7caae29..3e102be 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.WinRT.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.GDK.g.cs @@ -28,31 +28,22 @@ using System.Runtime.Versioning; namespace SDL { - public enum SDL_WinRT_Path + public partial struct XTaskQueueObject { - SDL_WINRT_PATH_INSTALLED_LOCATION, - SDL_WINRT_PATH_LOCAL_FOLDER, - SDL_WINRT_PATH_ROAMING_FOLDER, - SDL_WINRT_PATH_TEMP_FOLDER, } - public enum SDL_WinRT_DeviceFamily + public partial struct XUser { - SDL_WINRT_DEVICEFAMILY_UNKNOWN, - SDL_WINRT_DEVICEFAMILY_DESKTOP, - SDL_WINRT_DEVICEFAMILY_MOBILE, - SDL_WINRT_DEVICEFAMILY_XBOX, } public static unsafe partial class SDL3 { - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWinRTFSPath", ExactSpelling = true)] - [return: NativeTypeName("const char *")] + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] - public static extern byte* Unsafe_SDL_GetWinRTFSPath(SDL_WinRT_Path pathType); + public static extern SDL_bool SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] - public static extern SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily(); + public static extern SDL_bool SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.Linux.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.Linux.g.cs index e3afa05..d8922a5 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.Linux.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.Linux.g.cs @@ -32,10 +32,10 @@ namespace SDL { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Linux")] - public static extern int SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority); + public static extern SDL_bool SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Linux")] - public static extern int SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy); + public static extern SDL_bool SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs index 596d378..ff22710 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs @@ -29,14 +29,6 @@ using System.Runtime.Versioning; namespace SDL { - public partial struct XTaskQueueObject - { - } - - public partial struct XUser - { - } - public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] @@ -49,14 +41,6 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] - public static extern int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [SupportedOSPlatform("Windows")] - public static extern int SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [SupportedOSPlatform("Windows")] - public static extern int SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle); + public static extern SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.iOS.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.iOS.g.cs index 79ec2c7..21ae4e8 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.iOS.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.iOS.g.cs @@ -33,7 +33,7 @@ namespace SDL { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("iOS")] - public static extern int SDL_SetiOSAnimationCallback(SDL_Window* window, int interval, [NativeTypeName("SDL_iOSAnimationCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr callbackParam); + public static extern SDL_bool SDL_SetiOSAnimationCallback(SDL_Window* window, int interval, [NativeTypeName("SDL_iOSAnimationCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr callbackParam); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("iOS")] diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs index fd37e7b..9c8e3ee 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs @@ -59,7 +59,7 @@ namespace SDL public static extern SDL_ThreadID SDL_GetThreadID(SDL_Thread* thread); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetThreadPriority(SDL_ThreadPriority priority); + public static extern SDL_bool SDL_SetThreadPriority(SDL_ThreadPriority priority); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_WaitThread(SDL_Thread* thread, int* status); @@ -72,7 +72,7 @@ namespace SDL public static extern IntPtr SDL_GetTLS(SDL_TLSID* id); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTLS(SDL_TLSID* id, [NativeTypeName("const void *")] IntPtr value, [NativeTypeName("SDL_TLSDestructorCallback")] delegate* unmanaged[Cdecl] destructor); + public static extern SDL_bool SDL_SetTLS(SDL_TLSID* id, [NativeTypeName("const void *")] IntPtr value, [NativeTypeName("SDL_TLSDestructorCallback")] delegate* unmanaged[Cdecl] destructor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CleanupTLS(); @@ -83,16 +83,16 @@ namespace SDL [NativeTypeName("#define SDL_EndThreadFunction NULL")] public const int SDL_EndThreadFunction = 0; - [NativeTypeName("#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER \"entry_function\"")] - public static ReadOnlySpan SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER => "entry_function"u8; + [NativeTypeName("#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER \"SDL.thread.create.entry_function\"")] + public static ReadOnlySpan SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER => "SDL.thread.create.entry_function"u8; - [NativeTypeName("#define SDL_PROP_THREAD_CREATE_NAME_STRING \"name\"")] - public static ReadOnlySpan SDL_PROP_THREAD_CREATE_NAME_STRING => "name"u8; + [NativeTypeName("#define SDL_PROP_THREAD_CREATE_NAME_STRING \"SDL.thread.create.name\"")] + public static ReadOnlySpan SDL_PROP_THREAD_CREATE_NAME_STRING => "SDL.thread.create.name"u8; - [NativeTypeName("#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER \"userdata\"")] - public static ReadOnlySpan SDL_PROP_THREAD_CREATE_USERDATA_POINTER => "userdata"u8; + [NativeTypeName("#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER \"SDL.thread.create.userdata\"")] + public static ReadOnlySpan SDL_PROP_THREAD_CREATE_USERDATA_POINTER => "SDL.thread.create.userdata"u8; - [NativeTypeName("#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER \"stacksize\"")] - public static ReadOnlySpan SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER => "stacksize"u8; + [NativeTypeName("#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER \"SDL.thread.create.stacksize\"")] + public static ReadOnlySpan SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER => "SDL.thread.create.stacksize"u8; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_time.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_time.g.cs index d9351bc..5775450 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_time.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_time.g.cs @@ -64,16 +64,16 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetDateTimeLocalePreferences(SDL_DateFormat* dateFormat, SDL_TimeFormat* timeFormat); + public static extern SDL_bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat* dateFormat, SDL_TimeFormat* timeFormat); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetCurrentTime(SDL_Time* ticks); + public static extern SDL_bool SDL_GetCurrentTime(SDL_Time* ticks); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime* dt, SDL_bool localTime); + public static extern SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime* dt, SDL_bool localTime); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_DateTimeToTime([NativeTypeName("const SDL_DateTime *")] SDL_DateTime* dt, SDL_Time* ticks); + public static extern SDL_bool SDL_DateTimeToTime([NativeTypeName("const SDL_DateTime *")] SDL_DateTime* dt, SDL_Time* ticks); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_TimeToWindows(SDL_Time ticks, [NativeTypeName("Uint32 *")] uint* dwLowDateTime, [NativeTypeName("Uint32 *")] uint* dwHighDateTime); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_timer.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_timer.g.cs index a94b63c..496f5c9 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_timer.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_timer.g.cs @@ -59,7 +59,7 @@ namespace SDL public static extern SDL_TimerID SDL_AddTimerNS([NativeTypeName("Uint64")] ulong interval, [NativeTypeName("SDL_NSTimerCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RemoveTimer(SDL_TimerID id); + public static extern SDL_bool SDL_RemoveTimer(SDL_TimerID id); [NativeTypeName("#define SDL_MS_PER_SECOND 1000")] public const int SDL_MS_PER_SECOND = 1000; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs index 15899dc..abccae5 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs @@ -187,10 +187,10 @@ namespace SDL public static extern byte* Unsafe_SDL_GetDisplayName(SDL_DisplayID displayID); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect* rect); + public static extern SDL_bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect* rect); + public static extern SDL_bool SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_DisplayOrientation SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID); @@ -205,7 +205,7 @@ namespace SDL public static extern SDL_DisplayMode** SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int* count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode* mode); + public static extern SDL_bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode* mode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const SDL_DisplayMode *")] @@ -231,7 +231,7 @@ namespace SDL public static extern float SDL_GetWindowDisplayScale(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowFullscreenMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); + public static extern SDL_bool SDL_SetWindowFullscreenMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const SDL_DisplayMode *")] @@ -272,86 +272,86 @@ namespace SDL public static extern SDL_WindowFlags SDL_GetWindowFlags(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] byte* title); + public static extern SDL_bool SDL_SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] byte* title); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowTitle", ExactSpelling = true)] [return: NativeTypeName("const char *")] public static extern byte* Unsafe_SDL_GetWindowTitle(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowIcon(SDL_Window* window, SDL_Surface* icon); + public static extern SDL_bool SDL_SetWindowIcon(SDL_Window* window, SDL_Surface* icon); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowPosition(SDL_Window* window, int x, int y); + public static extern SDL_bool SDL_SetWindowPosition(SDL_Window* window, int x, int y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowPosition(SDL_Window* window, int* x, int* y); + public static extern SDL_bool SDL_GetWindowPosition(SDL_Window* window, int* x, int* y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowSize(SDL_Window* window, int w, int h); + public static extern SDL_bool SDL_SetWindowSize(SDL_Window* window, int w, int h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowSize(SDL_Window* window, int* w, int* h); + public static extern SDL_bool SDL_GetWindowSize(SDL_Window* window, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowSafeArea(SDL_Window* window, SDL_Rect* rect); + public static extern SDL_bool SDL_GetWindowSafeArea(SDL_Window* window, SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowAspectRatio(SDL_Window* window, float min_aspect, float max_aspect); + public static extern SDL_bool SDL_SetWindowAspectRatio(SDL_Window* window, float min_aspect, float max_aspect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowAspectRatio(SDL_Window* window, float* min_aspect, float* max_aspect); + public static extern SDL_bool SDL_GetWindowAspectRatio(SDL_Window* window, float* min_aspect, float* max_aspect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); + public static extern SDL_bool SDL_GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); + public static extern SDL_bool SDL_GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); + public static extern SDL_bool SDL_SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowMinimumSize(SDL_Window* window, int* w, int* h); + public static extern SDL_bool SDL_GetWindowMinimumSize(SDL_Window* window, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); + public static extern SDL_bool SDL_SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowMaximumSize(SDL_Window* window, int* w, int* h); + public static extern SDL_bool SDL_GetWindowMaximumSize(SDL_Window* window, int* w, int* h); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowBordered(SDL_Window* window, SDL_bool bordered); + public static extern SDL_bool SDL_SetWindowBordered(SDL_Window* window, SDL_bool bordered); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowResizable(SDL_Window* window, SDL_bool resizable); + public static extern SDL_bool SDL_SetWindowResizable(SDL_Window* window, SDL_bool resizable); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); + public static extern SDL_bool SDL_SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ShowWindow(SDL_Window* window); + public static extern SDL_bool SDL_ShowWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_HideWindow(SDL_Window* window); + public static extern SDL_bool SDL_HideWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RaiseWindow(SDL_Window* window); + public static extern SDL_bool SDL_RaiseWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_MaximizeWindow(SDL_Window* window); + public static extern SDL_bool SDL_MaximizeWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_MinimizeWindow(SDL_Window* window); + public static extern SDL_bool SDL_MinimizeWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RestoreWindow(SDL_Window* window); + public static extern SDL_bool SDL_RestoreWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowFullscreen(SDL_Window* window, SDL_bool fullscreen); + public static extern SDL_bool SDL_SetWindowFullscreen(SDL_Window* window, SDL_bool fullscreen); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SyncWindow(SDL_Window* window); + public static extern SDL_bool SDL_SyncWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_WindowHasSurface(SDL_Window* window); @@ -360,25 +360,25 @@ namespace SDL public static extern SDL_Surface* SDL_GetWindowSurface(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowSurfaceVSync(SDL_Window* window, int vsync); + public static extern SDL_bool SDL_SetWindowSurfaceVSync(SDL_Window* window, int vsync); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GetWindowSurfaceVSync(SDL_Window* window, int* vsync); + public static extern SDL_bool SDL_GetWindowSurfaceVSync(SDL_Window* window, int* vsync); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateWindowSurface(SDL_Window* window); + public static extern SDL_bool SDL_UpdateWindowSurface(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); + public static extern SDL_bool SDL_UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_DestroyWindowSurface(SDL_Window* window); + public static extern SDL_bool SDL_DestroyWindowSurface(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); + public static extern SDL_bool SDL_SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); + public static extern SDL_bool SDL_SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window* window); @@ -390,35 +390,38 @@ namespace SDL public static extern SDL_Window* SDL_GetGrabbedWindow(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + public static extern SDL_bool SDL_SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const SDL_Rect *")] public static extern SDL_Rect* SDL_GetWindowMouseRect(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowOpacity(SDL_Window* window, float opacity); + public static extern SDL_bool SDL_SetWindowOpacity(SDL_Window* window, float opacity); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float SDL_GetWindowOpacity(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window); + public static extern SDL_bool SDL_SetWindowParent(SDL_Window* window, SDL_Window* parent); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowFocusable(SDL_Window* window, SDL_bool focusable); + public static extern SDL_bool SDL_SetWindowModal(SDL_Window* window, SDL_bool modal); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_ShowWindowSystemMenu(SDL_Window* window, int x, int y); + public static extern SDL_bool SDL_SetWindowFocusable(SDL_Window* window, SDL_bool focusable); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr callback_data); + public static extern SDL_bool SDL_ShowWindowSystemMenu(SDL_Window* window, int x, int y); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetWindowShape(SDL_Window* window, SDL_Surface* shape); + public static extern SDL_bool SDL_SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr callback_data); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_FlashWindow(SDL_Window* window, SDL_FlashOperation operation); + public static extern SDL_bool SDL_SetWindowShape(SDL_Window* window, SDL_Surface* shape); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_bool SDL_FlashWindow(SDL_Window* window, SDL_FlashOperation operation); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyWindow(SDL_Window* window); @@ -427,13 +430,13 @@ namespace SDL public static extern SDL_bool SDL_ScreenSaverEnabled(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_EnableScreenSaver(); + public static extern SDL_bool SDL_EnableScreenSaver(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_DisableScreenSaver(); + public static extern SDL_bool SDL_DisableScreenSaver(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_LoadLibrary([NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_GL_LoadLibrary([NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] @@ -453,17 +456,17 @@ namespace SDL public static extern void SDL_GL_ResetAttributes(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_SetAttribute(SDL_GLattr attr, int value); + public static extern SDL_bool SDL_GL_SetAttribute(SDL_GLattr attr, int value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_GetAttribute(SDL_GLattr attr, int* value); + public static extern SDL_bool SDL_GL_GetAttribute(SDL_GLattr attr, int* value); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_GLContext")] public static extern SDL_GLContextState* SDL_GL_CreateContext(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] SDL_GLContextState* context); + public static extern SDL_bool SDL_GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] SDL_GLContextState* context); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Window* SDL_GL_GetCurrentWindow(); @@ -488,16 +491,16 @@ namespace SDL public static extern void SDL_EGL_SetAttributeCallbacks([NativeTypeName("SDL_EGLAttribArrayCallback")] delegate* unmanaged[Cdecl] platformAttribCallback, [NativeTypeName("SDL_EGLIntArrayCallback")] delegate* unmanaged[Cdecl] surfaceAttribCallback, [NativeTypeName("SDL_EGLIntArrayCallback")] delegate* unmanaged[Cdecl] contextAttribCallback); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_SetSwapInterval(int interval); + public static extern SDL_bool SDL_GL_SetSwapInterval(int interval); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_GetSwapInterval(int* interval); + public static extern SDL_bool SDL_GL_GetSwapInterval(int* interval); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_SwapWindow(SDL_Window* window); + public static extern SDL_bool SDL_GL_SwapWindow(SDL_Window* window); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_GL_DestroyContext([NativeTypeName("SDL_GLContext")] SDL_GLContextState* context); + public static extern SDL_bool SDL_GL_DestroyContext([NativeTypeName("SDL_GLContext")] SDL_GLContextState* context); [NativeTypeName("#define SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER \"SDL.video.wayland.wl_display\"")] public static ReadOnlySpan SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER => "SDL.video.wayland.wl_display"u8; @@ -547,8 +550,11 @@ namespace SDL [NativeTypeName("#define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000)")] public const ulong SDL_WINDOW_MOUSE_CAPTURE = (0x0000000000004000UL); - [NativeTypeName("#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000)")] - public const ulong SDL_WINDOW_ALWAYS_ON_TOP = (0x0000000000008000UL); + [NativeTypeName("#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000)")] + public const ulong SDL_WINDOW_MOUSE_RELATIVE_MODE = (0x0000000000008000UL); + + [NativeTypeName("#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000)")] + public const ulong SDL_WINDOW_ALWAYS_ON_TOP = (0x0000000000010000UL); [NativeTypeName("#define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000)")] public const ulong SDL_WINDOW_UTILITY = (0x0000000000020000UL); @@ -592,104 +598,107 @@ namespace SDL [NativeTypeName("#define SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER \"SDL.display.KMSDRM.panel_orientation\"")] public static ReadOnlySpan SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER => "SDL.display.KMSDRM.panel_orientation"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN \"always_on_top\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => "always_on_top"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN \"SDL.window.create.always_on_top\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => "SDL.window.create.always_on_top"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN \"borderless\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN => "borderless"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN \"SDL.window.create.borderless\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN => "SDL.window.create.borderless"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN \"focusable\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN => "focusable"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN \"SDL.window.create.focusable\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN => "SDL.window.create.focusable"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN \"external_graphics_context\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN => "external_graphics_context"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN \"SDL.window.create.external_graphics_context\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN => "SDL.window.create.external_graphics_context"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN \"fullscreen\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN => "fullscreen"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER \"SDL.window.create.flags\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER => "SDL.window.create.flags"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER \"height\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER => "height"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN \"SDL.window.create.fullscreen\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN => "SDL.window.create.fullscreen"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN \"hidden\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN => "hidden"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER \"SDL.window.create.height\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER => "SDL.window.create.height"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN \"high_pixel_density\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN => "high_pixel_density"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN \"SDL.window.create.hidden\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN => "SDL.window.create.hidden"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN \"maximized\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN => "maximized"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN \"SDL.window.create.high_pixel_density\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN => "SDL.window.create.high_pixel_density"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN \"menu\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN => "menu"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN \"SDL.window.create.maximized\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN => "SDL.window.create.maximized"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN \"metal\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN => "metal"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN \"SDL.window.create.menu\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN => "SDL.window.create.menu"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN \"minimized\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN => "minimized"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN \"SDL.window.create.metal\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN => "SDL.window.create.metal"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN \"modal\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN => "modal"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN \"SDL.window.create.minimized\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN => "SDL.window.create.minimized"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN \"mouse_grabbed\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN => "mouse_grabbed"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN \"SDL.window.create.modal\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN => "SDL.window.create.modal"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN \"opengl\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN => "opengl"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN \"SDL.window.create.mouse_grabbed\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN => "SDL.window.create.mouse_grabbed"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER \"parent\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_PARENT_POINTER => "parent"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN \"SDL.window.create.opengl\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN => "SDL.window.create.opengl"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN \"resizable\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN => "resizable"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER \"SDL.window.create.parent\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_PARENT_POINTER => "SDL.window.create.parent"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TITLE_STRING \"title\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TITLE_STRING => "title"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN \"SDL.window.create.resizable\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN => "SDL.window.create.resizable"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN \"transparent\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN => "transparent"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TITLE_STRING \"SDL.window.create.title\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TITLE_STRING => "SDL.window.create.title"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN \"tooltip\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN => "tooltip"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN \"SDL.window.create.transparent\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN => "SDL.window.create.transparent"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN \"utility\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN => "utility"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN \"SDL.window.create.tooltip\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN => "SDL.window.create.tooltip"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN \"vulkan\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN => "vulkan"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN \"SDL.window.create.utility\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN => "SDL.window.create.utility"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER \"width\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER => "width"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN \"SDL.window.create.vulkan\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN => "SDL.window.create.vulkan"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_X_NUMBER \"x\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_X_NUMBER => "x"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER \"SDL.window.create.width\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER => "SDL.window.create.width"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_Y_NUMBER \"y\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_Y_NUMBER => "y"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_X_NUMBER \"SDL.window.create.x\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_X_NUMBER => "SDL.window.create.x"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER \"cocoa.window\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER => "cocoa.window"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_Y_NUMBER \"SDL.window.create.y\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_Y_NUMBER => "SDL.window.create.y"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER \"cocoa.view\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER => "cocoa.view"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER \"SDL.window.create.cocoa.window\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER => "SDL.window.create.cocoa.window"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN \"wayland.surface_role_custom\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN => "wayland.surface_role_custom"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER \"SDL.window.create.cocoa.view\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER => "SDL.window.create.cocoa.view"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN \"wayland.create_egl_window\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN => "wayland.create_egl_window"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN \"SDL.window.create.wayland.surface_role_custom\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN => "SDL.window.create.wayland.surface_role_custom"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER \"wayland.wl_surface\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER => "wayland.wl_surface"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN \"SDL.window.create.wayland.create_egl_window\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN => "SDL.window.create.wayland.create_egl_window"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER \"win32.hwnd\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER => "win32.hwnd"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER \"SDL.window.create.wayland.wl_surface\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER => "SDL.window.create.wayland.wl_surface"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER \"win32.pixel_format_hwnd\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER => "win32.pixel_format_hwnd"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER \"SDL.window.create.win32.hwnd\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER => "SDL.window.create.win32.hwnd"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER \"x11.window\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER => "x11.window"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER \"SDL.window.create.win32.pixel_format_hwnd\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER => "SDL.window.create.win32.pixel_format_hwnd"u8; + + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER \"SDL.window.create.x11.window\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER => "SDL.window.create.x11.window"u8; [NativeTypeName("#define SDL_PROP_WINDOW_SHAPE_POINTER \"SDL.window.shape\"")] public static ReadOnlySpan SDL_PROP_WINDOW_SHAPE_POINTER => "SDL.window.shape"u8; @@ -748,9 +757,6 @@ namespace SDL [NativeTypeName("#define SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER \"SDL.window.vivante.surface\"")] public static ReadOnlySpan SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER => "SDL.window.vivante.surface"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_WINRT_WINDOW_POINTER \"SDL.window.winrt.window\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_WINRT_WINDOW_POINTER => "SDL.window.winrt.window"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_WIN32_HWND_POINTER \"SDL.window.win32.hwnd\"")] public static ReadOnlySpan SDL_PROP_WINDOW_WIN32_HWND_POINTER => "SDL.window.win32.hwnd"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs index f055532..9033f22 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs @@ -47,7 +47,7 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_Vulkan_LoadLibrary([NativeTypeName("const char *")] byte* path); + public static extern SDL_bool SDL_Vulkan_LoadLibrary([NativeTypeName("const char *")] byte* path); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] @@ -61,7 +61,7 @@ namespace SDL public static extern byte** SDL_Vulkan_GetInstanceExtensions([NativeTypeName("Uint32 *")] uint* count); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_Vulkan_CreateSurface(SDL_Window* window, [NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("const struct VkAllocationCallbacks *")] VkAllocationCallbacks* allocator, [NativeTypeName("VkSurfaceKHR *")] VkSurfaceKHR_T** surface); + public static extern SDL_bool SDL_Vulkan_CreateSurface(SDL_Window* window, [NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("const struct VkAllocationCallbacks *")] VkAllocationCallbacks* allocator, [NativeTypeName("VkSurfaceKHR *")] VkSurfaceKHR_T** surface); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_Vulkan_DestroySurface([NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("VkSurfaceKHR")] VkSurfaceKHR_T* surface, [NativeTypeName("const struct VkAllocationCallbacks *")] VkAllocationCallbacks* allocator); diff --git a/SDL3-CS/SDL3/SDL_clipboard.cs b/SDL3-CS/SDL3/SDL_clipboard.cs index 64906ad..7869685 100644 --- a/SDL3-CS/SDL3/SDL_clipboard.cs +++ b/SDL3-CS/SDL3/SDL_clipboard.cs @@ -14,9 +14,9 @@ namespace SDL { [LibraryImport("SDL3", StringMarshalling = StringMarshalling.Utf8)] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static unsafe partial int SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, string[] mime_types, UIntPtr num_mime_types); + private static unsafe partial SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, string[] mime_types, UIntPtr num_mime_types); - public static unsafe int SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, params string[] mime_types) + public static unsafe SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, params string[] mime_types) => SDL_SetClipboardData(callback, cleanup, userdata, mime_types, (UIntPtr)mime_types.Length); } } diff --git a/SDL3-CS/SDL3/SDL_error.cs b/SDL3-CS/SDL3/SDL_error.cs index a9a03c2..e8ad5e0 100644 --- a/SDL3-CS/SDL3/SDL_error.cs +++ b/SDL3-CS/SDL3/SDL_error.cs @@ -6,14 +6,14 @@ namespace SDL public static partial class SDL3 { [Macro] - public static unsafe int SDL_Unsupported() + public static unsafe SDL_bool SDL_Unsupported() { fixed (byte* fmt = "That operation is not supported"u8) return SDL_SetError(fmt, __arglist()); } [Macro] - public static unsafe int SDL_InvalidParamError([NativeTypeName("const char *")] byte* param) + public static unsafe SDL_bool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param) { fixed (byte* fmt = "Parameter '%s' is invalid"u8) return SDL_SetError(fmt, __arglist(param)); diff --git a/SDL3-CS/SDL3/SDL_gpu.cs b/SDL3-CS/SDL3/SDL_gpu.cs new file mode 100644 index 0000000..c75a78e --- /dev/null +++ b/SDL3-CS/SDL3/SDL_gpu.cs @@ -0,0 +1,57 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; + +namespace SDL +{ + [Flags] + [Typedef] + public enum SDL_GPUTextureUsageFlags : uint + { + SDL_GPU_TEXTUREUSAGE_SAMPLER = SDL3.SDL_GPU_TEXTUREUSAGE_SAMPLER, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET = SDL3.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET = SDL3.SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ = SDL3.SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ = SDL3.SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE = SDL3.SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE, + } + + [Flags] + [Typedef] + public enum SDL_GPUBufferUsageFlags : uint + { + SDL_GPU_BUFFERUSAGE_VERTEX = SDL3.SDL_GPU_BUFFERUSAGE_VERTEX, + SDL_GPU_BUFFERUSAGE_INDEX = SDL3.SDL_GPU_BUFFERUSAGE_INDEX, + SDL_GPU_BUFFERUSAGE_INDIRECT = SDL3.SDL_GPU_BUFFERUSAGE_INDIRECT, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ = SDL3.SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ = SDL3.SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE = SDL3.SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE, + } + + [Flags] + [Typedef] + public enum SDL_GPUShaderFormat : uint + { + SDL_GPU_SHADERFORMAT_PRIVATE = SDL3.SDL_GPU_SHADERFORMAT_PRIVATE, + SDL_GPU_SHADERFORMAT_SPIRV = SDL3.SDL_GPU_SHADERFORMAT_SPIRV, + SDL_GPU_SHADERFORMAT_DXBC = SDL3.SDL_GPU_SHADERFORMAT_DXBC, + SDL_GPU_SHADERFORMAT_DXIL = SDL3.SDL_GPU_SHADERFORMAT_DXIL, + SDL_GPU_SHADERFORMAT_MSL = SDL3.SDL_GPU_SHADERFORMAT_MSL, + SDL_GPU_SHADERFORMAT_METALLIB = SDL3.SDL_GPU_SHADERFORMAT_METALLIB, + } + + [Flags] + [Typedef] + public enum SDL_GPUColorComponentFlags : byte + { + SDL_GPU_COLORCOMPONENT_R = (byte)SDL3.SDL_GPU_COLORCOMPONENT_R, + SDL_GPU_COLORCOMPONENT_G = (byte)SDL3.SDL_GPU_COLORCOMPONENT_G, + SDL_GPU_COLORCOMPONENT_B = (byte)SDL3.SDL_GPU_COLORCOMPONENT_B, + SDL_GPU_COLORCOMPONENT_A = (byte)SDL3.SDL_GPU_COLORCOMPONENT_A, + } + + public static partial class SDL3 + { + } +} \ No newline at end of file diff --git a/SDL3-CS/SDL3/SDL_pen.cs b/SDL3-CS/SDL3/SDL_pen.cs index dddfe91..751bbe0 100644 --- a/SDL3-CS/SDL3/SDL_pen.cs +++ b/SDL3-CS/SDL3/SDL_pen.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using JetBrains.Annotations; namespace SDL { @@ -11,37 +10,14 @@ namespace SDL [Flags] [Typedef] - public enum SDL_PenCapabilityFlags : uint + public enum SDL_PenInputFlags : UInt32 { - SDL_PEN_DOWN_MASK = SDL3.SDL_PEN_DOWN_MASK, - SDL_PEN_INK_MASK = SDL3.SDL_PEN_INK_MASK, - SDL_PEN_ERASER_MASK = SDL3.SDL_PEN_ERASER_MASK, - SDL_PEN_AXIS_PRESSURE_MASK = SDL3.SDL_PEN_AXIS_PRESSURE_MASK, - SDL_PEN_AXIS_XTILT_MASK = SDL3.SDL_PEN_AXIS_XTILT_MASK, - SDL_PEN_AXIS_YTILT_MASK = SDL3.SDL_PEN_AXIS_YTILT_MASK, - SDL_PEN_AXIS_DISTANCE_MASK = SDL3.SDL_PEN_AXIS_DISTANCE_MASK, - SDL_PEN_AXIS_ROTATION_MASK = SDL3.SDL_PEN_AXIS_ROTATION_MASK, - SDL_PEN_AXIS_SLIDER_MASK = SDL3.SDL_PEN_AXIS_SLIDER_MASK, - SDL_PEN_AXIS_BIDIRECTIONAL_MASKS = SDL3.SDL_PEN_AXIS_BIDIRECTIONAL_MASKS, - } - - public static partial class SDL3 - { - [Constant] - public const SDL_MouseID SDL_PEN_MOUSEID = unchecked((SDL_MouseID)(-2)); - - [Macro] - public static SDL_PenCapabilityFlags SDL_PEN_CAPABILITY(int capbit) => (SDL_PenCapabilityFlags)(1ul << (capbit)); - - [Macro] - public static SDL_PenCapabilityFlags SDL_PEN_AXIS_CAPABILITY(SDL_PenAxis axis) => SDL_PEN_CAPABILITY((int)axis + SDL_PEN_FLAG_AXIS_BIT_OFFSET); - - [MustDisposeResource] - public static unsafe SDLArray? SDL_GetPens() - { - int count; - var array = SDL_GetPens(&count); - return SDLArray.Create(array, count); - } + SDL_PEN_INPUT_DOWN = SDL3.SDL_PEN_INPUT_DOWN, + SDL_PEN_INPUT_BUTTON_1 = SDL3.SDL_PEN_INPUT_BUTTON_1, + SDL_PEN_INPUT_BUTTON_2 = SDL3.SDL_PEN_INPUT_BUTTON_2, + SDL_PEN_INPUT_BUTTON_3 = SDL3.SDL_PEN_INPUT_BUTTON_3, + SDL_PEN_INPUT_BUTTON_4 = SDL3.SDL_PEN_INPUT_BUTTON_4, + SDL_PEN_INPUT_BUTTON_5 = SDL3.SDL_PEN_INPUT_BUTTON_5, + SDL_PEN_INPUT_ERASER_TIP = SDL3.SDL_PEN_INPUT_ERASER_TIP, } } diff --git a/SDL3-CS/SDL3/SDL_stdinc.cs b/SDL3-CS/SDL3/SDL_stdinc.cs index ca0fe5d..fc84885 100644 --- a/SDL3-CS/SDL3/SDL_stdinc.cs +++ b/SDL3-CS/SDL3/SDL_stdinc.cs @@ -6,7 +6,7 @@ using System; namespace SDL { [Typedef] - public enum SDL_bool + public enum SDL_bool : byte { SDL_FALSE = SDL3.SDL_FALSE, SDL_TRUE = SDL3.SDL_TRUE diff --git a/SDL3-CS/generate_bindings.py b/SDL3-CS/generate_bindings.py index 049e2db..b2afd3f 100644 --- a/SDL3-CS/generate_bindings.py +++ b/SDL3-CS/generate_bindings.py @@ -90,6 +90,7 @@ headers = [ add("SDL3/SDL_events.h"), add("SDL3/SDL_filesystem.h"), add("SDL3/SDL_gamepad.h"), + add("SDL3/SDL_gpu.h"), add("SDL3/SDL_guid.h"), add("SDL3/SDL_haptic.h"), add("SDL3/SDL_hidapi.h"), @@ -111,6 +112,7 @@ headers = [ add("SDL3/SDL_pixels.h"), add("SDL3/SDL_platform.h"), add("SDL3/SDL_power.h"), + add("SDL3/SDL_process.h"), add("SDL3/SDL_properties.h"), add("SDL3/SDL_rect.h"), add("SDL3/SDL_render.h"), @@ -312,7 +314,8 @@ def main(): check_generated_functions(sdl_api, header, [output_file]) generate_platform_specific_headers(sdl_api, add("SDL3/SDL_main.h"), [ - (["SDL_PLATFORM_WIN32", "SDL_PLATFORM_WINGDK"], "Windows", "Windows"), + (["SDL_PLATFORM_WINDOWS"], "Windows", "Windows"), + (["SDL_PLATFORM_GDK"], "GDK", "Windows"), ]) generate_platform_specific_headers(sdl_api, add("SDL3/SDL_system.h"), [ @@ -320,8 +323,8 @@ def main(): (["SDL_PLATFORM_ANDROID"], "Android", "Android"), (["SDL_PLATFORM_IOS"], "iOS", "iOS"), (["SDL_PLATFORM_LINUX"], "Linux", "Linux"), - (["SDL_PLATFORM_WIN32", "SDL_PLATFORM_WINGDK"], "Windows", "Windows"), - (["SDL_PLATFORM_WINRT"], "WinRT", "Windows"), + (["SDL_PLATFORM_WINDOWS", "SDL_PLATFORM_WIN32"], "Windows", "Windows"), + (["SDL_PLATFORM_GDK"], "GDK", "Windows"), ])