Merge pull request #147 from Susko3/update-SDL-bool

Update SDL bindings (removal of SDL_bool, replaced with C# SDLBool)
This commit is contained in:
Dan Balasescu 2024-09-22 13:18:19 +09:00 committed by GitHub
commit d4bb6809ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
59 changed files with 1171 additions and 667 deletions

2
External/SDL vendored

@ -1 +1 @@
Subproject commit 93bf53426840fd052da2aeb6d5a5a6f380f4c21a
Subproject commit 97d1056e16d44f67df3b19e1fac8378399ae5f3d

View File

@ -1,48 +0,0 @@
diff --git a/include/SDL3/SDL.h b/include/SDL3/SDL.h
index 4e18f6382..d737c7a9a 100644
--- a/include/SDL3/SDL.h
+++ b/include/SDL3/SDL.h
@@ -28,6 +28,8 @@
#ifndef SDL_h_
#define SDL_h_
+#error Don't build with enum type changes
+
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_assert.h>
#include <SDL3/SDL_atomic.h>
diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h
index 3c0e80f38..44f58add3 100644
--- a/include/SDL3/SDL_log.h
+++ b/include/SDL3/SDL_log.h
@@ -407,7 +407,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LogMessageV(int category,
*
* \since This datatype is available since SDL 3.0.0.
*/
-typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
+typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, SDL_LogCategory category, SDL_LogPriority priority, const char *message);
/**
* Get the current log output function.
diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h
index 5539f2a81..3155f3f31 100644
--- a/include/SDL3/SDL_stdinc.h
+++ b/include/SDL3/SDL_stdinc.h
@@ -194,7 +194,7 @@ void *alloca(size_t);
*
* \sa SDL_bool
*/
-#define SDL_FALSE false
+#define SDL_FALSE (SDL_bool)0
/**
* A boolean true.
@@ -203,7 +203,7 @@ void *alloca(size_t);
*
* \sa SDL_bool
*/
-#define SDL_TRUE true
+#define SDL_TRUE (SDL_bool)1
/**
* A boolean type: true or false.

View File

@ -54,7 +54,7 @@ namespace SDL.Tests
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static void LogOutput(IntPtr userdata, SDL_LogCategory category, SDL_LogPriority priority, byte* message)
private static void LogOutput(IntPtr userdata, int category, SDL_LogPriority priority, byte* message)
{
Console.WriteLine(SDL3.PtrToStringUTF8(message));
}

View File

@ -19,7 +19,7 @@ namespace SDL.Tests
public MyWindow()
{
if (SDL_InitSubSystem(init_flags) == SDL_bool.SDL_FALSE)
if (!SDL_InitSubSystem(init_flags))
throw new InvalidOperationException($"failed to initialise SDL. Error: {SDL_GetError()}");
initSuccess = true;
@ -29,7 +29,7 @@ namespace SDL.Tests
public void Setup()
{
SDL_SetGamepadEventsEnabled(SDL_bool.SDL_TRUE);
SDL_SetGamepadEventsEnabled(true);
SDL_SetEventFilter(&nativeFilter, objectHandle.Handle);
if (OperatingSystem.IsWindows())
@ -37,7 +37,7 @@ namespace SDL.Tests
}
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
private static SDL_bool wndProc(IntPtr userdata, MSG* message)
private static SDLBool wndProc(IntPtr userdata, MSG* message)
{
var handle = new ObjectHandle<MyWindow>(userdata);
@ -46,23 +46,23 @@ namespace SDL.Tests
Console.WriteLine($"from {window}, message: {message->message}");
}
return SDL_TRUE; // sample use of definition from SDL3 class, not SDL_bool enum
return true;
}
// ReSharper disable once UseCollectionExpression
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
private static SDL_bool nativeFilter(IntPtr userdata, SDL_Event* e)
private static SDLBool nativeFilter(IntPtr userdata, SDL_Event* e)
{
var handle = new ObjectHandle<MyWindow>(userdata);
if (handle.GetTarget(out var window))
return window.handleEventFromFilter(e);
return SDL_bool.SDL_TRUE;
return true;
}
public Action<SDL_Event>? EventFilter;
private SDL_bool handleEventFromFilter(SDL_Event* e)
private bool handleEventFromFilter(SDL_Event* e)
{
switch (e->Type)
{
@ -76,7 +76,7 @@ namespace SDL.Tests
break;
}
return SDL_bool.SDL_TRUE;
return 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_GetWindowRelativeMouseMode(sdlWindowHandle) == SDL_bool.SDL_TRUE;
SDL_SetWindowRelativeMouseMode(sdlWindowHandle, old ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE);
bool old = SDL_GetWindowRelativeMouseMode(sdlWindowHandle);
SDL_SetWindowRelativeMouseMode(sdlWindowHandle, !old);
break;
case SDL_Keycode.SDLK_V:
@ -115,11 +115,11 @@ namespace SDL.Tests
break;
case SDL_Keycode.SDLK_F10:
SDL_SetWindowFullscreen(sdlWindowHandle, SDL_bool.SDL_FALSE);
SDL_SetWindowFullscreen(sdlWindowHandle, false);
break;
case SDL_Keycode.SDLK_F11:
SDL_SetWindowFullscreen(sdlWindowHandle, SDL_bool.SDL_TRUE);
SDL_SetWindowFullscreen(sdlWindowHandle, true);
break;
case SDL_Keycode.SDLK_J:

View File

@ -14,8 +14,8 @@ 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})");
Console.WriteLine($"false is represented as {SDL_OutOfMemory()} (expected 0x{SDLBool.FALSE_VALUE:x2})");
Console.WriteLine($"true is represented as {SDL_ClearError()} (expected 0x{SDLBool.TRUE_VALUE:x2})");
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 ");

View File

@ -25,11 +25,11 @@ namespace SDL.Tests
public unsafe void TestClipboardData()
{
var ret = SDL3.SDL_SetClipboardData(&dataCallback, &cleanupCallback, IntPtr.Zero, "test/one", "test/two");
Assert.That(ret, Is.EqualTo(0), SDL3.SDL_GetError);
Assert.That(ret, SDL3.SDL_GetError);
Assert.That(SDL3.SDL_HasClipboardData("test/one"), Is.EqualTo(SDL_bool.SDL_TRUE));
Assert.That(SDL3.SDL_HasClipboardData("test/two"), Is.EqualTo(SDL_bool.SDL_TRUE));
Assert.That(SDL3.SDL_HasClipboardData("test/three"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/one"));
Assert.That(SDL3.SDL_HasClipboardData("test/two"));
Assert.That(!SDL3.SDL_HasClipboardData("test/three"));
UIntPtr size;
IntPtr data = SDL3.SDL_GetClipboardData("test/one", &size);
@ -46,13 +46,13 @@ namespace SDL.Tests
}
ret = SDL3.SDL_ClearClipboardData();
Assert.That(ret, Is.EqualTo(SDL_bool.SDL_TRUE), SDL3.SDL_GetError);
Assert.That(ret, SDL3.SDL_GetError);
Assert.That(cleanups, Is.EqualTo(1));
Assert.That(SDL3.SDL_HasClipboardData("test/one"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/two"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/three"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(!SDL3.SDL_HasClipboardData("test/one"));
Assert.That(!SDL3.SDL_HasClipboardData("test/two"));
Assert.That(!SDL3.SDL_HasClipboardData("test/three"));
data = SDL3.SDL_GetClipboardData("test/two", &size);

View File

@ -116,15 +116,15 @@ namespace SDL.Tests
switch (e.key.key)
{
case SDL_Keycode.SDLK_R:
SDL_SetWindowRelativeMouseMode(window, SDL_GetWindowRelativeMouseMode(window) == SDL_bool.SDL_TRUE ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE);
SDL_SetWindowRelativeMouseMode(window, !SDL_GetWindowRelativeMouseMode(window));
break;
case SDL_Keycode.SDLK_F:
SDL_SetWindowFullscreen(window, SDL_bool.SDL_TRUE);
SDL_SetWindowFullscreen(window, true);
break;
case SDL_Keycode.SDLK_W:
SDL_SetWindowFullscreen(window, SDL_bool.SDL_FALSE);
SDL_SetWindowFullscreen(window, false);
break;
}

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections;
using NUnit.Framework;
namespace SDL.Tests
@ -8,32 +9,52 @@ 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));
Assert.That((bool)SDL3.SDL_OutOfMemory(), Is.EqualTo(false));
}
[Test]
public void TestTrue()
{
Assert.That(SDL3.SDL_ClearError(), Is.EqualTo(SDL_bool.SDL_TRUE));
Assert.That((bool)SDL3.SDL_ClearError(), Is.EqualTo(true));
}
[Test]
public void TestStoreLoad([Values] SDL_bool value)
public void TestStoreLoad([Values] 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));
bool ret = SDL3.SDL_SetBooleanProperty(props, "test", value);
Assume.That(ret, Is.EqualTo(true));
Assert.That(SDL3.SDL_GetBooleanProperty(props, "test", invert(value)), Is.EqualTo(value));
Assert.That((bool)SDL3.SDL_GetBooleanProperty(props, "test", !value), Is.EqualTo(value));
SDL3.SDL_DestroyProperties(props);
}
public static IEnumerable BoolCases()
{
SDLBool[] values = [new SDLBool(4), true, false];
foreach (var x in values)
{
foreach (var y in values)
{
yield return new object[] { x, y };
}
}
}
[TestCaseSource(typeof(TestSDLBool), nameof(BoolCases))]
public void TestEquals(SDLBool first, SDLBool second)
{
Assert.That((SDLBool)(bool)first, Is.EqualTo(first));
Assert.That(first.Equals(second), Is.EqualTo((bool)first == (bool)second));
Assert.That(first == second, Is.EqualTo((bool)first == (bool)second));
}
}
}

View File

@ -33,10 +33,17 @@ namespace SDL
public int value;
}
public partial struct SDL_AtomicU32
{
[NativeTypeName("Uint32")]
public uint value;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryLockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
@ -51,26 +58,40 @@ namespace SDL
public static extern void SDL_MemoryBarrierAcquireFunction();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AtomicCompareAndSwap(SDL_AtomicInt* a, int oldval, int newval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt* a, int oldval, int newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicSet(SDL_AtomicInt* a, int v);
public static extern int SDL_SetAtomicInt(SDL_AtomicInt* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicGet(SDL_AtomicInt* a);
public static extern int SDL_GetAtomicInt(SDL_AtomicInt* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicAdd(SDL_AtomicInt* a, int v);
public static extern int SDL_AddAtomicInt(SDL_AtomicInt* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AtomicCompareAndSwapPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32* a, [NativeTypeName("Uint32")] uint oldval, [NativeTypeName("Uint32")] uint newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_SetAtomicU32(SDL_AtomicU32* a, [NativeTypeName("Uint32")] uint v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetAtomicU32(SDL_AtomicU32* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_AtomicSetPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v);
public static extern IntPtr SDL_SetAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_AtomicGetPointer([NativeTypeName("void **")] IntPtr* a);
public static extern IntPtr SDL_GetAtomicPointer([NativeTypeName("void **")] IntPtr* a);
}
}

View File

@ -79,7 +79,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -88,28 +89,34 @@ 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 SDL_bool SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream** streams, int num_streams);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream** streams, int num_streams);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -127,22 +134,26 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -151,13 +162,16 @@ namespace SDL
public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -169,28 +183,36 @@ namespace SDL
public static extern int SDL_GetAudioStreamQueued(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_FlushAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlushAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ClearAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_LockAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_UnlockAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UnlockAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyAudioStream(SDL_AudioStream* stream);
@ -199,19 +221,24 @@ 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]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LoadWAV_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, SDL_AudioFormat format, [NativeTypeName("Uint32")] uint len, float volume);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 *")]

View File

@ -92,7 +92,8 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera* camera);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetCameraFormat(SDL_Camera* camera, SDL_CameraSpec* spec);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -31,36 +31,43 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetClipboardText([NativeTypeName("const char *")] byte* text);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetClipboardText([NativeTypeName("const char *")] byte* text);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetClipboardText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasClipboardText();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasClipboardText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPrimarySelectionText", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetPrimarySelectionText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasPrimarySelectionText();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasPrimarySelectionText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, nuint*, IntPtr> callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("const char **")] byte** mime_types, [NativeTypeName("size_t")] nuint num_mime_types);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, nuint*, IntPtr> callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> 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 SDL_bool SDL_ClearClipboardData();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearClipboardData();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_GetClipboardData([NativeTypeName("const char *")] byte* mime_type, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasClipboardData([NativeTypeName("const char *")] byte* mime_type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasClipboardData([NativeTypeName("const char *")] byte* mime_type);
}
}

View File

@ -30,52 +30,66 @@ namespace SDL
public static partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCPUCount();
public static extern int SDL_GetNumLogicalCPUCores();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCPUCacheLineSize();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAltiVec();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAltiVec();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasMMX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasMMX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE2();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE2();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE3();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE3();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE41();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE41();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE42();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE42();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX2();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX2();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX512F();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX512F();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasARMSIMD();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasARMSIMD();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasNEON();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasNEON();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasLSX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasLSX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasLASX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasLASX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSystemRAM();

View File

@ -40,12 +40,12 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowOpenFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location, SDL_bool allow_many);
public static extern void SDL_ShowOpenFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location, [NativeTypeName("bool")] SDLBool allow_many);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowSaveFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowOpenFolderDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const char *")] byte* default_location, SDL_bool allow_many);
public static extern void SDL_ShowOpenFolderDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const char *")] byte* default_location, [NativeTypeName("bool")] SDLBool allow_many);
}
}

View File

@ -30,16 +30,19 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_OutOfMemory();
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_ClearError();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearError();
}
}

View File

@ -231,9 +231,11 @@ namespace SDL
[NativeTypeName("Uint16")]
public ushort raw;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
public SDL_bool repeat;
[NativeTypeName("bool")]
public SDLBool repeat;
}
public unsafe partial struct SDL_TextEditingEvent
@ -279,7 +281,8 @@ namespace SDL
[NativeTypeName("Sint32")]
public int selected_candidate;
public SDL_bool horizontal;
[NativeTypeName("bool")]
public SDLBool horizontal;
[NativeTypeName("Uint8")]
public byte padding1;
@ -362,7 +365,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte clicks;
@ -502,7 +506,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte padding1;
@ -587,7 +592,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte padding1;
@ -674,7 +680,8 @@ namespace SDL
public SDL_AudioDeviceID which;
public SDL_bool recording;
[NativeTypeName("bool")]
public SDLBool recording;
[NativeTypeName("Uint8")]
public byte padding1;
@ -782,9 +789,11 @@ namespace SDL
public float y;
public SDL_bool eraser;
[NativeTypeName("bool")]
public SDLBool eraser;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
}
public partial struct SDL_PenButtonEvent
@ -810,7 +819,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
public SDL_bool down;
[NativeTypeName("bool")]
public SDLBool down;
}
public partial struct SDL_PenAxisEvent
@ -1073,10 +1083,12 @@ namespace SDL
public static extern int SDL_PeepEvents(SDL_Event* events, int numevents, SDL_EventAction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasEvent([NativeTypeName("Uint32")] uint type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasEvent([NativeTypeName("Uint32")] uint type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_FlushEvent([NativeTypeName("Uint32")] uint type);
@ -1085,37 +1097,44 @@ namespace SDL
public static extern void SDL_FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PollEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PollEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitEventTimeout(SDL_Event* @event, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitEventTimeout(SDL_Event* @event, [NativeTypeName("Sint32")] int timeoutMS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PushEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PushEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDL_bool> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> 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]<IntPtr, SDL_Event*, SDL_bool>* filter, [NativeTypeName("void **")] IntPtr* userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool>* filter, [NativeTypeName("void **")] IntPtr* userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDL_bool> filter, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_RemoveEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDL_bool> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_RemoveEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDL_bool> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> 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);
public static extern void SDL_SetEventEnabled([NativeTypeName("Uint32")] uint type, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EventEnabled([NativeTypeName("Uint32")] uint type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EventEnabled([NativeTypeName("Uint32")] uint type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]

View File

@ -81,22 +81,28 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetUserFolder(SDL_Folder folder);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CreateDirectory([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CreateDirectory([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RemovePath([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RemovePath([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CopyFile([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CopyFile([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]

View File

@ -183,13 +183,14 @@ namespace SDL
public static extern int SDL_AddGamepadMapping([NativeTypeName("const char *")] byte* mapping);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddGamepadMappingsFromIO(SDL_IOStream* src, SDL_bool closeio);
public static extern int SDL_AddGamepadMappingsFromIO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddGamepadMappingsFromFile([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReloadGamepadMappings();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReloadGamepadMappings();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]
@ -204,16 +205,19 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadMapping(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, [NativeTypeName("const char *")] byte* mapping);
[return: NativeTypeName("bool")]
public static extern SDLBool 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();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasGamepad();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID* SDL_GetGamepads(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsGamepad(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadNameForID", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -284,7 +288,8 @@ namespace SDL
public static extern int SDL_GetGamepadPlayerIndex(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint16")]
@ -317,16 +322,18 @@ namespace SDL
public static extern SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad* gamepad, int* percent);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadConnected(SDL_Gamepad* gamepad);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadConnected(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Joystick* SDL_GetGamepadJoystick(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetGamepadEventsEnabled(SDL_bool enabled);
public static extern void SDL_SetGamepadEventsEnabled([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadEventsEnabled();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadEventsEnabled();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GamepadBinding** SDL_GetGamepadBindings(SDL_Gamepad* gamepad, int* count);
@ -349,7 +356,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadHasAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint16")]
@ -363,10 +371,12 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadStringForButton(SDL_GamepadButton button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -381,34 +391,43 @@ namespace SDL
public static extern int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad* gamepad, int touchpad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, SDL_bool* down, float* x, float* y, float* pressure);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, [NativeTypeName("bool *")] SDLBool* 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasSensor(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetGamepadSensorDataRate(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetGamepadLED(SDL_Gamepad* gamepad, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SendGamepadEffect(SDL_Gamepad* gamepad, [NativeTypeName("const void *")] IntPtr data, int size);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -100,6 +100,8 @@ namespace SDL
{
SDL_GPU_STOREOP_STORE,
SDL_GPU_STOREOP_DONT_CARE,
SDL_GPU_STOREOP_RESOLVE,
SDL_GPU_STOREOP_RESOLVE_AND_STORE,
}
public enum SDL_GPUIndexElementSize
@ -553,9 +555,11 @@ namespace SDL
public float max_lod;
public SDL_bool enable_anisotropy;
[NativeTypeName("bool")]
public SDLBool enable_anisotropy;
public SDL_bool enable_compare;
[NativeTypeName("bool")]
public SDLBool enable_compare;
[NativeTypeName("Uint8")]
public byte padding1;
@ -636,9 +640,11 @@ namespace SDL
public SDL_GPUColorComponentFlags color_write_mask;
public SDL_bool enable_blend;
[NativeTypeName("bool")]
public SDLBool enable_blend;
public SDL_bool enable_color_write_mask;
[NativeTypeName("bool")]
public SDLBool enable_color_write_mask;
[NativeTypeName("Uint8")]
public byte padding2;
@ -736,7 +742,8 @@ namespace SDL
public float depth_bias_slope_factor;
public SDL_bool enable_depth_bias;
[NativeTypeName("bool")]
public SDLBool enable_depth_bias;
[NativeTypeName("Uint8")]
public byte padding1;
@ -755,7 +762,8 @@ namespace SDL
[NativeTypeName("Uint32")]
public uint sample_mask;
public SDL_bool enable_mask;
[NativeTypeName("bool")]
public SDLBool enable_mask;
[NativeTypeName("Uint8")]
public byte padding1;
@ -781,11 +789,14 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte write_mask;
public SDL_bool enable_depth_test;
[NativeTypeName("bool")]
public SDLBool enable_depth_test;
public SDL_bool enable_depth_write;
[NativeTypeName("bool")]
public SDLBool enable_depth_write;
public SDL_bool enable_stencil_test;
[NativeTypeName("bool")]
public SDLBool enable_stencil_test;
[NativeTypeName("Uint8")]
public byte padding1;
@ -804,7 +815,7 @@ namespace SDL
public SDL_GPUColorTargetBlendState blend_state;
}
public unsafe partial struct SDL_GpuGraphicsPipelineTargetInfo
public unsafe partial struct SDL_GPUGraphicsPipelineTargetInfo
{
[NativeTypeName("const SDL_GPUColorTargetDescription *")]
public SDL_GPUColorTargetDescription* color_target_descriptions;
@ -814,7 +825,8 @@ namespace SDL
public SDL_GPUTextureFormat depth_stencil_format;
public SDL_bool has_depth_stencil_target;
[NativeTypeName("bool")]
public SDLBool has_depth_stencil_target;
[NativeTypeName("Uint8")]
public byte padding1;
@ -842,7 +854,7 @@ namespace SDL
public SDL_GPUDepthStencilState depth_stencil_state;
public SDL_GpuGraphicsPipelineTargetInfo target_info;
public SDL_GPUGraphicsPipelineTargetInfo target_info;
public SDL_PropertiesID props;
}
@ -906,16 +918,25 @@ namespace SDL
public SDL_GPUStoreOp store_op;
public SDL_bool cycle;
public SDL_GPUTexture* resolve_texture;
[NativeTypeName("Uint32")]
public uint resolve_mip_level;
[NativeTypeName("Uint32")]
public uint resolve_layer;
[NativeTypeName("bool")]
public SDLBool cycle;
[NativeTypeName("bool")]
public SDLBool cycle_resolve_texture;
[NativeTypeName("Uint8")]
public byte padding1;
[NativeTypeName("Uint8")]
public byte padding2;
[NativeTypeName("Uint8")]
public byte padding3;
}
public unsafe partial struct SDL_GPUDepthStencilTargetInfo
@ -932,7 +953,8 @@ namespace SDL
public SDL_GPUStoreOp stencil_store_op;
public SDL_bool cycle;
[NativeTypeName("bool")]
public SDLBool cycle;
[NativeTypeName("Uint8")]
public byte clear_stencil;
@ -958,7 +980,8 @@ namespace SDL
public SDL_GPUFilter filter;
public SDL_bool cycle;
[NativeTypeName("bool")]
public SDLBool cycle;
[NativeTypeName("Uint8")]
public byte padding1;
@ -989,7 +1012,8 @@ namespace SDL
{
public SDL_GPUBuffer* buffer;
public SDL_bool cycle;
[NativeTypeName("bool")]
public SDLBool cycle;
[NativeTypeName("Uint8")]
public byte padding1;
@ -1011,7 +1035,8 @@ namespace SDL
[NativeTypeName("Uint32")]
public uint layer;
public SDL_bool cycle;
[NativeTypeName("bool")]
public SDLBool cycle;
[NativeTypeName("Uint8")]
public byte padding1;
@ -1026,13 +1051,15 @@ namespace SDL
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
public static extern SDL_GPUDevice* SDL_CreateGPUDevice(SDL_GPUShaderFormat format_flags, [NativeTypeName("bool")] SDLBool debug_mode, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUDevice* SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props);
@ -1206,7 +1233,7 @@ namespace SDL
[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);
public static extern IntPtr SDL_MapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transfer_buffer, [NativeTypeName("bool")] SDLBool cycle);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnmapGPUTransferBuffer(SDL_GPUDevice* device, SDL_GPUTransferBuffer* transfer_buffer);
@ -1215,16 +1242,16 @@ namespace SDL
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);
public static extern void SDL_UploadToGPUTexture(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTextureTransferInfo *")] SDL_GPUTextureTransferInfo* source, [NativeTypeName("const SDL_GPUTextureRegion *")] SDL_GPUTextureRegion* destination, [NativeTypeName("bool")] SDLBool 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);
public static extern void SDL_UploadToGPUBuffer(SDL_GPUCopyPass* copy_pass, [NativeTypeName("const SDL_GPUTransferBufferLocation *")] SDL_GPUTransferBufferLocation* source, [NativeTypeName("const SDL_GPUBufferRegion *")] SDL_GPUBufferRegion* destination, [NativeTypeName("bool")] SDLBool 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);
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, [NativeTypeName("bool")] SDLBool 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);
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, [NativeTypeName("bool")] SDLBool 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);
@ -1242,19 +1269,23 @@ namespace SDL
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -1272,10 +1303,11 @@ namespace SDL
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);
public static extern void SDL_WaitForGPUFences(SDL_GPUDevice* device, [NativeTypeName("bool")] SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -1285,10 +1317,12 @@ namespace SDL
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -346,13 +346,15 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetHapticName(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsMouseHaptic();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsMouseHaptic();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Haptic* SDL_OpenHapticFromMouse();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsJoystickHaptic(SDL_Joystick* joystick);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsJoystickHaptic(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Haptic* SDL_OpenHapticFromJoystick(SDL_Joystick* joystick);
@ -374,52 +376,66 @@ namespace SDL
public static extern int SDL_GetNumHapticAxes(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HapticEffectSupported(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HapticEffectSupported(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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 SDL_bool SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StopHapticEffect(SDL_Haptic* haptic, int effect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetHapticGain(SDL_Haptic* haptic, int gain);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHapticGain(SDL_Haptic* haptic, int gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PauseHaptic(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseHaptic(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ResumeHaptic(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeHaptic(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StopHapticEffects(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopHapticEffects(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HapticRumbleSupported(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HapticRumbleSupported(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_InitHapticRumble(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_InitHapticRumble(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StopHapticRumble(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopHapticRumble(SDL_Haptic* haptic);
[NativeTypeName("#define SDL_HAPTIC_CONSTANT (1u<<0)")]
public const uint SDL_HAPTIC_CONSTANT = (1U << 0);

View File

@ -151,6 +151,6 @@ namespace SDL
public static extern int SDL_hid_get_report_descriptor(SDL_hid_device* dev, [NativeTypeName("unsigned char *")] byte* buf, [NativeTypeName("size_t")] nuint buf_size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_hid_ble_scan(SDL_bool active);
public static extern void SDL_hid_ble_scan([NativeTypeName("bool")] SDLBool active);
}
}

View File

@ -38,13 +38,16 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetHintWithPriority([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_HintPriority priority);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ResetHint([NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResetHint([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ResetHints();
@ -54,10 +57,12 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetHint([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetHintBoolean([NativeTypeName("const char *")] byte* name, SDL_bool default_value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetHintBoolean([NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_RemoveHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
@ -329,6 +334,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK \"SDL_JOYSTICK_HIDAPI_STEAMDECK\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK => "SDL_JOYSTICK_HIDAPI_STEAMDECK"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI \"SDL_JOYSTICK_HIDAPI_STEAM_HORI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI => "SDL_JOYSTICK_HIDAPI_STEAM_HORI"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH => "SDL_JOYSTICK_HIDAPI_SWITCH"u8;

View File

@ -38,10 +38,12 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_Init(SDL_InitFlags flags);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_Init(SDL_InitFlags flags);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_InitSubSystem(SDL_InitFlags flags);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_InitSubSystem(SDL_InitFlags flags);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_QuitSubSystem(SDL_InitFlags flags);
@ -53,18 +55,17 @@ namespace SDL
public static extern void SDL_Quit();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetAppMetadata([NativeTypeName("const char *")] byte* appname, [NativeTypeName("const char *")] byte* appversion, [NativeTypeName("const char *")] byte* appidentifier);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetAppMetadataProperty([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 *")]
public static extern byte* Unsafe_SDL_GetAppMetadataProperty([NativeTypeName("const char *")] byte* name);
[NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")]
public const uint SDL_INIT_TIMER = 0x00000001U;
[NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")]
public const uint SDL_INIT_AUDIO = 0x00000010U;

View File

@ -62,11 +62,11 @@ namespace SDL
[NativeTypeName("size_t (*)(void *, const void *, size_t, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, nuint, SDL_IOStatus*, nuint> write;
[NativeTypeName("SDL_bool (*)(void *, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_IOStatus*, SDL_bool> flush;
[NativeTypeName("bool (*)(void *, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_IOStatus*, SDLBool> flush;
[NativeTypeName("SDL_bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool> close;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> close;
}
public partial struct SDL_IOStream
@ -91,7 +91,8 @@ 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 SDL_bool SDL_CloseIO(SDL_IOStream* context);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CloseIO(SDL_IOStream* context);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream* context);
@ -128,99 +129,128 @@ namespace SDL
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
public static extern IntPtr SDL_LoadFile_IO(SDL_IOStream* src, [NativeTypeName("size_t *")] nuint* datasize, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_LoadFile([NativeTypeName("const char *")] byte* file, [NativeTypeName("size_t *")] nuint* datasize);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU8(SDL_IOStream* src, [NativeTypeName("Uint8 *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU8(SDL_IOStream* src, [NativeTypeName("Uint8 *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS8(SDL_IOStream* src, [NativeTypeName("Sint8 *")] sbyte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS8(SDL_IOStream* src, [NativeTypeName("Sint8 *")] sbyte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU16LE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU16LE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS16LE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS16LE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU16BE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU16BE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS16BE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS16BE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU32LE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU32LE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS32LE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS32LE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU32BE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU32BE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS32BE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS32BE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU64LE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU64LE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS64LE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS64LE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU64BE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU64BE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS64BE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS64BE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU8(SDL_IOStream* dst, [NativeTypeName("Uint8")] byte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU8(SDL_IOStream* dst, [NativeTypeName("Uint8")] byte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS8(SDL_IOStream* dst, [NativeTypeName("Sint8")] sbyte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS8(SDL_IOStream* dst, [NativeTypeName("Sint8")] sbyte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU16LE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU16LE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS16LE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS16LE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU16BE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU16BE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS16BE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS16BE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU32LE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU32LE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS32LE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS32LE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU32BE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU32BE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS32BE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS32BE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU64LE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU64LE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS64LE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS64LE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU64BE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU64BE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS64BE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS64BE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[NativeTypeName("#define SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER \"SDL.iostream.windows.handle\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER => "SDL.iostream.windows.handle"u8;

View File

@ -140,20 +140,20 @@ namespace SDL
[NativeTypeName("void (*)(void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, int, void> SetPlayerIndex;
[NativeTypeName("SDL_bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDL_bool> Rumble;
[NativeTypeName("bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDLBool> Rumble;
[NativeTypeName("SDL_bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDL_bool> RumbleTriggers;
[NativeTypeName("bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDLBool> RumbleTriggers;
[NativeTypeName("SDL_bool (*)(void *, Uint8, Uint8, Uint8)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte, byte, byte, SDL_bool> SetLED;
[NativeTypeName("bool (*)(void *, Uint8, Uint8, Uint8)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte, byte, byte, SDLBool> SetLED;
[NativeTypeName("SDL_bool (*)(void *, const void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, SDL_bool> SendEffect;
[NativeTypeName("bool (*)(void *, const void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, SDLBool> SendEffect;
[NativeTypeName("SDL_bool (*)(void *, SDL_bool)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool, SDL_bool> SetSensorsEnabled;
[NativeTypeName("bool (*)(void *, bool)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool, SDLBool> SetSensorsEnabled;
[NativeTypeName("void (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, void> Cleanup;
@ -174,7 +174,8 @@ namespace SDL
public static extern void SDL_UnlockJoysticks();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasJoystick();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasJoystick();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID* SDL_GetJoysticks(int* count);
@ -221,28 +222,36 @@ 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 SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick* joystick, int ball, [NativeTypeName("Sint16")] short xrel, [NativeTypeName("Sint16")] short yrel);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, SDL_bool down);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, [NativeTypeName("bool")] SDLBool down);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, [NativeTypeName("bool")] SDLBool down, float x, float y, float pressure);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -259,7 +268,8 @@ namespace SDL
public static extern int SDL_GetJoystickPlayerIndex(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick* joystick, int player_index);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -291,7 +301,8 @@ namespace SDL
public static extern void SDL_GetJoystickGUIDInfo(SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_JoystickConnected(SDL_Joystick* joystick);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_JoystickConnected(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID SDL_GetJoystickID(SDL_Joystick* joystick);
@ -309,10 +320,11 @@ namespace SDL
public static extern int SDL_GetNumJoystickButtons(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetJoystickEventsEnabled(SDL_bool enabled);
public static extern void SDL_SetJoystickEventsEnabled([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_JoystickEventsEnabled();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_JoystickEventsEnabled();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UpdateJoysticks();
@ -322,29 +334,36 @@ namespace SDL
public static extern short SDL_GetJoystickAxis(SDL_Joystick* joystick, int axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetJoystickAxisInitialState(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetJoystickBall(SDL_Joystick* joystick, int ball, int* dx, int* dy);
[return: NativeTypeName("bool")]
public static extern SDLBool 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)]
public static extern SDL_bool SDL_GetJoystickButton(SDL_Joystick* joystick, int button);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetJoystickButton(SDL_Joystick* joystick, int button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetJoystickLED(SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SendJoystickEffect(SDL_Joystick* joystick, [NativeTypeName("const void *")] IntPtr data, int size);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -52,7 +52,8 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasKeyboard();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasKeyboard();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_KeyboardID* SDL_GetKeyboards(int* count);
@ -65,8 +66,8 @@ namespace SDL
public static extern SDL_Window* SDL_GetKeyboardFocus();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const SDL_bool *")]
public static extern SDL_bool* SDL_GetKeyboardState(int* numkeys);
[return: NativeTypeName("const bool *")]
public static extern SDLBool* SDL_GetKeyboardState(int* numkeys);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ResetKeyboard();
@ -78,13 +79,14 @@ namespace SDL
public static extern void SDL_SetModState(SDL_Keymod modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event);
public static extern SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, [NativeTypeName("bool")] SDLBool key_event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod* modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool 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,31 +103,40 @@ namespace SDL
public static extern SDL_Keycode SDL_GetKeyFromName([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StartTextInput(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StartTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StartTextInputWithProperties(SDL_Window* window, SDL_PropertiesID props);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TextInputActive(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StopTextInput(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ClearComposition(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearComposition(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasScreenKeyboardSupport();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasScreenKeyboardSupport();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ScreenKeyboardShown(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ScreenKeyboardShown(SDL_Window* window);
[NativeTypeName("#define SDL_PROP_TEXTINPUT_TYPE_NUMBER \"SDL.textinput.type\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTINPUT_TYPE_NUMBER => "SDL.textinput.type"u8;

View File

@ -54,7 +54,9 @@ namespace SDL
public enum SDL_LogPriority
{
SDL_LOG_PRIORITY_VERBOSE = 1,
SDL_LOG_PRIORITY_INVALID,
SDL_LOG_PRIORITY_TRACE,
SDL_LOG_PRIORITY_VERBOSE,
SDL_LOG_PRIORITY_DEBUG,
SDL_LOG_PRIORITY_INFO,
SDL_LOG_PRIORITY_WARN,
@ -78,11 +80,15 @@ namespace SDL
public static extern void SDL_ResetLogPriorities();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, [NativeTypeName("const char *")] byte* prefix);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LogTrace(int category, [NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LogVerbose(int category, [NativeTypeName("const char *")] byte* fmt, __arglist);
@ -108,9 +114,9 @@ namespace SDL
public static extern void SDL_LogMessageV(int category, SDL_LogPriority priority, [NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction *")] delegate* unmanaged[Cdecl]<IntPtr, SDL_LogCategory, SDL_LogPriority, byte*, void>* callback, [NativeTypeName("void **")] IntPtr* userdata);
public static extern void SDL_GetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction *")] delegate* unmanaged[Cdecl]<IntPtr, int, SDL_LogPriority, byte*, void>* callback, [NativeTypeName("void **")] IntPtr* userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction")] delegate* unmanaged[Cdecl]<IntPtr, SDL_LogCategory, SDL_LogPriority, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction")] delegate* unmanaged[Cdecl]<IntPtr, int, SDL_LogPriority, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
}
}

View File

@ -32,8 +32,9 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern SDL_bool SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst);
public static extern SDLBool SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]

View File

@ -96,10 +96,12 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, [NativeTypeName("const char *")] byte* title, [NativeTypeName("const char *")] byte* message, SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool 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;

View File

@ -30,6 +30,7 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_OpenURL([NativeTypeName("const char *")] byte* url);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_OpenURL([NativeTypeName("const char *")] byte* url);
}
}

View File

@ -65,7 +65,8 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasMouse();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasMouse();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_MouseID* SDL_GetMice(int* count);
@ -90,16 +91,20 @@ 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 SDL_bool SDL_WarpMouseGlobal(float x, float y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WarpMouseGlobal(float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowRelativeMouseMode(SDL_Window* window, SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowRelativeMouseMode(SDL_Window* window, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowRelativeMouseMode(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowRelativeMouseMode(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CaptureMouse(SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CaptureMouse([NativeTypeName("bool")] SDLBool 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 +116,8 @@ namespace SDL
public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetCursor(SDL_Cursor* cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetCursor(SDL_Cursor* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_GetCursor();
@ -123,13 +129,16 @@ namespace SDL
public static extern void SDL_DestroyCursor(SDL_Cursor* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ShowCursor();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowCursor();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HideCursor();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HideCursor();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CursorVisible();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CursorVisible();
[NativeTypeName("#define SDL_BUTTON_LEFT 1")]
public const int SDL_BUTTON_LEFT = 1;

View File

@ -52,7 +52,8 @@ namespace SDL
public static extern void SDL_LockMutex(SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryLockMutex(SDL_Mutex* mutex);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockMutex(SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockMutex(SDL_Mutex* mutex);
@ -70,10 +71,12 @@ namespace SDL
public static extern void SDL_LockRWLockForWriting(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock* rwlock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockRWLockForReading(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockRWLock(SDL_RWLock* rwlock);
@ -91,10 +94,12 @@ namespace SDL
public static extern void SDL_WaitSemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryWaitSemaphore(SDL_Semaphore* sem);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryWaitSemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SignalSemaphore(SDL_Semaphore* sem);
@ -119,6 +124,7 @@ namespace SDL
public static extern void SDL_WaitCondition(SDL_Condition* cond, SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS);
}
}

View File

@ -359,7 +359,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 +373,8 @@ namespace SDL
public static extern SDL_Palette* SDL_CreatePalette(int ncolors);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -43,7 +43,7 @@ namespace SDL
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);
public static extern SDL_Process* SDL_CreateProcess([NativeTypeName("const char *const *")] byte** args, [NativeTypeName("bool")] SDLBool pipe_stdio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Process* SDL_CreateProcessWithProperties(SDL_PropertiesID props);
@ -62,10 +62,12 @@ namespace SDL
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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_KillProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool force);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitProcess(SDL_Process* process, SDL_bool block, int* exitcode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool block, int* exitcode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyProcess(SDL_Process* process);

View File

@ -47,34 +47,43 @@ namespace SDL
public static extern SDL_PropertiesID SDL_CreateProperties();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_LockProperties(SDL_PropertiesID props);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
@ -95,13 +104,16 @@ namespace SDL
public static extern float SDL_GetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool default_value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_PropertiesID, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_PropertiesID, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyProperties(SDL_PropertiesID props);

View File

@ -73,69 +73,86 @@ namespace SDL
frect->h = (float)(rect->h);
}
public static SDL_bool SDL_PointInRect([NativeTypeName("const SDL_Point *")] SDL_Point* p, [NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_PointInRect([NativeTypeName("const SDL_Point *")] SDL_Point* p, [NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
{
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x < (r->x + r->w)) && (p->y >= r->y) && (p->y < (r->y + r->h))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x < (r->x + r->w)) && (p->y >= r->y) && (p->y < (r->y + r->h))) ? true : false;
}
public static SDL_bool SDL_RectEmpty([NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectEmpty([NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
{
return ((r == null) || (r->w <= 0) || (r->h <= 0)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((r == null) || (r->w <= 0) || (r->h <= 0)) ? true : false;
}
public static SDL_bool SDL_RectsEqual([NativeTypeName("const SDL_Rect *")] SDL_Rect* a, [NativeTypeName("const SDL_Rect *")] SDL_Rect* b)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqual([NativeTypeName("const SDL_Rect *")] SDL_Rect* a, [NativeTypeName("const SDL_Rect *")] SDL_Rect* b)
{
return ((a) != null && (b) != null && (a->x == b->x) && (a->y == b->y) && (a->w == b->w) && (a->h == b->h)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((a) != null && (b) != null && (a->x == b->x) && (a->y == b->y) && (a->w == b->w) && (a->h == b->h)) ? true : false;
}
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetRectUnion([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectEnclosingPoints([NativeTypeName("const SDL_Point *")] SDL_Point* points, int count, [NativeTypeName("const SDL_Rect *")] SDL_Rect* clip, SDL_Rect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectAndLineIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int* X1, int* Y1, int* X2, int* Y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectAndLineIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int* X1, int* Y1, int* X2, int* Y2);
public static SDL_bool SDL_PointInRectFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* p, [NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_PointInRectFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* p, [NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
{
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x <= (r->x + r->w)) && (p->y >= r->y) && (p->y <= (r->y + r->h))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x <= (r->x + r->w)) && (p->y >= r->y) && (p->y <= (r->y + r->h))) ? true : false;
}
public static SDL_bool SDL_RectEmptyFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectEmptyFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
{
return ((r == null) || (r->w < 0.0f) || (r->h < 0.0f)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((r == null) || (r->w < 0.0f) || (r->h < 0.0f)) ? true : false;
}
public static SDL_bool SDL_RectsEqualEpsilon([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b, [NativeTypeName("const float")] float epsilon)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqualEpsilon([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b, [NativeTypeName("const float")] float epsilon)
{
return ((a) != null && (b) != null && ((a == b) || ((SDL_fabsf(a->x - b->x) <= epsilon) && (SDL_fabsf(a->y - b->y) <= epsilon) && (SDL_fabsf(a->w - b->w) <= epsilon) && (SDL_fabsf(a->h - b->h) <= epsilon)))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((a) != null && (b) != null && ((a == b) || ((SDL_fabsf(a->x - b->x) <= epsilon) && (SDL_fabsf(a->y - b->y) <= epsilon) && (SDL_fabsf(a->w - b->w) <= epsilon) && (SDL_fabsf(a->h - b->h) <= epsilon)))) ? true : false;
}
public static SDL_bool SDL_RectsEqualFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqualFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b)
{
return SDL_RectsEqualEpsilon(a, b, 1.1920928955078125e-07F);
}
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetRectUnionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectEnclosingPointsFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count, [NativeTypeName("const SDL_FRect *")] SDL_FRect* clip, SDL_FRect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectAndLineIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* rect, float* X1, float* Y1, float* X2, float* Y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectAndLineIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* rect, float* X1, float* Y1, float* X2, float* Y2);
}
}

View File

@ -71,7 +71,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetRenderDriver(int index);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 +97,12 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 +120,245 @@ namespace SDL
public static extern SDL_Renderer* SDL_GetRendererFromTexture(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] IntPtr pixels, int pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("void **")] IntPtr* pixels, int* pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetRenderLogicalPresentation(SDL_Renderer* renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode, SDL_ScaleMode* scale_mode);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer* renderer, float x, float y, float* window_x, float* window_y);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderViewport(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderViewportSet(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderClipRect(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderClipEnabled(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderClear(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderClear(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderPoint(SDL_Renderer* renderer, float x, float y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPoint(SDL_Renderer* renderer, float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_RenderPresent(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPresent(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyTexture(SDL_Texture* texture);
@ -306,7 +367,8 @@ namespace SDL
public static extern void SDL_DestroyRenderer(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_FlushRenderer(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlushRenderer(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
@ -317,13 +379,16 @@ namespace SDL
public static extern IntPtr SDL_GetRenderMetalCommandEncoder(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync);
[NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")]
public static ReadOnlySpan<byte> SDL_SOFTWARE_RENDERER => "software"u8;

View File

@ -81,7 +81,8 @@ namespace SDL
public static extern SDL_SensorID SDL_GetSensorID(SDL_Sensor* sensor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetSensorData(SDL_Sensor* sensor, float* data, int num_values);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -74,7 +74,8 @@ namespace SDL
public static extern void SDL_GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]<nuint, IntPtr>* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr>* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr>* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]<IntPtr, void>* free_func);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl]<nuint, IntPtr> malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr> calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr> realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl]<IntPtr, void> free_func);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl]<nuint, IntPtr> malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr> calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr> realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl]<IntPtr, void> free_func);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
@ -90,10 +91,7 @@ namespace SDL
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);
public static extern SDL_Environment* SDL_CreateEnvironment([NativeTypeName("bool")] SDLBool populated);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEnvironmentVariable", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -104,14 +102,20 @@ namespace SDL
public static extern byte** SDL_GetEnvironmentVariables(SDL_Environment* env);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_bool overwrite);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, [NativeTypeName("bool")] SDLBool overwrite);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_UnsetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool 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", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_getenv([NativeTypeName("const char *")] byte* name);
[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);
@ -607,37 +611,33 @@ 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 SDL_bool SDL_size_mul_check_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret)
[return: NativeTypeName("bool")]
public static SDLBool 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 (SDL_bool)(0);
return false;
}
*ret = a * b;
return (SDL_bool)(1);
return true;
}
public static SDL_bool SDL_size_add_check_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret)
[return: NativeTypeName("bool")]
public static SDLBool 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 (SDL_bool)(0);
return false;
}
*ret = a + b;
return (SDL_bool)(1);
return true;
}
[NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")]
public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL;
[NativeTypeName("#define SDL_FALSE (SDL_bool)0")]
public const SDL_bool SDL_FALSE = (SDL_bool)(0);
[NativeTypeName("#define SDL_TRUE (SDL_bool)1")]
public const SDL_bool SDL_TRUE = (SDL_bool)(1);
[NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")]
public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F));
@ -719,6 +719,21 @@ namespace SDL
[NativeTypeName("#define SDL_PRIX32 \"X\"")]
public static ReadOnlySpan<byte> SDL_PRIX32 => "X"u8;
[NativeTypeName("#define SDL_PRILL_PREFIX \"ll\"")]
public static ReadOnlySpan<byte> SDL_PRILL_PREFIX => "ll"u8;
[NativeTypeName("#define SDL_PRILLd SDL_PRILL_PREFIX \"d\"")]
public static ReadOnlySpan<byte> SDL_PRILLd => "lld"u8;
[NativeTypeName("#define SDL_PRILLu SDL_PRILL_PREFIX \"u\"")]
public static ReadOnlySpan<byte> SDL_PRILLu => "llu"u8;
[NativeTypeName("#define SDL_PRILLx SDL_PRILL_PREFIX \"x\"")]
public static ReadOnlySpan<byte> SDL_PRILLx => "llx"u8;
[NativeTypeName("#define SDL_PRILLX SDL_PRILL_PREFIX \"X\"")]
public static ReadOnlySpan<byte> SDL_PRILLX => "llX"u8;
[NativeTypeName("#define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD")]
public const int SDL_INVALID_UNICODE_CODEPOINT = 0xFFFD;

View File

@ -33,35 +33,35 @@ namespace SDL
[NativeTypeName("Uint32")]
public uint version;
[NativeTypeName("SDL_bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool> close;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> close;
[NativeTypeName("SDL_bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool> ready;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> ready;
[NativeTypeName("SDL_bool (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int>, IntPtr, SDL_bool> enumerate;
[NativeTypeName("bool (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int>, IntPtr, SDLBool> enumerate;
[NativeTypeName("SDL_bool (*)(void *, const char *, SDL_PathInfo *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_PathInfo*, SDL_bool> info;
[NativeTypeName("bool (*)(void *, const char *, SDL_PathInfo *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_PathInfo*, SDLBool> info;
[NativeTypeName("SDL_bool (*)(void *, const char *, void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDL_bool> read_file;
[NativeTypeName("bool (*)(void *, const char *, void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDLBool> read_file;
[NativeTypeName("SDL_bool (*)(void *, const char *, const void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDL_bool> write_file;
[NativeTypeName("bool (*)(void *, const char *, const void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDLBool> write_file;
[NativeTypeName("SDL_bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_bool> mkdir;
[NativeTypeName("bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool> mkdir;
[NativeTypeName("SDL_bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_bool> remove;
[NativeTypeName("bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool> remove;
[NativeTypeName("SDL_bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDL_bool> rename;
[NativeTypeName("bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDLBool> rename;
[NativeTypeName("SDL_bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDL_bool> copy;
[NativeTypeName("bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDLBool> copy;
[NativeTypeName("Uint64 (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, ulong> space_remaining;
@ -86,37 +86,48 @@ 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 SDL_bool SDL_CloseStorage(SDL_Storage* storage);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CloseStorage(SDL_Storage* storage);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StorageReady(SDL_Storage* storage);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StorageReady(SDL_Storage* storage);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("void*")] IntPtr destination, [NativeTypeName("Uint64")] ulong length);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_WriteStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("const void *")] IntPtr source, [NativeTypeName("Uint64")] ulong length);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenameStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_CopyStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint64")]

View File

@ -80,7 +80,8 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -89,16 +90,19 @@ namespace SDL
public static extern SDL_Palette* SDL_CreateSurfacePalette(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasAlternateImages(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface** SDL_GetSurfaceImages(SDL_Surface* surface, int* count);
@ -107,64 +111,81 @@ namespace SDL
public static extern void SDL_RemoveSurfaceAlternateImages(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_LockSurface(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, SDL_bool closeio);
public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, SDL_bool closeio);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceRLE(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasRLE(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasRLE(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled, [NativeTypeName("Uint32")] uint key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasColorKey(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasColorKey(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
@ -179,46 +200,60 @@ 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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, [NativeTypeName("bool")] SDLBool linear);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, SDL_bool linear);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool linear);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_FillSurfaceRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_BlitSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_BlitSurfaceUnchecked(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_BlitSurfaceTiled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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")]
@ -229,16 +264,20 @@ 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool 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;

View File

@ -46,16 +46,19 @@ namespace SDL
public static extern int SDL_GetAndroidSDKVersion();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsAndroidTV();
public static extern SDLBool SDL_IsAndroidTV();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsChromebook();
public static extern SDLBool SDL_IsChromebook();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsDeXMode();
public static extern SDLBool SDL_IsDeXMode();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Android")]
@ -82,16 +85,19 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetAndroidCachePath();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_bool, void> cb, [NativeTypeName("void*")] IntPtr userdata);
public static extern SDLBool SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset);
public static extern SDLBool SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_SendAndroidMessage([NativeTypeName("Uint32")] uint command, int param1);
public static extern SDLBool 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;

View File

@ -39,11 +39,13 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern SDL_bool SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue);
public static extern SDLBool SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern SDL_bool SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle);
public static extern SDLBool SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle);
}
}

View File

@ -31,11 +31,13 @@ namespace SDL
public static partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Linux")]
public static extern SDL_bool SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority);
public static extern SDLBool SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Linux")]
public static extern SDL_bool SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy);
public static extern SDLBool SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy);
}
}

View File

@ -33,14 +33,15 @@ namespace SDL
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl]<IntPtr, MSG*, SDL_bool> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl]<IntPtr, MSG*, SDLBool> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex);
public static extern SDLBool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex);
}
}

View File

@ -31,10 +31,11 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetX11EventHook([NativeTypeName("SDL_X11EventHook")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, SDL_bool> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetX11EventHook([NativeTypeName("SDL_X11EventHook")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, SDLBool> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsTablet();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsTablet();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_OnApplicationWillTerminate();

View File

@ -32,12 +32,13 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("iOS")]
public static extern SDL_bool SDL_SetiOSAnimationCallback(SDL_Window* window, int interval, [NativeTypeName("SDL_iOSAnimationCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> callback, [NativeTypeName("void*")] IntPtr callbackParam);
public static extern SDLBool SDL_SetiOSAnimationCallback(SDL_Window* window, int interval, [NativeTypeName("SDL_iOSAnimationCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> callback, [NativeTypeName("void*")] IntPtr callbackParam);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("iOS")]
public static extern void SDL_SetiOSEventPump(SDL_bool enabled);
public static extern void SDL_SetiOSEventPump([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("iOS")]

View File

@ -59,7 +59,8 @@ namespace SDL
public static extern SDL_ThreadID SDL_GetThreadID(SDL_Thread* thread);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetThreadPriority(SDL_ThreadPriority priority);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 +73,8 @@ namespace SDL
public static extern IntPtr SDL_GetTLS(SDL_TLSID* id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetTLS(SDL_TLSID* id, [NativeTypeName("const void *")] IntPtr value, [NativeTypeName("SDL_TLSDestructorCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> destructor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTLS(SDL_TLSID* id, [NativeTypeName("const void *")] IntPtr value, [NativeTypeName("SDL_TLSDestructorCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> destructor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CleanupTLS();

View File

@ -64,16 +64,20 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat* dateFormat, SDL_TimeFormat* timeFormat);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetDateTimeLocalePreferences(SDL_DateFormat* dateFormat, SDL_TimeFormat* timeFormat);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetCurrentTime(SDL_Time* ticks);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetCurrentTime(SDL_Time* ticks);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime* dt, SDL_bool localTime);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime* dt, [NativeTypeName("bool")] SDLBool localTime);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_DateTimeToTime([NativeTypeName("const SDL_DateTime *")] SDL_DateTime* dt, SDL_Time* ticks);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);

View File

@ -59,7 +59,8 @@ namespace SDL
public static extern SDL_TimerID SDL_AddTimerNS([NativeTypeName("Uint64")] ulong interval, [NativeTypeName("SDL_NSTimerCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_TimerID, ulong, ulong> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RemoveTimer(SDL_TimerID id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RemoveTimer(SDL_TimerID id);
[NativeTypeName("#define SDL_MS_PER_SECOND 1000")]
public const int SDL_MS_PER_SECOND = 1000;

View File

@ -187,10 +187,12 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetDisplayName(SDL_DisplayID displayID);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 +207,8 @@ namespace SDL
public static extern SDL_DisplayMode** SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, [NativeTypeName("bool")] SDLBool include_high_density_modes, SDL_DisplayMode* mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const SDL_DisplayMode *")]
@ -231,7 +234,8 @@ namespace SDL
public static extern float SDL_GetWindowDisplayScale(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowFullscreenMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode);
[return: NativeTypeName("bool")]
public static extern SDLBool 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,171 +276,220 @@ namespace SDL
public static extern SDL_WindowFlags SDL_GetWindowFlags(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] byte* title);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetWindowIcon(SDL_Window* window, SDL_Surface* icon);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowIcon(SDL_Window* window, SDL_Surface* icon);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowPosition(SDL_Window* window, int x, int y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowPosition(SDL_Window* window, int x, int y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowPosition(SDL_Window* window, int* x, int* y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowPosition(SDL_Window* window, int* x, int* y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowSize(SDL_Window* window, int w, int h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowSize(SDL_Window* window, int w, int h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowSize(SDL_Window* window, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowSize(SDL_Window* window, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowSafeArea(SDL_Window* window, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowSafeArea(SDL_Window* window, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowAspectRatio(SDL_Window* window, float min_aspect, float max_aspect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowAspectRatio(SDL_Window* window, float min_aspect, float max_aspect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowAspectRatio(SDL_Window* window, float* min_aspect, float* max_aspect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowAspectRatio(SDL_Window* window, float* min_aspect, float* max_aspect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowSizeInPixels(SDL_Window* window, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowSizeInPixels(SDL_Window* window, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowMinimumSize(SDL_Window* window, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowMinimumSize(SDL_Window* window, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowMaximumSize(SDL_Window* window, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowMaximumSize(SDL_Window* window, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowBordered(SDL_Window* window, SDL_bool bordered);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowBordered(SDL_Window* window, [NativeTypeName("bool")] SDLBool bordered);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowResizable(SDL_Window* window, SDL_bool resizable);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowResizable(SDL_Window* window, [NativeTypeName("bool")] SDLBool resizable);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowAlwaysOnTop(SDL_Window* window, [NativeTypeName("bool")] SDLBool on_top);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ShowWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HideWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HideWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RaiseWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RaiseWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_MaximizeWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_MaximizeWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_MinimizeWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_MinimizeWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RestoreWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RestoreWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowFullscreen(SDL_Window* window, SDL_bool fullscreen);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowFullscreen(SDL_Window* window, [NativeTypeName("bool")] SDLBool fullscreen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SyncWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SyncWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WindowHasSurface(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WindowHasSurface(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_GetWindowSurface(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowSurfaceVSync(SDL_Window* window, int vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowSurfaceVSync(SDL_Window* window, int vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowSurfaceVSync(SDL_Window* window, int* vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowSurfaceVSync(SDL_Window* window, int* vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_UpdateWindowSurface(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateWindowSurface(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_DestroyWindowSurface(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_DestroyWindowSurface(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowKeyboardGrab(SDL_Window* window, [NativeTypeName("bool")] SDLBool grabbed);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowMouseGrab(SDL_Window* window, [NativeTypeName("bool")] SDLBool grabbed);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowKeyboardGrab(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetWindowMouseGrab(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowMouseGrab(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Window* SDL_GetGrabbedWindow();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetWindowOpacity(SDL_Window* window, float opacity);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_SetWindowParent(SDL_Window* window, SDL_Window* parent);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowParent(SDL_Window* window, SDL_Window* parent);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowModal(SDL_Window* window, SDL_bool modal);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowModal(SDL_Window* window, [NativeTypeName("bool")] SDLBool modal);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowFocusable(SDL_Window* window, SDL_bool focusable);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowFocusable(SDL_Window* window, [NativeTypeName("bool")] SDLBool focusable);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ShowWindowSystemMenu(SDL_Window* window, int x, int y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowWindowSystemMenu(SDL_Window* window, int x, int y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl]<SDL_Window*, SDL_Point*, IntPtr, SDL_HitTestResult> callback, [NativeTypeName("void*")] IntPtr callback_data);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl]<SDL_Window*, SDL_Point*, IntPtr, SDL_HitTestResult> callback, [NativeTypeName("void*")] IntPtr callback_data);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetWindowShape(SDL_Window* window, SDL_Surface* shape);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlashWindow(SDL_Window* window, SDL_FlashOperation operation);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ScreenSaverEnabled();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ScreenSaverEnabled();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EnableScreenSaver();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnableScreenSaver();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_DisableScreenSaver();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_DisableScreenSaver();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_LoadLibrary([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_LoadLibrary([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
@ -450,23 +503,27 @@ namespace SDL
public static extern void SDL_GL_UnloadLibrary();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_ExtensionSupported([NativeTypeName("const char *")] byte* extension);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_ExtensionSupported([NativeTypeName("const char *")] byte* extension);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GL_ResetAttributes();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_SetAttribute(SDL_GLattr attr, int value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_SetAttribute(SDL_GLattr attr, int value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
[return: NativeTypeName("bool")]
public static extern SDLBool 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 SDL_bool SDL_GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] SDL_GLContextState* context);
[return: NativeTypeName("bool")]
public static extern SDLBool 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();
@ -491,16 +548,20 @@ namespace SDL
public static extern void SDL_EGL_SetAttributeCallbacks([NativeTypeName("SDL_EGLAttribArrayCallback")] delegate* unmanaged[Cdecl]<nint*> platformAttribCallback, [NativeTypeName("SDL_EGLIntArrayCallback")] delegate* unmanaged[Cdecl]<int*> surfaceAttribCallback, [NativeTypeName("SDL_EGLIntArrayCallback")] delegate* unmanaged[Cdecl]<int*> contextAttribCallback);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_SetSwapInterval(int interval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_SetSwapInterval(int interval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_GetSwapInterval(int* interval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_GetSwapInterval(int* interval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_SwapWindow(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GL_SwapWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GL_DestroyContext([NativeTypeName("SDL_GLContext")] SDL_GLContextState* context);
[return: NativeTypeName("bool")]
public static extern SDLBool 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<byte> SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER => "SDL.video.wayland.wl_display"u8;

View File

@ -47,7 +47,8 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_Vulkan_LoadLibrary([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_Vulkan_LoadLibrary([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
@ -61,12 +62,14 @@ namespace SDL
public static extern byte** SDL_Vulkan_GetInstanceExtensions([NativeTypeName("Uint32 *")] uint* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
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);
[return: NativeTypeName("bool")]
public static extern SDLBool 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);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_Vulkan_GetPresentationSupport([NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("VkPhysicalDevice")] VkPhysicalDevice_T* physicalDevice, [NativeTypeName("Uint32")] uint queueFamilyIndex);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_Vulkan_GetPresentationSupport([NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("VkPhysicalDevice")] VkPhysicalDevice_T* physicalDevice, [NativeTypeName("Uint32")] uint queueFamilyIndex);
}
}

View File

@ -6,9 +6,9 @@ namespace SDL
public unsafe partial class SDL3
{
[Macro]
public static int SDL_AtomicIncRef(SDL_AtomicInt* a) => SDL_AtomicAdd(a, 1);
public static int SDL_AtomicIncRef(SDL_AtomicInt* a) => SDL_AddAtomicInt(a, 1);
[Macro]
public static bool SDL_AtomicDecRef(SDL_AtomicInt* a) => SDL_AtomicAdd(a, -1) == 1;
public static bool SDL_AtomicDecRef(SDL_AtomicInt* a) => SDL_AddAtomicInt(a, -1) == 1;
}
}

View File

@ -14,9 +14,9 @@ namespace SDL
{
[LibraryImport("SDL3", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static unsafe partial SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, string[] mime_types, UIntPtr num_mime_types);
private static unsafe partial SDLBool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, string[] mime_types, UIntPtr num_mime_types);
public static unsafe SDL_bool SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, IntPtr userdata, params string[] mime_types)
public static unsafe SDLBool 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);
}
}

View File

@ -6,14 +6,14 @@ namespace SDL
public static partial class SDL3
{
[Macro]
public static unsafe SDL_bool SDL_Unsupported()
public static unsafe SDLBool SDL_Unsupported()
{
fixed (byte* fmt = "That operation is not supported"u8)
return SDL_SetError(fmt, __arglist());
}
[Macro]
public static unsafe SDL_bool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param)
public static unsafe SDLBool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param)
{
fixed (byte* fmt = "Parameter '%s' is invalid"u8)
return SDL_SetError(fmt, __arglist(param));

View File

@ -58,10 +58,10 @@ namespace SDL
return SDL_PeepEvents(eventsPtr, events.Length, action, (uint)minType, (uint)maxType);
}
public static SDL_bool SDL_HasEvent(SDL_EventType type) => SDL_HasEvent((uint)type);
public static SDLBool SDL_HasEvent(SDL_EventType type) => SDL_HasEvent((uint)type);
public static void SDL_FlushEvent(SDL_EventType type) => SDL_FlushEvent((uint)type);
public static void SDL_FlushEvents(SDL_EventType minType, SDL_EventType maxType) => SDL_FlushEvents((uint)minType, (uint)maxType);
public static void SDL_SetEventEnabled(SDL_EventType type, SDL_bool enabled) => SDL_SetEventEnabled((uint)type, enabled);
public static SDL_bool SDL_EventEnabled(SDL_EventType type) => SDL_EventEnabled((uint)type);
public static void SDL_SetEventEnabled(SDL_EventType type, bool enabled) => SDL_SetEventEnabled((uint)type, enabled);
public static SDLBool SDL_EventEnabled(SDL_EventType type) => SDL_EventEnabled((uint)type);
}
}

View File

@ -9,7 +9,6 @@ namespace SDL
[Typedef]
public enum SDL_InitFlags : UInt32
{
SDL_INIT_TIMER = SDL3.SDL_INIT_TIMER,
SDL_INIT_AUDIO = SDL3.SDL_INIT_AUDIO,
SDL_INIT_VIDEO = SDL3.SDL_INIT_VIDEO,
SDL_INIT_JOYSTICK = SDL3.SDL_INIT_JOYSTICK,

View File

@ -2,14 +2,40 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Text;
namespace SDL
{
[Typedef]
public enum SDL_bool : byte
public readonly record struct SDLBool
{
SDL_FALSE = SDL3.SDL_FALSE,
SDL_TRUE = SDL3.SDL_TRUE
private readonly byte value;
internal const byte FALSE_VALUE = 0;
internal const byte TRUE_VALUE = 1;
[Obsolete("Never explicitly construct an SDL bool.")]
public SDLBool()
{
}
internal SDLBool(byte value)
{
this.value = value;
}
public static implicit operator bool(SDLBool b) => b.value != FALSE_VALUE;
public static implicit operator SDLBool(bool b) => new SDLBool(b ? TRUE_VALUE : FALSE_VALUE);
public bool Equals(SDLBool other) => (bool)other == (bool)this;
public override int GetHashCode() => ((bool)this).GetHashCode();
private bool PrintMembers(StringBuilder builder)
{
builder.Append($"0x{value:x2}");
return true;
}
}
[Typedef]

View File

@ -27,6 +27,7 @@ SDL3_header_base = "SDL3" # base folder of header files
csproj_root = repository_root / "SDL3-CS"
class Header:
"""Represents a SDL header file that is used in ClangSharp generation."""
@ -130,20 +131,15 @@ headers = [
add("SDL3/SDL_vulkan.h"),
]
def prepare_sdl_source():
subprocess.run([
"git",
"reset",
"--hard",
"HEAD"
], cwd = SDL_root)
], cwd=SDL_root)
subprocess.run([
"git",
"apply",
"--3way",
repository_root / "External" / "SDL-use-proper-types.patch"
], cwd = SDL_root)
def get_sdl_api_dump():
subprocess.run([
@ -233,6 +229,7 @@ base_command = [
"void*=IntPtr",
"char=byte",
"wchar_t *=IntPtr", # wchar_t has a platform-defined size
"bool=SDLBool", # treat bool as C# helper type
"--define-macro",
"SDL_FUNCTION_POINTER_IS_VOID_POINTER",