Merge pull request #91 from hwsmm/update-bindings

Update bindings
This commit is contained in:
Dan Balasescu 2024-07-16 11:05:09 +09:00 committed by GitHub
commit f1398313d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 1009 additions and 822 deletions

View File

@ -55,18 +55,22 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetCurrentAudioDriver();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioDeviceID* SDL_GetAudioOutputDevices(int* count);
public static extern SDL_AudioDeviceID* SDL_GetAudioPlaybackDevices(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioDeviceID* SDL_GetAudioCaptureDevices(int* count);
public static extern SDL_AudioDeviceID* SDL_GetAudioRecordingDevices(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceName", ExactSpelling = true)]
[return: NativeTypeName("char *")]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
@ -79,6 +83,12 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool 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 int SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
@ -115,6 +125,26 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioStreamGain(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamInputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const int *")]
public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);
@ -133,6 +163,12 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PauseAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockAudioStream(SDL_AudioStream* stream);
@ -205,10 +241,10 @@ namespace SDL
[NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1u<<15)")]
public const uint SDL_AUDIO_MASK_SIGNED = (1U << 15);
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_OUTPUT ((SDL_AudioDeviceID) 0xFFFFFFFF)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_OUTPUT = ((SDL_AudioDeviceID)(0xFFFFFFFF));
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK ((SDL_AudioDeviceID) 0xFFFFFFFF)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK = ((SDL_AudioDeviceID)(0xFFFFFFFF));
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_CAPTURE ((SDL_AudioDeviceID) 0xFFFFFFFE)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_CAPTURE = ((SDL_AudioDeviceID)(0xFFFFFFFE));
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFE)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFE));
}
}

View File

@ -33,15 +33,17 @@ namespace SDL
public partial struct SDL_CameraSpec
{
public SDL_PixelFormatEnum format;
public SDL_PixelFormat format;
public SDL_Colorspace colorspace;
public int width;
public int height;
public int interval_numerator;
public int framerate_numerator;
public int interval_denominator;
public int framerate_denominator;
}
public enum SDL_CameraPosition
@ -71,7 +73,7 @@ namespace SDL
public static extern SDL_CameraSpec* SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCameraDeviceName", ExactSpelling = true)]
[return: NativeTypeName("char *")]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]

View File

@ -40,10 +40,10 @@ 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, [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, SDL_bool 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, [NativeTypeName("const char *")] byte* default_location);
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);

View File

@ -46,9 +46,8 @@ namespace SDL
SDL_EVENT_DISPLAY_REMOVED,
SDL_EVENT_DISPLAY_MOVED,
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_DISPLAY_HDR_STATE_CHANGED,
SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION,
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_HDR_STATE_CHANGED,
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_WINDOW_SHOWN = 0x202,
SDL_EVENT_WINDOW_HIDDEN,
SDL_EVENT_WINDOW_EXPOSED,
@ -63,7 +62,6 @@ namespace SDL
SDL_EVENT_WINDOW_FOCUS_GAINED,
SDL_EVENT_WINDOW_FOCUS_LOST,
SDL_EVENT_WINDOW_CLOSE_REQUESTED,
SDL_EVENT_WINDOW_TAKE_FOCUS,
SDL_EVENT_WINDOW_HIT_TEST,
SDL_EVENT_WINDOW_ICCPROF_CHANGED,
SDL_EVENT_WINDOW_DISPLAY_CHANGED,
@ -74,6 +72,7 @@ namespace SDL
SDL_EVENT_WINDOW_DESTROYED,
SDL_EVENT_WINDOW_PEN_ENTER,
SDL_EVENT_WINDOW_PEN_LEAVE,
SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_PEN_LEAVE,
SDL_EVENT_KEY_DOWN = 0x300,
@ -83,6 +82,7 @@ namespace SDL
SDL_EVENT_KEYMAP_CHANGED,
SDL_EVENT_KEYBOARD_ADDED,
SDL_EVENT_KEYBOARD_REMOVED,
SDL_EVENT_TEXT_EDITING_CANDIDATES,
SDL_EVENT_MOUSE_MOTION = 0x400,
SDL_EVENT_MOUSE_BUTTON_DOWN,
SDL_EVENT_MOUSE_BUTTON_UP,
@ -214,19 +214,20 @@ namespace SDL
public SDL_KeyboardID which;
public SDL_Scancode scancode;
public SDL_Keycode key;
public SDL_Keymod mod;
[NativeTypeName("Uint16")]
public ushort raw;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("Uint8")]
public byte repeat;
[NativeTypeName("Uint8")]
public byte padding2;
[NativeTypeName("Uint8")]
public byte padding3;
public SDL_Keysym keysym;
}
public unsafe partial struct SDL_TextEditingEvent
@ -241,7 +242,7 @@ namespace SDL
public SDL_WindowID windowID;
[NativeTypeName("char *")]
[NativeTypeName("const char *")]
public byte* text;
[NativeTypeName("Sint32")]
@ -251,6 +252,30 @@ namespace SDL
public int length;
}
public unsafe partial struct SDL_TextEditingCandidatesEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public SDL_WindowID windowID;
[NativeTypeName("const char *const *")]
public byte** candidates;
[NativeTypeName("Sint32")]
public int num_candidates;
[NativeTypeName("Sint32")]
public int selected_candidate;
public SDL_bool horizontal;
}
public unsafe partial struct SDL_TextInputEvent
{
public SDL_EventType type;
@ -263,7 +288,7 @@ namespace SDL
public SDL_WindowID windowID;
[NativeTypeName("char *")]
[NativeTypeName("const char *")]
public byte* text;
}
@ -294,8 +319,7 @@ namespace SDL
public SDL_MouseID which;
[NativeTypeName("Uint32")]
public uint state;
public SDL_MouseButtonFlags state;
public float x;
@ -639,7 +663,7 @@ namespace SDL
public SDL_AudioDeviceID which;
[NativeTypeName("Uint8")]
public byte iscapture;
public byte recording;
[NativeTypeName("Uint8")]
public byte padding1;
@ -818,10 +842,10 @@ namespace SDL
public float y;
[NativeTypeName("char *")]
[NativeTypeName("const char *")]
public byte* source;
[NativeTypeName("char *")]
[NativeTypeName("const char *")]
public byte* data;
}
@ -920,6 +944,9 @@ namespace SDL
[FieldOffset(0)]
public SDL_TextEditingEvent edit;
[FieldOffset(0)]
public SDL_TextEditingCandidatesEvent edit_candidates;
[FieldOffset(0)]
public SDL_TextInputEvent text;

View File

@ -117,12 +117,12 @@ namespace SDL
{
public SDL_GamepadBindingType input_type;
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L229_C5")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L245_C5")]
public _input_e__Union input;
public SDL_GamepadBindingType output_type;
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L249_C5")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L265_C5")]
public _output_e__Union output;
[StructLayout(LayoutKind.Explicit)]
@ -132,11 +132,11 @@ namespace SDL
public int button;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L233_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L249_C9")]
public _axis_e__Struct axis;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L240_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L256_C9")]
public _hat_e__Struct hat;
public partial struct _axis_e__Struct
@ -163,7 +163,7 @@ namespace SDL
public SDL_GamepadButton button;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L253_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L269_C9")]
public _axis_e__Struct axis;
public partial struct _axis_e__Struct

View File

@ -197,11 +197,8 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")]
public static ReadOnlySpan<byte> SDL_HINT_HIDAPI_IGNORE_DEVICES => "SDL_HIDAPI_IGNORE_DEVICES"u8;
[NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")]
public static ReadOnlySpan<byte> SDL_HINT_IME_INTERNAL_EDITING => "SDL_IME_INTERNAL_EDITING"u8;
[NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")]
public static ReadOnlySpan<byte> SDL_HINT_IME_SHOW_UI => "SDL_IME_SHOW_UI"u8;
[NativeTypeName("#define SDL_HINT_IME_IMPLEMENTED_UI \"SDL_IME_IMPLEMENTED_UI\"")]
public static ReadOnlySpan<byte> SDL_HINT_IME_IMPLEMENTED_UI => "SDL_IME_IMPLEMENTED_UI"u8;
[NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")]
public static ReadOnlySpan<byte> SDL_HINT_IOS_HIDE_HOME_INDICATOR => "SDL_IOS_HIDE_HOME_INDICATOR"u8;
@ -380,6 +377,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES \"SDL_JOYSTICK_ZERO_CENTERED_DEVICES\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES => "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"u8;
[NativeTypeName("#define SDL_HINT_KEYCODE_OPTIONS \"SDL_KEYCODE_OPTIONS\"")]
public static ReadOnlySpan<byte> SDL_HINT_KEYCODE_OPTIONS => "SDL_KEYCODE_OPTIONS"u8;
[NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")]
public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_DEVICE_INDEX => "SDL_KMSDRM_DEVICE_INDEX"u8;
@ -431,6 +431,12 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => "SDL_MOUSE_RELATIVE_WARP_MOTION"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE \"SDL_MOUSE_RELATIVE_CURSOR_VISIBLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE => "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL \"SDL_MOUSE_RELATIVE_CLIP_INTERVAL\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL => "SDL_MOUSE_RELATIVE_CLIP_INTERVAL"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_TOUCH_EVENTS => "SDL_MOUSE_TOUCH_EVENTS"u8;
@ -632,6 +638,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_USE_D3D9EX => "SDL_WINDOWS_USE_D3D9EX"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE \"SDL_WINDOWS_ERASE_BACKGROUND_MODE\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE => "SDL_WINDOWS_ERASE_BACKGROUND_MODE"u8;
[NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINRT_HANDLE_BACK_BUTTON => "SDL_WINRT_HANDLE_BACK_BUTTON"u8;

View File

@ -38,13 +38,20 @@ namespace SDL
SDL_IO_STATUS_WRITEONLY,
}
public enum SDL_IOWhence
{
SDL_IO_SEEK_SET,
SDL_IO_SEEK_CUR,
SDL_IO_SEEK_END,
}
public unsafe partial struct SDL_IOStreamInterface
{
[NativeTypeName("Sint64 (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, long> size;
[NativeTypeName("Sint64 (*)(void *, Sint64, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, long, int, long> seek;
[NativeTypeName("Sint64 (*)(void *, Sint64, SDL_IOWhence)")]
public delegate* unmanaged[Cdecl]<IntPtr, long, SDL_IOWhence, long> seek;
[NativeTypeName("size_t (*)(void *, void *, size_t, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, nuint, SDL_IOStatus*, nuint> read;
@ -92,7 +99,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long SDL_SeekIO(SDL_IOStream* context, [NativeTypeName("Sint64")] long offset, int whence);
public static extern long SDL_SeekIO(SDL_IOStream* context, [NativeTypeName("Sint64")] long offset, SDL_IOWhence whence);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
@ -125,6 +132,9 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool 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);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU16LE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
@ -164,6 +174,9 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool 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);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU16LE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
@ -214,14 +227,5 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER \"SDL.iostream.dynamic.chunksize\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER => "SDL.iostream.dynamic.chunksize"u8;
[NativeTypeName("#define SDL_IO_SEEK_SET 0")]
public const int SDL_IO_SEEK_SET = 0;
[NativeTypeName("#define SDL_IO_SEEK_CUR 1")]
public const int SDL_IO_SEEK_CUR = 1;
[NativeTypeName("#define SDL_IO_SEEK_END 2")]
public const int SDL_IO_SEEK_END = 2;
}
}

View File

@ -27,18 +27,6 @@ using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_Keysym
{
public SDL_Scancode scancode;
public SDL_Keycode sym;
public SDL_Keymod mod;
[NativeTypeName("Uint16")]
public ushort unused;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -68,10 +56,19 @@ 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);
public static extern SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key);
public static extern SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod* modstate);
[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 int SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -88,19 +85,22 @@ namespace SDL
public static extern SDL_Keycode SDL_GetKeyFromName([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_StartTextInput();
public static extern int SDL_StartTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TextInputActive();
public static extern SDL_bool SDL_TextInputActive(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_StopTextInput();
public static extern int SDL_StopTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ClearComposition();
public static extern int SDL_ClearComposition(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextInputRect([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
public static extern int SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasScreenKeyboardSupport();

File diff suppressed because it is too large Load Diff

View File

@ -33,26 +33,26 @@ namespace SDL
public enum SDL_SystemCursor
{
SDL_SYSTEM_CURSOR_ARROW,
SDL_SYSTEM_CURSOR_IBEAM,
SDL_SYSTEM_CURSOR_DEFAULT,
SDL_SYSTEM_CURSOR_TEXT,
SDL_SYSTEM_CURSOR_WAIT,
SDL_SYSTEM_CURSOR_CROSSHAIR,
SDL_SYSTEM_CURSOR_WAITARROW,
SDL_SYSTEM_CURSOR_SIZENWSE,
SDL_SYSTEM_CURSOR_SIZENESW,
SDL_SYSTEM_CURSOR_SIZEWE,
SDL_SYSTEM_CURSOR_SIZENS,
SDL_SYSTEM_CURSOR_SIZEALL,
SDL_SYSTEM_CURSOR_NO,
SDL_SYSTEM_CURSOR_HAND,
SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT,
SDL_SYSTEM_CURSOR_WINDOW_TOP,
SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT,
SDL_SYSTEM_CURSOR_WINDOW_RIGHT,
SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT,
SDL_SYSTEM_CURSOR_WINDOW_BOTTOM,
SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT,
SDL_SYSTEM_CURSOR_WINDOW_LEFT,
SDL_SYSTEM_CURSOR_PROGRESS,
SDL_SYSTEM_CURSOR_NWSE_RESIZE,
SDL_SYSTEM_CURSOR_NESW_RESIZE,
SDL_SYSTEM_CURSOR_EW_RESIZE,
SDL_SYSTEM_CURSOR_NS_RESIZE,
SDL_SYSTEM_CURSOR_MOVE,
SDL_SYSTEM_CURSOR_NOT_ALLOWED,
SDL_SYSTEM_CURSOR_POINTER,
SDL_SYSTEM_CURSOR_NW_RESIZE,
SDL_SYSTEM_CURSOR_N_RESIZE,
SDL_SYSTEM_CURSOR_NE_RESIZE,
SDL_SYSTEM_CURSOR_E_RESIZE,
SDL_SYSTEM_CURSOR_SE_RESIZE,
SDL_SYSTEM_CURSOR_S_RESIZE,
SDL_SYSTEM_CURSOR_SW_RESIZE,
SDL_SYSTEM_CURSOR_W_RESIZE,
SDL_NUM_SYSTEM_CURSORS,
}
@ -78,16 +78,13 @@ namespace SDL
public static extern SDL_Window* SDL_GetMouseFocus();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetMouseState(float* x, float* y);
public static extern SDL_MouseButtonFlags SDL_GetMouseState(float* x, float* y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetGlobalMouseState(float* x, float* y);
public static extern SDL_MouseButtonFlags SDL_GetGlobalMouseState(float* x, float* y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetRelativeMouseState(float* x, float* y);
public static extern SDL_MouseButtonFlags SDL_GetRelativeMouseState(float* x, float* y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_WarpMouseInWindow(SDL_Window* window, float x, float y);

View File

@ -85,8 +85,7 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetPenName(SDL_PenID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo* capabilities);
public static extern SDL_PenCapabilityFlags SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo* capabilities);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenSubtype SDL_GetPenType(SDL_PenID instance_id);

View File

@ -101,7 +101,7 @@ namespace SDL
}
[NativeTypeName("int")]
public enum SDL_PixelFormatEnum : uint
public enum SDL_PixelFormat : uint
{
SDL_PIXELFORMAT_UNKNOWN,
SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)),
@ -113,13 +113,9 @@ namespace SDL
SDL_PIXELFORMAT_INDEX8 = ((1 << 28) | ((SDL_PIXELTYPE_INDEX8) << 24) | ((0) << 20) | ((0) << 16) | ((8) << 8) | ((1) << 0)),
SDL_PIXELFORMAT_RGB332 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED8) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_332) << 16) | ((8) << 8) | ((1) << 0)),
SDL_PIXELFORMAT_XRGB4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((12) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444,
SDL_PIXELFORMAT_XBGR4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((12) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444,
SDL_PIXELFORMAT_XRGB1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((15) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555,
SDL_PIXELFORMAT_XBGR1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((15) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555,
SDL_PIXELFORMAT_ARGB4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_RGBA4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)),
SDL_PIXELFORMAT_ABGR4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)),
@ -319,11 +315,9 @@ namespace SDL
public int refcount;
}
public unsafe partial struct SDL_PixelFormat
public partial struct SDL_PixelFormatDetails
{
public SDL_PixelFormatEnum format;
public SDL_Palette* palette;
public SDL_PixelFormat format;
[NativeTypeName("Uint8")]
public byte bits_per_pixel;
@ -347,16 +341,16 @@ namespace SDL
public uint Amask;
[NativeTypeName("Uint8")]
public byte Rloss;
public byte Rbits;
[NativeTypeName("Uint8")]
public byte Gloss;
public byte Gbits;
[NativeTypeName("Uint8")]
public byte Bloss;
public byte Bbits;
[NativeTypeName("Uint8")]
public byte Aloss;
public byte Abits;
[NativeTypeName("Uint8")]
public byte Rshift;
@ -370,11 +364,6 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte Ashift;
public int refcount;
[NativeTypeName("struct SDL_PixelFormat *")]
public SDL_PixelFormat* next;
[InlineArray(2)]
public partial struct _padding_e__FixedBuffer
{
@ -386,26 +375,21 @@ namespace SDL
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormatEnum format);
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
public static extern int SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask);
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);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormat* SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyPixelFormat(SDL_PixelFormat* format);
[return: NativeTypeName("const SDL_PixelFormatDetails *")]
public static extern SDL_PixelFormatDetails* SDL_GetPixelFormatDetails(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_CreatePalette(int ncolors);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors);
@ -414,17 +398,17 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
public static extern uint SDL_MapRGB([NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
public static extern uint SDL_MapRGBA([NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [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 void SDL_GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[NativeTypeName("#define SDL_ALPHA_OPAQUE 255")]
public const int SDL_ALPHA_OPAQUE = 255;

View File

@ -56,7 +56,7 @@ namespace SDL
public static extern void SDL_UnlockProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("void (*)(void *, void *)")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata);
public static extern int SDL_SetPropertyWithCleanup(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 int SDL_SetProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value);

View File

@ -28,17 +28,6 @@ using System.Runtime.InteropServices;
namespace SDL
{
public unsafe partial struct SDL_RendererInfo
{
[NativeTypeName("const char *")]
public byte* name;
public int num_texture_formats;
[NativeTypeName("const SDL_PixelFormatEnum *")]
public SDL_PixelFormatEnum* texture_formats;
}
public partial struct SDL_Vertex
{
public SDL_FPoint position;
@ -99,8 +88,9 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Window* SDL_GetRenderWindow(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetRendererName(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer* renderer);
@ -112,7 +102,7 @@ namespace SDL
public static extern int 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_PixelFormatEnum format, int access, int w, int h);
public static extern SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, SDL_PixelFormat format, int access, int w, int h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* SDL_CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface);
@ -127,7 +117,7 @@ namespace SDL
public static extern SDL_Renderer* SDL_GetRendererFromTexture(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_QueryTexture(SDL_Texture* texture, SDL_PixelFormatEnum* format, int* access, int* w, int* h);
public static extern int SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
@ -195,6 +185,9 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode, SDL_ScaleMode* scale_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y);
@ -289,10 +282,7 @@ namespace SDL
public static extern int SDL_RenderGeometry(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Vertex *")] SDL_Vertex* vertices, int num_vertices, [NativeTypeName("const int *")] int* indices, int num_indices);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_Color *")] SDL_Color* 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 int SDL_RenderGeometryRawFloat(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices);
public static extern int SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
@ -377,6 +367,9 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER \"SDL.renderer.max_texture_size\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER => "SDL.renderer.max_texture_size"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER \"SDL.renderer.texture_formats\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER => "SDL.renderer.texture_formats"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.output_colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.output_colorspace"u8;
@ -500,6 +493,18 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER \"SDL.texture.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_COLORSPACE_NUMBER => "SDL.texture.colorspace"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_FORMAT_NUMBER \"SDL.texture.format\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_FORMAT_NUMBER => "SDL.texture.format"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_ACCESS_NUMBER \"SDL.texture.access\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_ACCESS_NUMBER => "SDL.texture.access"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_WIDTH_NUMBER \"SDL.texture.width\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_WIDTH_NUMBER => "SDL.texture.width"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_HEIGHT_NUMBER \"SDL.texture.height\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_HEIGHT_NUMBER => "SDL.texture.height"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOAT \"SDL.texture.SDR_white_point\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOAT => "SDL.texture.SDR_white_point"u8;

View File

@ -241,39 +241,40 @@ namespace SDL
SDL_SCANCODE_RALT = 230,
SDL_SCANCODE_RGUI = 231,
SDL_SCANCODE_MODE = 257,
SDL_SCANCODE_AUDIONEXT = 258,
SDL_SCANCODE_AUDIOPREV = 259,
SDL_SCANCODE_AUDIOSTOP = 260,
SDL_SCANCODE_AUDIOPLAY = 261,
SDL_SCANCODE_AUDIOMUTE = 262,
SDL_SCANCODE_MEDIASELECT = 263,
SDL_SCANCODE_WWW = 264,
SDL_SCANCODE_MAIL = 265,
SDL_SCANCODE_CALCULATOR = 266,
SDL_SCANCODE_COMPUTER = 267,
SDL_SCANCODE_AC_SEARCH = 268,
SDL_SCANCODE_AC_HOME = 269,
SDL_SCANCODE_AC_BACK = 270,
SDL_SCANCODE_AC_FORWARD = 271,
SDL_SCANCODE_AC_STOP = 272,
SDL_SCANCODE_AC_REFRESH = 273,
SDL_SCANCODE_AC_BOOKMARKS = 274,
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
SDL_SCANCODE_BRIGHTNESSUP = 276,
SDL_SCANCODE_DISPLAYSWITCH = 277,
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
SDL_SCANCODE_KBDILLUMDOWN = 279,
SDL_SCANCODE_KBDILLUMUP = 280,
SDL_SCANCODE_EJECT = 281,
SDL_SCANCODE_SLEEP = 282,
SDL_SCANCODE_APP1 = 283,
SDL_SCANCODE_APP2 = 284,
SDL_SCANCODE_AUDIOREWIND = 285,
SDL_SCANCODE_AUDIOFASTFORWARD = 286,
SDL_SCANCODE_SLEEP = 258,
SDL_SCANCODE_WAKE = 259,
SDL_SCANCODE_CHANNEL_INCREMENT = 260,
SDL_SCANCODE_CHANNEL_DECREMENT = 261,
SDL_SCANCODE_MEDIA_PLAY = 262,
SDL_SCANCODE_MEDIA_PAUSE = 263,
SDL_SCANCODE_MEDIA_RECORD = 264,
SDL_SCANCODE_MEDIA_FAST_FORWARD = 265,
SDL_SCANCODE_MEDIA_REWIND = 266,
SDL_SCANCODE_MEDIA_NEXT_TRACK = 267,
SDL_SCANCODE_MEDIA_PREVIOUS_TRACK = 268,
SDL_SCANCODE_MEDIA_STOP = 269,
SDL_SCANCODE_MEDIA_EJECT = 270,
SDL_SCANCODE_MEDIA_PLAY_PAUSE = 271,
SDL_SCANCODE_MEDIA_SELECT = 272,
SDL_SCANCODE_AC_NEW = 273,
SDL_SCANCODE_AC_OPEN = 274,
SDL_SCANCODE_AC_CLOSE = 275,
SDL_SCANCODE_AC_EXIT = 276,
SDL_SCANCODE_AC_SAVE = 277,
SDL_SCANCODE_AC_PRINT = 278,
SDL_SCANCODE_AC_PROPERTIES = 279,
SDL_SCANCODE_AC_SEARCH = 280,
SDL_SCANCODE_AC_HOME = 281,
SDL_SCANCODE_AC_BACK = 282,
SDL_SCANCODE_AC_FORWARD = 283,
SDL_SCANCODE_AC_STOP = 284,
SDL_SCANCODE_AC_REFRESH = 285,
SDL_SCANCODE_AC_BOOKMARKS = 286,
SDL_SCANCODE_SOFTLEFT = 287,
SDL_SCANCODE_SOFTRIGHT = 288,
SDL_SCANCODE_CALL = 289,
SDL_SCANCODE_ENDCALL = 290,
SDL_SCANCODE_RESERVED = 400,
SDL_NUM_SCANCODES = 512,
}
}

View File

@ -81,18 +81,18 @@ namespace SDL
public static extern int SDL_setenv([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, int overwrite);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_qsort([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *)")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int> compare);
public static extern void SDL_qsort([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int> compare);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_bsearch([NativeTypeName("const void *")] IntPtr key, [NativeTypeName("const void *")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *)")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int> compare);
public static extern IntPtr SDL_bsearch([NativeTypeName("const void *")] IntPtr key, [NativeTypeName("const void *")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int> compare);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_qsort_r([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *)")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, IntPtr, int> compare, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_qsort_r([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback_r")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, IntPtr, int> compare, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_bsearch_r([NativeTypeName("const void *")] IntPtr key, [NativeTypeName("const void *")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *)")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, IntPtr, int> compare, [NativeTypeName("void*")] IntPtr userdata);
public static extern IntPtr SDL_bsearch_r([NativeTypeName("const void *")] IntPtr key, [NativeTypeName("const void *")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback_r")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, IntPtr, int> compare, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_abs(int x);
@ -343,6 +343,14 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_strncasecmp([NativeTypeName("const char *")] byte* str1, [NativeTypeName("const char *")] byte* str2, [NativeTypeName("size_t")] nuint maxlen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_StepUTF8([NativeTypeName("const char **")] byte** pstr, [NativeTypeName("size_t *")] nuint* pslen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UCS4ToUTF8", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_UCS4ToUTF8([NativeTypeName("Uint32")] uint codepoint, [NativeTypeName("char *")] byte* dst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_sscanf([NativeTypeName("const char *")] byte* text, [NativeTypeName("const char *")] byte* fmt, __arglist);
@ -367,6 +375,31 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_vasprintf([NativeTypeName("char **")] byte** strp, [NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_srand([NativeTypeName("Uint64")] ulong seed);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint32")]
public static extern int SDL_rand([NativeTypeName("Sint32")] int n);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_randf();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_rand_bits();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint32")]
public static extern int SDL_rand_r([NativeTypeName("Uint64 *")] ulong* state, [NativeTypeName("Sint32")] int n);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_randf_r([NativeTypeName("Uint64 *")] ulong* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_rand_bits_r([NativeTypeName("Uint64 *")] ulong* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern double SDL_acos(double x);
@ -439,6 +472,18 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_fmodf(float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_isinf(double x);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_isinff(float x);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_isnan(double x);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_isnanf(float x);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern double SDL_log(double x);
@ -628,6 +673,9 @@ namespace SDL
[NativeTypeName("#define SDL_PRIX32 \"X\"")]
public static ReadOnlySpan<byte> SDL_PRIX32 => "X"u8;
[NativeTypeName("#define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD")]
public const int SDL_INVALID_UNICODE_CODEPOINT = 0xFFFD;
[NativeTypeName("#define SDL_PI_D 3.141592653589793238462643383279502884")]
public const double SDL_PI_D = 3.141592653589793238462643383279502884;

View File

@ -28,10 +28,6 @@ using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_BlitMap
{
}
public enum SDL_ScaleMode
{
SDL_SCALEMODE_NEAREST,
@ -46,11 +42,15 @@ namespace SDL
SDL_FLIP_VERTICAL,
}
public partial struct SDL_SurfaceData
{
}
public unsafe partial struct SDL_Surface
{
public SDL_SurfaceFlags flags;
public SDL_PixelFormat* format;
public SDL_PixelFormat format;
public int w;
@ -61,28 +61,18 @@ namespace SDL
[NativeTypeName("void*")]
public IntPtr pixels;
[NativeTypeName("void*")]
public IntPtr reserved;
public int locked;
[NativeTypeName("void*")]
public IntPtr list_blitmap;
public SDL_Rect clip_rect;
public SDL_BlitMap* map;
public int refcount;
public SDL_SurfaceData* @internal;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format);
public static extern SDL_Surface* SDL_CreateSurface(int width, int height, SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_CreateSurfaceFrom([NativeTypeName("void*")] IntPtr pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
public static extern SDL_Surface* SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, [NativeTypeName("void*")] IntPtr pixels, int pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroySurface(SDL_Surface* surface);
@ -94,11 +84,14 @@ namespace SDL
public static extern int SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace* colorspace);
public static extern SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_GetSurfacePalette(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockSurface(SDL_Surface* surface);
@ -118,13 +111,13 @@ namespace SDL
public static extern int SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, int flag);
public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasRLE(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key);
public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasColorKey(SDL_Surface* surface);
@ -163,22 +156,19 @@ namespace SDL
public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format);
public static extern SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurfaceFormat(SDL_Surface* surface, SDL_PixelFormatEnum pixel_format);
public static extern SDL_Surface* SDL_ConvertSurfaceAndColorspace(SDL_Surface* surface, SDL_PixelFormat format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, SDL_Colorspace colorspace, SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface* surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props);
public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormatEnum dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color);
@ -201,23 +191,28 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapSurfaceRGB(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_MapSurfaceRGBA(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[NativeTypeName("#define SDL_PREALLOC 0x00000001u")]
public const uint SDL_PREALLOC = 0x00000001U;
[NativeTypeName("#define SDL_SURFACE_PREALLOCATED 0x00000001u")]
public const uint SDL_SURFACE_PREALLOCATED = 0x00000001U;
[NativeTypeName("#define SDL_RLEACCEL 0x00000002u")]
public const uint SDL_RLEACCEL = 0x00000002U;
[NativeTypeName("#define SDL_SURFACE_LOCK_NEEDED 0x00000002u")]
public const uint SDL_SURFACE_LOCK_NEEDED = 0x00000002U;
[NativeTypeName("#define SDL_DONTFREE 0x00000004u")]
public const uint SDL_DONTFREE = 0x00000004U;
[NativeTypeName("#define SDL_SURFACE_LOCKED 0x00000004u")]
public const uint SDL_SURFACE_LOCKED = 0x00000004U;
[NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008u")]
public const uint SDL_SIMD_ALIGNED = 0x00000008U;
[NativeTypeName("#define SDL_SURFACE_USES_PROPERTIES 0x00000010u")]
public const uint SDL_SURFACE_USES_PROPERTIES = 0x00000010U;
[NativeTypeName("#define SDL_SURFACE_SIMD_ALIGNED 0x00000008u")]
public const uint SDL_SURFACE_SIMD_ALIGNED = 0x00000008U;
[NativeTypeName("#define SDL_PROP_SURFACE_COLORSPACE_NUMBER \"SDL.surface.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_SURFACE_COLORSPACE_NUMBER => "SDL.surface.colorspace"u8;

View File

@ -33,7 +33,7 @@ namespace SDL
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("iOS")]
public static extern int SDL_iOSSetAnimationCallback(SDL_Window* window, int interval, [NativeTypeName("void (*)(void *)")] delegate* unmanaged[Cdecl]<IntPtr, void> callback, [NativeTypeName("void*")] IntPtr callbackParam);
public static extern int SDL_iOSSetAnimationCallback(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")]

View File

@ -25,7 +25,6 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace SDL
{
@ -44,12 +43,10 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[UnsupportedOSPlatform("windows")]
public static extern SDL_Thread* SDL_CreateThread([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl]<IntPtr, int> fn, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr data);
public static extern SDL_Thread* SDL_CreateThreadRuntime([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl]<IntPtr, int> fn, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr data, [NativeTypeName("SDL_FunctionPointer")] IntPtr pfnBeginThread, [NativeTypeName("SDL_FunctionPointer")] IntPtr pfnEndThread);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[UnsupportedOSPlatform("windows")]
public static extern SDL_Thread* SDL_CreateThreadWithStackSize([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl]<IntPtr, int> fn, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const size_t")] nuint stacksize, [NativeTypeName("void*")] IntPtr data);
public static extern SDL_Thread* SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, [NativeTypeName("SDL_FunctionPointer")] IntPtr pfnBeginThread, [NativeTypeName("SDL_FunctionPointer")] IntPtr pfnEndThread);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetThreadName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -78,9 +75,27 @@ namespace SDL
public static extern IntPtr SDL_GetTLS(SDL_TLSID id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTLS(SDL_TLSID id, [NativeTypeName("const void *")] IntPtr value, [NativeTypeName("void (*)(void *)")] delegate* unmanaged[Cdecl]<IntPtr, void> destructor);
public static extern int 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();
[NativeTypeName("#define SDL_BeginThreadFunction NULL")]
public const int SDL_BeginThreadFunction = 0;
[NativeTypeName("#define SDL_EndThreadFunction NULL")]
public const int SDL_EndThreadFunction = 0;
[NativeTypeName("#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER \"entry_function\"")]
public static ReadOnlySpan<byte> SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER => "entry_function"u8;
[NativeTypeName("#define SDL_PROP_THREAD_CREATE_NAME_STRING \"name\"")]
public static ReadOnlySpan<byte> SDL_PROP_THREAD_CREATE_NAME_STRING => "name"u8;
[NativeTypeName("#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER \"userdata\"")]
public static ReadOnlySpan<byte> SDL_PROP_THREAD_CREATE_USERDATA_POINTER => "userdata"u8;
[NativeTypeName("#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER \"stacksize\"")]
public static ReadOnlySpan<byte> SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER => "stacksize"u8;
}
}

View File

@ -53,10 +53,13 @@ namespace SDL
public static extern void SDL_DelayNS([NativeTypeName("Uint64")] ulong ns);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_TimerID SDL_AddTimer([NativeTypeName("Uint32")] uint interval, [NativeTypeName("SDL_TimerCallback")] delegate* unmanaged[Cdecl]<uint, IntPtr, uint> callback, [NativeTypeName("void*")] IntPtr param2);
public static extern SDL_TimerID SDL_AddTimer([NativeTypeName("Uint32")] uint interval, [NativeTypeName("SDL_TimerCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_TimerID, uint, uint> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RemoveTimer(SDL_TimerID id);
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 int SDL_RemoveTimer(SDL_TimerID id);
[NativeTypeName("#define SDL_MS_PER_SECOND 1000")]
public const int SDL_MS_PER_SECOND = 1000;

View File

@ -39,7 +39,7 @@ namespace SDL
{
public SDL_DisplayID displayID;
public SDL_PixelFormatEnum format;
public SDL_PixelFormat format;
public int w;
@ -73,6 +73,10 @@ namespace SDL
SDL_FLASH_UNTIL_FOCUSED,
}
public partial struct SDL_GLContextState
{
}
public enum SDL_GLattr
{
SDL_GL_RED_SIZE,
@ -236,6 +240,9 @@ namespace SDL
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetWindowPixelFormat(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Window** SDL_GetWindows(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Window* SDL_CreateWindow([NativeTypeName("const char *")] byte* title, int w, int h, SDL_WindowFlags flags);
@ -282,6 +289,12 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetWindowSize(SDL_Window* window, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowAspectRatio(SDL_Window* window, float min_aspect, float max_aspect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetWindowAspectRatio(SDL_Window* window, float* min_aspect, float* max_aspect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right);
@ -339,6 +352,12 @@ namespace SDL
[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 int SDL_SetWindowSurfaceVSync(SDL_Window* window, int vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetWindowSurfaceVSync(SDL_Window* window, int* vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UpdateWindowSurface(SDL_Window* window);
@ -379,9 +398,6 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowInputFocus(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetWindowFocusable(SDL_Window* window, SDL_bool focusable);
@ -437,17 +453,17 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_GLContext")]
public static extern IntPtr SDL_GL_CreateContext(SDL_Window* window);
public static extern SDL_GLContextState* SDL_GL_CreateContext(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] IntPtr context);
public static extern int 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();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_GLContext")]
public static extern IntPtr SDL_GL_GetCurrentContext();
public static extern SDL_GLContextState* SDL_GL_GetCurrentContext();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_EGLDisplay")]
@ -474,7 +490,7 @@ namespace SDL
public static extern int SDL_GL_SwapWindow(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GL_DeleteContext([NativeTypeName("SDL_GLContext")] IntPtr context);
public static extern int 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;
@ -566,12 +582,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN \"SDL.display.HDR_enabled\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN => "SDL.display.HDR_enabled"u8;
[NativeTypeName("#define SDL_PROP_DISPLAY_SDR_WHITE_POINT_FLOAT \"SDL.display.SDR_white_point\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_SDR_WHITE_POINT_FLOAT => "SDL.display.SDR_white_point"u8;
[NativeTypeName("#define SDL_PROP_DISPLAY_HDR_HEADROOM_FLOAT \"SDL.display.HDR_headroom\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_HDR_HEADROOM_FLOAT => "SDL.display.HDR_headroom"u8;
[NativeTypeName("#define SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER \"SDL.display.KMSDRM.panel_orientation\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER => "SDL.display.KMSDRM.panel_orientation"u8;
@ -677,6 +687,15 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_SHAPE_POINTER \"SDL.window.shape\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_SHAPE_POINTER => "SDL.window.shape"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN \"SDL.window.HDR_enabled\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_HDR_ENABLED_BOOLEAN => "SDL.window.HDR_enabled"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_SDR_WHITE_LEVEL_FLOAT \"SDL.window.SDR_white_level\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_SDR_WHITE_LEVEL_FLOAT => "SDL.window.SDR_white_level"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_HDR_HEADROOM_FLOAT \"SDL.window.HDR_headroom\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_HDR_HEADROOM_FLOAT => "SDL.window.HDR_headroom"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER \"SDL.window.android.window\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER => "SDL.window.android.window"u8;
@ -689,6 +708,15 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER \"SDL.window.uikit.metal_view_tag\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER => "SDL.window.uikit.metal_view_tag"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER \"SDL.window.uikit.opengl.framebuffer\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER => "SDL.window.uikit.opengl.framebuffer"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER \"SDL.window.uikit.opengl.renderbuffer\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER => "SDL.window.uikit.opengl.renderbuffer"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER \"SDL.window.uikit.opengl.resolve_framebuffer\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_UIKIT_OPENGL_RESOLVE_FRAMEBUFFER_NUMBER => "SDL.window.uikit.opengl.resolve_framebuffer"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER \"SDL.window.kmsdrm.dev_index\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER => "SDL.window.kmsdrm.dev_index"u8;
@ -757,5 +785,11 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_X11_WINDOW_NUMBER \"SDL.window.x11.window\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_X11_WINDOW_NUMBER => "SDL.window.x11.window"u8;
[NativeTypeName("#define SDL_WINDOW_SURFACE_VSYNC_DISABLED 0")]
public const int SDL_WINDOW_SURFACE_VSYNC_DISABLED = 0;
[NativeTypeName("#define SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE (-1)")]
public const int SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE = (-1);
}
}

View File

@ -57,7 +57,7 @@ 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);
public static extern int SDL_Vulkan_CreateSurface(SDL_Window* window, [NativeTypeName("VkInstance")] VkInstance_T* instance, [NativeTypeName("const struct VkAllocationCallbacks *")] VkAllocationCallbacks* allocator, [NativeTypeName("VkSurfaceKHR *")] VkSurfaceKHR_T** surface);
[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);

View File

@ -61,18 +61,18 @@ namespace SDL
public static int SDL_AUDIO_FRAMESIZE(SDL_AudioSpec x) => SDL_AUDIO_BYTESIZE((x).format) * (x).channels;
[MustDisposeResource]
public static unsafe SDLArray<SDL_AudioDeviceID>? SDL_GetAudioOutputDevices()
public static unsafe SDLArray<SDL_AudioDeviceID>? SDL_GetAudioPlaybackDevices()
{
int count;
var array = SDL_GetAudioOutputDevices(&count);
var array = SDL_GetAudioPlaybackDevices(&count);
return SDLArray.Create(array, count);
}
[MustDisposeResource]
public static unsafe SDLArray<SDL_AudioDeviceID>? SDL_GetAudioCaptureDevices()
public static unsafe SDLArray<SDL_AudioDeviceID>? SDL_GetAudioRecordingDevices()
{
int count;
var array = SDL_GetAudioCaptureDevices(&count);
var array = SDL_GetAudioRecordingDevices(&count);
return SDLArray.Create(array, count);
}
}

View File

@ -8,6 +8,7 @@ namespace SDL
[Typedef]
public enum SDL_Keycode : UInt32
{
SDLK_SCANCODE_MASK = SDL3.SDLK_SCANCODE_MASK,
SDLK_UNKNOWN = SDL3.SDLK_UNKNOWN,
SDLK_RETURN = SDL3.SDLK_RETURN,
SDLK_ESCAPE = SDL3.SDLK_ESCAPE,
@ -17,8 +18,8 @@ namespace SDL
SDLK_EXCLAIM = SDL3.SDLK_EXCLAIM,
SDLK_DBLAPOSTROPHE = SDL3.SDLK_DBLAPOSTROPHE,
SDLK_HASH = SDL3.SDLK_HASH,
SDLK_PERCENT = SDL3.SDLK_PERCENT,
SDLK_DOLLAR = SDL3.SDLK_DOLLAR,
SDLK_PERCENT = SDL3.SDLK_PERCENT,
SDLK_AMPERSAND = SDL3.SDLK_AMPERSAND,
SDLK_APOSTROPHE = SDL3.SDLK_APOSTROPHE,
SDLK_LEFTPAREN = SDL3.SDLK_LEFTPAREN,
@ -52,32 +53,38 @@ namespace SDL
SDLK_CARET = SDL3.SDLK_CARET,
SDLK_UNDERSCORE = SDL3.SDLK_UNDERSCORE,
SDLK_GRAVE = SDL3.SDLK_GRAVE,
SDLK_a = SDL3.SDLK_a,
SDLK_b = SDL3.SDLK_b,
SDLK_c = SDL3.SDLK_c,
SDLK_d = SDL3.SDLK_d,
SDLK_e = SDL3.SDLK_e,
SDLK_f = SDL3.SDLK_f,
SDLK_g = SDL3.SDLK_g,
SDLK_h = SDL3.SDLK_h,
SDLK_i = SDL3.SDLK_i,
SDLK_j = SDL3.SDLK_j,
SDLK_k = SDL3.SDLK_k,
SDLK_l = SDL3.SDLK_l,
SDLK_m = SDL3.SDLK_m,
SDLK_n = SDL3.SDLK_n,
SDLK_o = SDL3.SDLK_o,
SDLK_p = SDL3.SDLK_p,
SDLK_q = SDL3.SDLK_q,
SDLK_r = SDL3.SDLK_r,
SDLK_s = SDL3.SDLK_s,
SDLK_t = SDL3.SDLK_t,
SDLK_u = SDL3.SDLK_u,
SDLK_v = SDL3.SDLK_v,
SDLK_w = SDL3.SDLK_w,
SDLK_x = SDL3.SDLK_x,
SDLK_y = SDL3.SDLK_y,
SDLK_z = SDL3.SDLK_z,
SDLK_A = SDL3.SDLK_A,
SDLK_B = SDL3.SDLK_B,
SDLK_C = SDL3.SDLK_C,
SDLK_D = SDL3.SDLK_D,
SDLK_E = SDL3.SDLK_E,
SDLK_F = SDL3.SDLK_F,
SDLK_G = SDL3.SDLK_G,
SDLK_H = SDL3.SDLK_H,
SDLK_I = SDL3.SDLK_I,
SDLK_J = SDL3.SDLK_J,
SDLK_K = SDL3.SDLK_K,
SDLK_L = SDL3.SDLK_L,
SDLK_M = SDL3.SDLK_M,
SDLK_N = SDL3.SDLK_N,
SDLK_O = SDL3.SDLK_O,
SDLK_P = SDL3.SDLK_P,
SDLK_Q = SDL3.SDLK_Q,
SDLK_R = SDL3.SDLK_R,
SDLK_S = SDL3.SDLK_S,
SDLK_T = SDL3.SDLK_T,
SDLK_U = SDL3.SDLK_U,
SDLK_V = SDL3.SDLK_V,
SDLK_W = SDL3.SDLK_W,
SDLK_X = SDL3.SDLK_X,
SDLK_Y = SDL3.SDLK_Y,
SDLK_Z = SDL3.SDLK_Z,
SDLK_LEFTBRACE = SDL3.SDLK_LEFTBRACE,
SDLK_PIPE = SDL3.SDLK_PIPE,
SDLK_RIGHTBRACE = SDL3.SDLK_RIGHTBRACE,
SDLK_TILDE = SDL3.SDLK_TILDE,
SDLK_DELETE = SDL3.SDLK_DELETE,
SDLK_PLUSMINUS = SDL3.SDLK_PLUSMINUS,
SDLK_CAPSLOCK = SDL3.SDLK_CAPSLOCK,
SDLK_F1 = SDL3.SDLK_F1,
SDLK_F2 = SDL3.SDLK_F2,
@ -97,7 +104,6 @@ namespace SDL
SDLK_INSERT = SDL3.SDLK_INSERT,
SDLK_HOME = SDL3.SDLK_HOME,
SDLK_PAGEUP = SDL3.SDLK_PAGEUP,
SDLK_DELETE = SDL3.SDLK_DELETE,
SDLK_END = SDL3.SDLK_END,
SDLK_PAGEDOWN = SDL3.SDLK_PAGEDOWN,
SDLK_RIGHT = SDL3.SDLK_RIGHT,
@ -219,16 +225,28 @@ namespace SDL
SDLK_RALT = SDL3.SDLK_RALT,
SDLK_RGUI = SDL3.SDLK_RGUI,
SDLK_MODE = SDL3.SDLK_MODE,
SDLK_AUDIONEXT = SDL3.SDLK_AUDIONEXT,
SDLK_AUDIOPREV = SDL3.SDLK_AUDIOPREV,
SDLK_AUDIOSTOP = SDL3.SDLK_AUDIOSTOP,
SDLK_AUDIOPLAY = SDL3.SDLK_AUDIOPLAY,
SDLK_AUDIOMUTE = SDL3.SDLK_AUDIOMUTE,
SDLK_MEDIASELECT = SDL3.SDLK_MEDIASELECT,
SDLK_WWW = SDL3.SDLK_WWW,
SDLK_MAIL = SDL3.SDLK_MAIL,
SDLK_CALCULATOR = SDL3.SDLK_CALCULATOR,
SDLK_COMPUTER = SDL3.SDLK_COMPUTER,
SDLK_SLEEP = SDL3.SDLK_SLEEP,
SDLK_WAKE = SDL3.SDLK_WAKE,
SDLK_CHANNEL_INCREMENT = SDL3.SDLK_CHANNEL_INCREMENT,
SDLK_CHANNEL_DECREMENT = SDL3.SDLK_CHANNEL_DECREMENT,
SDLK_MEDIA_PLAY = SDL3.SDLK_MEDIA_PLAY,
SDLK_MEDIA_PAUSE = SDL3.SDLK_MEDIA_PAUSE,
SDLK_MEDIA_RECORD = SDL3.SDLK_MEDIA_RECORD,
SDLK_MEDIA_FAST_FORWARD = SDL3.SDLK_MEDIA_FAST_FORWARD,
SDLK_MEDIA_REWIND = SDL3.SDLK_MEDIA_REWIND,
SDLK_MEDIA_NEXT_TRACK = SDL3.SDLK_MEDIA_NEXT_TRACK,
SDLK_MEDIA_PREVIOUS_TRACK = SDL3.SDLK_MEDIA_PREVIOUS_TRACK,
SDLK_MEDIA_STOP = SDL3.SDLK_MEDIA_STOP,
SDLK_MEDIA_EJECT = SDL3.SDLK_MEDIA_EJECT,
SDLK_MEDIA_PLAY_PAUSE = SDL3.SDLK_MEDIA_PLAY_PAUSE,
SDLK_MEDIA_SELECT = SDL3.SDLK_MEDIA_SELECT,
SDLK_AC_NEW = SDL3.SDLK_AC_NEW,
SDLK_AC_OPEN = SDL3.SDLK_AC_OPEN,
SDLK_AC_CLOSE = SDL3.SDLK_AC_CLOSE,
SDLK_AC_EXIT = SDL3.SDLK_AC_EXIT,
SDLK_AC_SAVE = SDL3.SDLK_AC_SAVE,
SDLK_AC_PRINT = SDL3.SDLK_AC_PRINT,
SDLK_AC_PROPERTIES = SDL3.SDLK_AC_PROPERTIES,
SDLK_AC_SEARCH = SDL3.SDLK_AC_SEARCH,
SDLK_AC_HOME = SDL3.SDLK_AC_HOME,
SDLK_AC_BACK = SDL3.SDLK_AC_BACK,
@ -236,18 +254,6 @@ namespace SDL
SDLK_AC_STOP = SDL3.SDLK_AC_STOP,
SDLK_AC_REFRESH = SDL3.SDLK_AC_REFRESH,
SDLK_AC_BOOKMARKS = SDL3.SDLK_AC_BOOKMARKS,
SDLK_BRIGHTNESSDOWN = SDL3.SDLK_BRIGHTNESSDOWN,
SDLK_BRIGHTNESSUP = SDL3.SDLK_BRIGHTNESSUP,
SDLK_DISPLAYSWITCH = SDL3.SDLK_DISPLAYSWITCH,
SDLK_KBDILLUMTOGGLE = SDL3.SDLK_KBDILLUMTOGGLE,
SDLK_KBDILLUMDOWN = SDL3.SDLK_KBDILLUMDOWN,
SDLK_KBDILLUMUP = SDL3.SDLK_KBDILLUMUP,
SDLK_EJECT = SDL3.SDLK_EJECT,
SDLK_SLEEP = SDL3.SDLK_SLEEP,
SDLK_APP1 = SDL3.SDLK_APP1,
SDLK_APP2 = SDL3.SDLK_APP2,
SDLK_AUDIOREWIND = SDL3.SDLK_AUDIOREWIND,
SDLK_AUDIOFASTFORWARD = SDL3.SDLK_AUDIOFASTFORWARD,
SDLK_SOFTLEFT = SDL3.SDLK_SOFTLEFT,
SDLK_SOFTRIGHT = SDL3.SDLK_SOFTRIGHT,
SDLK_CALL = SDL3.SDLK_CALL,

View File

@ -19,7 +19,8 @@ namespace SDL
}
[Flags]
public enum SDLButtonMask : uint
[Typedef]
public enum SDL_MouseButtonFlags : uint
{
SDL_BUTTON_LMASK = SDL3.SDL_BUTTON_LMASK,
SDL_BUTTON_MMASK = SDL3.SDL_BUTTON_MMASK,
@ -31,7 +32,7 @@ namespace SDL
public static partial class SDL3
{
[Macro]
public static SDLButtonMask SDL_BUTTON(SDLButton button) => (SDLButtonMask)(1 << ((int)button - 1));
public static SDL_MouseButtonFlags SDL_BUTTON(SDLButton button) => (SDL_MouseButtonFlags)(1 << ((int)button - 1));
[MustDisposeResource]
public static unsafe SDLArray<SDL_MouseID>? SDL_GetMice()

View File

@ -10,7 +10,8 @@ namespace SDL
public enum SDL_PenID : UInt32;
[Flags]
public enum SDL_PEN_CAPABILITIES : uint
[Typedef]
public enum SDL_PenCapabilityFlags : uint
{
SDL_PEN_DOWN_MASK = SDL3.SDL_PEN_DOWN_MASK,
SDL_PEN_INK_MASK = SDL3.SDL_PEN_INK_MASK,
@ -30,10 +31,10 @@ namespace SDL
public const SDL_MouseID SDL_PEN_MOUSEID = unchecked((SDL_MouseID)(-2));
[Macro]
public static SDL_PEN_CAPABILITIES SDL_PEN_CAPABILITY(int capbit) => (SDL_PEN_CAPABILITIES)(1ul << (capbit));
public static SDL_PenCapabilityFlags SDL_PEN_CAPABILITY(int capbit) => (SDL_PenCapabilityFlags)(1ul << (capbit));
[Macro]
public static SDL_PEN_CAPABILITIES SDL_PEN_AXIS_CAPABILITY(SDL_PenAxis axis) => SDL_PEN_CAPABILITY((int)axis + SDL_PEN_FLAG_AXIS_BIT_OFFSET);
public static SDL_PenCapabilityFlags SDL_PEN_AXIS_CAPABILITY(SDL_PenAxis axis) => SDL_PEN_CAPABILITY((int)axis + SDL_PEN_FLAG_AXIS_BIT_OFFSET);
[MustDisposeResource]
public static unsafe SDLArray<SDL_PenID>? SDL_GetPens()

View File

@ -5,7 +5,7 @@ using System;
namespace SDL
{
using static SDL_PixelFormatEnum;
using static SDL_PixelFormat;
using static SDL_PixelType;
using static SDL_PackedOrder;
using static SDL_PackedLayout;
@ -15,30 +15,30 @@ namespace SDL
public static partial class SDL3
{
[Macro]
public static SDL_PixelFormatEnum SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D) => (SDL_PixelFormatEnum)SDL_FOURCC(A, B, C, D);
public static SDL_PixelFormat SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D) => (SDL_PixelFormat)SDL_FOURCC(A, B, C, D);
[Macro]
public static SDL_PixelFormatEnum SDL_DEFINE_PIXELFORMAT(int type, int order, int layout, int bits, int bytes)
=> (SDL_PixelFormatEnum)((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) |
((bits) << 8) | ((bytes) << 0));
public static SDL_PixelFormat SDL_DEFINE_PIXELFORMAT(int type, int order, int layout, int bits, int bytes)
=> (SDL_PixelFormat)((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) |
((bits) << 8) | ((bytes) << 0));
[Macro]
public static int SDL_PIXELFLAG(SDL_PixelFormatEnum X) => ((int)X >> 28) & 0x0F;
public static int SDL_PIXELFLAG(SDL_PixelFormat X) => ((int)X >> 28) & 0x0F;
[Macro]
public static SDL_PixelType SDL_PIXELTYPE(SDL_PixelFormatEnum X) => (SDL_PixelType)(((int)X >> 24) & 0x0F);
public static SDL_PixelType SDL_PIXELTYPE(SDL_PixelFormat X) => (SDL_PixelType)(((int)X >> 24) & 0x0F);
[Macro]
public static SDL_PackedOrder SDL_PIXELORDER(SDL_PixelFormatEnum X) => (SDL_PackedOrder)(((int)X >> 20) & 0x0F);
public static SDL_PackedOrder SDL_PIXELORDER(SDL_PixelFormat X) => (SDL_PackedOrder)(((int)X >> 20) & 0x0F);
[Macro]
public static SDL_PackedLayout SDL_PIXELLAYOUT(SDL_PixelFormatEnum X) => (SDL_PackedLayout)(((int)X >> 16) & 0x0F);
public static SDL_PackedLayout SDL_PIXELLAYOUT(SDL_PixelFormat X) => (SDL_PackedLayout)(((int)X >> 16) & 0x0F);
[Macro]
public static int SDL_BITSPERPIXEL(SDL_PixelFormatEnum X) => ((int)X >> 8) & 0xFF;
public static int SDL_BITSPERPIXEL(SDL_PixelFormat X) => ((int)X >> 8) & 0xFF;
[Macro]
public static int SDL_BYTESPERPIXEL(SDL_PixelFormatEnum X) =>
public static int SDL_BYTESPERPIXEL(SDL_PixelFormat X) =>
(SDL_ISPIXELFORMAT_FOURCC(X)
? ((((X) == SDL_PIXELFORMAT_YUY2) ||
((X) == SDL_PIXELFORMAT_UYVY) ||
@ -49,7 +49,7 @@ namespace SDL
: ((((int)X) >> 0) & 0xFF));
[Macro]
public static bool SDL_ISPIXELFORMAT_INDEXED(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_INDEXED(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) ||
@ -57,14 +57,14 @@ namespace SDL
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)));
[Macro]
public static bool SDL_ISPIXELFORMAT_PACKED(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_PACKED(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_ARRAY(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_ARRAY(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) ||
@ -73,7 +73,7 @@ namespace SDL
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_ALPHA(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_ALPHA(SDL_PixelFormat format) =>
((SDL_ISPIXELFORMAT_PACKED(format) &&
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) ||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) ||
@ -81,19 +81,19 @@ namespace SDL
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))));
[Macro]
public static bool SDL_ISPIXELFORMAT_10BIT(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_10BIT(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) &&
(SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)));
[Macro]
public static bool SDL_ISPIXELFORMAT_FLOAT(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_FLOAT(SDL_PixelFormat format) =>
(!SDL_ISPIXELFORMAT_FOURCC(format) &&
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) ||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)));
[Macro]
public static bool SDL_ISPIXELFORMAT_FOURCC(SDL_PixelFormatEnum format) =>
public static bool SDL_ISPIXELFORMAT_FOURCC(SDL_PixelFormat format) =>
((format != 0) && (SDL_PIXELFLAG(format) != 1));
[Macro]

View File

@ -4,4 +4,4 @@
# Fix errors with uint -> int conversion
--with-type
SDL_Colorspace=uint
SDL_PixelFormatEnum=uint
SDL_PixelFormat=uint

View File

@ -9,16 +9,15 @@ namespace SDL
[Typedef]
public enum SDL_SurfaceFlags : UInt32
{
SDL_PREALLOC = SDL3.SDL_PREALLOC,
SDL_RLEACCEL = SDL3.SDL_RLEACCEL,
SDL_DONTFREE = SDL3.SDL_DONTFREE,
SDL_SIMD_ALIGNED = SDL3.SDL_SIMD_ALIGNED,
SDL_SURFACE_USES_PROPERTIES = SDL3.SDL_SURFACE_USES_PROPERTIES,
SDL_SURFACE_PREALLOCATED = SDL3.SDL_SURFACE_PREALLOCATED,
SDL_SURFACE_LOCK_NEEDED = SDL3.SDL_SURFACE_LOCK_NEEDED,
SDL_SURFACE_LOCKED = SDL3.SDL_SURFACE_LOCKED,
SDL_SURFACE_SIMD_ALIGNED = SDL3.SDL_SURFACE_SIMD_ALIGNED
}
public static partial class SDL3
{
[Macro]
public static unsafe bool SDL_MUSTLOCK(SDL_Surface* S) => (((S)->flags & SDL_SurfaceFlags.SDL_RLEACCEL) != 0);
public static unsafe bool SDL_MUSTLOCK(SDL_Surface* S) => (S->flags & (SDL_SurfaceFlags.SDL_SURFACE_LOCK_NEEDED | SDL_SurfaceFlags.SDL_SURFACE_LOCKED)) == SDL_SurfaceFlags.SDL_SURFACE_LOCK_NEEDED;
}
}

View File

@ -70,5 +70,13 @@ namespace SDL
var array = SDL_GetFullscreenDisplayModes(displayID, &count);
return SDLArray.Create(array, count);
}
[MustDisposeResource]
public static unsafe SDLPointerArray<SDL_Window>? SDL_GetWindows()
{
int count;
var array = SDL_GetWindows(&count);
return SDLArray.Create(array, count);
}
}
}