diff --git a/External/SDL b/External/SDL index a40b2de..7dd5e76 160000 --- a/External/SDL +++ b/External/SDL @@ -1 +1 @@ -Subproject commit a40b2de9466c41426a5a24662c5a17374ea36f0d +Subproject commit 7dd5e765df239986f78c9b0016e3f3023d885084 diff --git a/SDL3-CS.Tests/MyWindow.cs b/SDL3-CS.Tests/MyWindow.cs index 233f5ca..20be27c 100644 --- a/SDL3-CS.Tests/MyWindow.cs +++ b/SDL3-CS.Tests/MyWindow.cs @@ -158,6 +158,10 @@ namespace SDL.Tests SDL_Keymod mod = e.key.mod; Console.WriteLine(mod); break; + + case SDL_Keycode.SDLK_E: + Console.WriteLine(SDL_GetEventDescription(e)); + break; } break; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs index 8fa1701..b48db07 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs @@ -180,6 +180,14 @@ namespace SDL [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)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_PutAudioStreamDataNoCopy(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len, [NativeTypeName("SDL_AudioStreamDataCompleteCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_PutAudioStreamPlanarData(SDL_AudioStream* stream, [NativeTypeName("const void *const *")] IntPtr* channel_buffers, int num_channels, int num_samples); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_GetAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("void*")] IntPtr buf, int len); @@ -231,6 +239,10 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetAudioIterationCallbacks(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl] start, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl] end, [NativeTypeName("void*")] IntPtr userdata); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs index c35da6e..851880e 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_events.g.cs @@ -408,6 +408,12 @@ namespace SDL public float mouse_x; public float mouse_y; + + [NativeTypeName("Sint32")] + public int integer_x; + + [NativeTypeName("Sint32")] + public int integer_y; } public partial struct SDL_JoyAxisEvent @@ -1173,5 +1179,8 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Window* SDL_GetWindowFromEvent([NativeTypeName("const SDL_Event *")] SDL_Event* @event); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int SDL_GetEventDescription([NativeTypeName("const SDL_Event *")] SDL_Event* @event, [NativeTypeName("char *")] byte* buf, int buflen); } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs index d9395c1..43adc73 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_gamepad.g.cs @@ -45,6 +45,7 @@ namespace SDL SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, + SDL_GAMEPAD_TYPE_GAMECUBE, SDL_GAMEPAD_TYPE_COUNT, } @@ -117,12 +118,12 @@ namespace SDL { public SDL_GamepadBindingType input_type; - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L265_C5")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L267_C5")] public _input_e__Union input; public SDL_GamepadBindingType output_type; - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L285_C5")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L287_C5")] public _output_e__Union output; [StructLayout(LayoutKind.Explicit)] @@ -132,11 +133,11 @@ namespace SDL public int button; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L269_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L271_C9")] public _axis_e__Struct axis; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L276_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L278_C9")] public _hat_e__Struct hat; public partial struct _axis_e__Struct @@ -163,7 +164,7 @@ namespace SDL public SDL_GamepadButton button; [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_gamepad_L289_C9")] + [NativeTypeName("__AnonymousRecord_SDL_gamepad_L291_C9")] public _axis_e__Struct axis; public partial struct _axis_e__Struct diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs index 3c6ff62..9aca735 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_gpu.g.cs @@ -813,8 +813,8 @@ namespace SDL [NativeTypeName("bool")] public SDLBool enable_mask; - [NativeTypeName("Uint8")] - public byte padding1; + [NativeTypeName("bool")] + public SDLBool enable_alpha_to_coverage; [NativeTypeName("Uint8")] public byte padding2; @@ -1129,6 +1129,9 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_GPUShaderFormat SDL_GetGPUShaderFormats(SDL_GPUDevice* device); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID SDL_GetGPUDeviceProperties(SDL_GPUDevice* device); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_GPUComputePipeline* SDL_CreateGPUComputePipeline(SDL_GPUDevice* device, [NativeTypeName("const SDL_GPUComputePipelineCreateInfo *")] SDL_GPUComputePipelineCreateInfo* createinfo); @@ -1474,6 +1477,9 @@ namespace SDL [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN \"SDL.gpu.device.create.preferlowpower\"")] public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN => "SDL.gpu.device.create.preferlowpower"u8; + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VERBOSE_BOOLEAN \"SDL.gpu.device.create.verbose\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_VERBOSE_BOOLEAN => "SDL.gpu.device.create.verbose"u8; + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING \"SDL.gpu.device.create.name\"")] public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => "SDL.gpu.device.create.name"u8; @@ -1498,6 +1504,30 @@ namespace SDL [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING \"SDL.gpu.device.create.d3d12.semantic\"")] public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => "SDL.gpu.device.create.d3d12.semantic"u8; + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SHADERCLIPDISTANCE_BOOLEAN \"SDL.gpu.device.create.vulkan.shaderclipdistance\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SHADERCLIPDISTANCE_BOOLEAN => "SDL.gpu.device.create.vulkan.shaderclipdistance"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DEPTHCLAMP_BOOLEAN \"SDL.gpu.device.create.vulkan.depthclamp\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DEPTHCLAMP_BOOLEAN => "SDL.gpu.device.create.vulkan.depthclamp"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DRAWINDIRECTFIRST_BOOLEAN \"SDL.gpu.device.create.vulkan.drawindirectfirstinstance\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DRAWINDIRECTFIRST_BOOLEAN => "SDL.gpu.device.create.vulkan.drawindirectfirstinstance"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SAMPLERANISOTROPY_BOOLEAN \"SDL.gpu.device.create.vulkan.sampleranisotropy\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SAMPLERANISOTROPY_BOOLEAN => "SDL.gpu.device.create.vulkan.sampleranisotropy"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_NAME_STRING \"SDL.gpu.device.name\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_NAME_STRING => "SDL.gpu.device.name"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING \"SDL.gpu.device.driver_name\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING => "SDL.gpu.device.driver_name"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING \"SDL.gpu.device.driver_version\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING => "SDL.gpu.device.driver_version"u8; + + [NativeTypeName("#define SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING \"SDL.gpu.device.driver_info\"")] + public static ReadOnlySpan SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING => "SDL.gpu.device.driver_info"u8; + [NativeTypeName("#define SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING \"SDL.gpu.computepipeline.create.name\"")] public static ReadOnlySpan SDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING => "SDL.gpu.computepipeline.create.name"u8; @@ -1525,8 +1555,8 @@ namespace SDL [NativeTypeName("#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT \"SDL.gpu.texture.create.d3d12.clear.depth\"")] public static ReadOnlySpan SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT => "SDL.gpu.texture.create.d3d12.clear.depth"u8; - [NativeTypeName("#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_UINT8 \"SDL.gpu.texture.create.d3d12.clear.stencil\"")] - public static ReadOnlySpan SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_UINT8 => "SDL.gpu.texture.create.d3d12.clear.stencil"u8; + [NativeTypeName("#define SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER \"SDL.gpu.texture.create.d3d12.clear.stencil\"")] + public static ReadOnlySpan SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER => "SDL.gpu.texture.create.d3d12.clear.stencil"u8; [NativeTypeName("#define SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING \"SDL.gpu.texture.create.name\"")] public static ReadOnlySpan SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING => "SDL.gpu.texture.create.name"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs index 0d99b1f..82baa28 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_haptic.g.cs @@ -34,8 +34,7 @@ namespace SDL public partial struct SDL_HapticDirection { - [NativeTypeName("Uint8")] - public byte type; + public SDL_HapticDirectionType type; [NativeTypeName("Sint32[3]")] public _dir_e__FixedBuffer dir; @@ -49,8 +48,7 @@ namespace SDL public partial struct SDL_HapticConstant { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; public SDL_HapticDirection direction; @@ -84,8 +82,7 @@ namespace SDL public partial struct SDL_HapticPeriodic { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; public SDL_HapticDirection direction; @@ -128,8 +125,7 @@ namespace SDL public partial struct SDL_HapticCondition { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; public SDL_HapticDirection direction; @@ -202,8 +198,7 @@ namespace SDL public partial struct SDL_HapticRamp { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; public SDL_HapticDirection direction; @@ -240,8 +235,7 @@ namespace SDL public partial struct SDL_HapticLeftRight { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; [NativeTypeName("Uint32")] public uint length; @@ -255,8 +249,7 @@ namespace SDL public unsafe partial struct SDL_HapticCustom { - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; public SDL_HapticDirection direction; @@ -301,8 +294,7 @@ namespace SDL public partial struct SDL_HapticEffect { [FieldOffset(0)] - [NativeTypeName("Uint16")] - public ushort type; + public SDL_HapticEffectType type; [FieldOffset(0)] public SDL_HapticConstant constant; @@ -380,26 +372,26 @@ namespace SDL 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); + public static extern SDL_HapticEffectID SDL_CreateHapticEffect(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data); + public static extern SDLBool SDL_UpdateHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations); + public static extern SDLBool SDL_RunHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, [NativeTypeName("Uint32")] uint iterations); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool SDL_StopHapticEffect(SDL_Haptic* haptic, int effect); + public static extern SDLBool SDL_StopHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_DestroyHapticEffect(SDL_Haptic* haptic, int effect); + public static extern void SDL_DestroyHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect); + public static extern SDLBool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, SDL_HapticEffectID effect); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] @@ -437,6 +429,9 @@ namespace SDL [return: NativeTypeName("bool")] public static extern SDLBool SDL_StopHapticRumble(SDL_Haptic* haptic); + [NativeTypeName("#define SDL_HAPTIC_INFINITY 4294967295U")] + public const uint SDL_HAPTIC_INFINITY = 4294967295U; + [NativeTypeName("#define SDL_HAPTIC_CONSTANT (1u<<0)")] public const uint SDL_HAPTIC_CONSTANT = (1U << 0); @@ -508,8 +503,5 @@ namespace SDL [NativeTypeName("#define SDL_HAPTIC_STEERING_AXIS 3")] public const int SDL_HAPTIC_STEERING_AXIS = 3; - - [NativeTypeName("#define SDL_HAPTIC_INFINITY 4294967295U")] - public const uint SDL_HAPTIC_INFINITY = 4294967295U; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs index 8cc24ea..8029c6e 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs @@ -346,6 +346,15 @@ namespace SDL [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI \"SDL_JOYSTICK_HIDAPI_STEAM_HORI\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI => "SDL_JOYSTICK_HIDAPI_STEAM_HORI"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LG4FF \"SDL_JOYSTICK_HIDAPI_LG4FF\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LG4FF => "SDL_JOYSTICK_HIDAPI_LG4FF"u8; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO \"SDL_JOYSTICK_HIDAPI_8BITDO\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_8BITDO => "SDL_JOYSTICK_HIDAPI_8BITDO"u8; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI \"SDL_JOYSTICK_HIDAPI_FLYDIGI\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => "SDL_JOYSTICK_HIDAPI_FLYDIGI"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => "SDL_JOYSTICK_HIDAPI_SWITCH"u8; @@ -382,6 +391,12 @@ namespace SDL [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED \"SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED => "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GIP \"SDL_JOYSTICK_HIDAPI_GIP\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GIP => "SDL_JOYSTICK_HIDAPI_GIP"u8; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA \"SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA => "SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_IOKIT \"SDL_JOYSTICK_IOKIT\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_IOKIT => "SDL_JOYSTICK_IOKIT"u8; @@ -430,6 +445,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES \"SDL_JOYSTICK_ZERO_CENTERED_DEVICES\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES => "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HAPTIC_AXES \"SDL_JOYSTICK_HAPTIC_AXES\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HAPTIC_AXES => "SDL_JOYSTICK_HAPTIC_AXES"u8; + [NativeTypeName("#define SDL_HINT_KEYCODE_OPTIONS \"SDL_KEYCODE_OPTIONS\"")] public static ReadOnlySpan SDL_HINT_KEYCODE_OPTIONS => "SDL_KEYCODE_OPTIONS"u8; @@ -625,6 +643,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY \"SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY\"")] public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY => "SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY"u8; + [NativeTypeName("#define SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE \"SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE => "SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE"u8; + [NativeTypeName("#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS \"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS\"")] public static ReadOnlySpan SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS => "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"u8; @@ -652,6 +673,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => "SDL_VIDEO_WIN_D3DCOMPILER"u8; + [NativeTypeName("#define SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT \"SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT => "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"u8; + [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR \"SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR\"")] public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR => "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs index d7d7c1a..f8da440 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_mouse.g.cs @@ -23,6 +23,7 @@ 3. This notice may not be removed or altered from any source distribution. */ +using System; using System.Runtime.InteropServices; namespace SDL @@ -94,6 +95,10 @@ namespace SDL [return: NativeTypeName("bool")] public static extern SDLBool SDL_WarpMouseGlobal(float x, float y); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetRelativeMouseTransform([NativeTypeName("SDL_MouseMotionTransformCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool SDL_SetWindowRelativeMouseMode(SDL_Window* window, [NativeTypeName("bool")] SDLBool enabled); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs index d408245..8ba1124 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_pixels.g.cs @@ -387,10 +387,10 @@ namespace SDL 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_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixelvalue, [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_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); + public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixelvalue, [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; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs index 1d3e3df..e7499c5 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_process.g.cs @@ -78,6 +78,9 @@ namespace SDL [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER \"SDL.process.create.environment\"")] public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER => "SDL.process.create.environment"u8; + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING \"SDL.process.create.working_directory\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING => "SDL.process.create.working_directory"u8; + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_NUMBER \"SDL.process.create.stdin_option\"")] public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_STDIN_NUMBER => "SDL.process.create.stdin_option"u8; @@ -102,6 +105,9 @@ namespace SDL [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN \"SDL.process.create.background\"")] public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN => "SDL.process.create.background"u8; + [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_CMDLINE_STRING \"SDL.process.create.cmdline\"")] + public static ReadOnlySpan SDL_PROP_PROCESS_CREATE_CMDLINE_STRING => "SDL.process.create.cmdline"u8; + [NativeTypeName("#define SDL_PROP_PROCESS_PID_NUMBER \"SDL.process.pid\"")] public static ReadOnlySpan SDL_PROP_PROCESS_PID_NUMBER => "SDL.process.pid"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs index 94175d7..139b8e9 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_render.g.cs @@ -44,6 +44,14 @@ namespace SDL SDL_TEXTUREACCESS_TARGET, } + public enum SDL_TextureAddressMode + { + SDL_TEXTURE_ADDRESS_INVALID = -1, + SDL_TEXTURE_ADDRESS_AUTO, + SDL_TEXTURE_ADDRESS_CLAMP, + SDL_TEXTURE_ADDRESS_WRAP, + } + public enum SDL_RendererLogicalPresentation { SDL_LOGICAL_PRESENTATION_DISABLED, @@ -68,6 +76,36 @@ namespace SDL public int refcount; } + public unsafe partial struct SDL_GPURenderStateDesc + { + [NativeTypeName("Uint32")] + public uint version; + + public SDL_GPUShader* fragment_shader; + + [NativeTypeName("Sint32")] + public int num_sampler_bindings; + + [NativeTypeName("const SDL_GPUTextureSamplerBinding *")] + public SDL_GPUTextureSamplerBinding* sampler_bindings; + + [NativeTypeName("Sint32")] + public int num_storage_textures; + + [NativeTypeName("SDL_GPUTexture *const *")] + public SDL_GPUTexture** storage_textures; + + [NativeTypeName("Sint32")] + public int num_storage_buffers; + + [NativeTypeName("SDL_GPUBuffer *const *")] + public SDL_GPUBuffer** storage_buffers; + } + + public partial struct SDL_GPURenderState + { + } + public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] @@ -87,6 +125,9 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Renderer* SDL_CreateRendererWithProperties(SDL_PropertiesID props); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_Renderer* SDL_CreateGPURenderer(SDL_Window* window, SDL_GPUShaderFormat format_flags, SDL_GPUDevice** device); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface* surface); @@ -356,6 +397,10 @@ namespace SDL [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)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_RenderTexture9GridTiled(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, float tileScale); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [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); @@ -364,6 +409,14 @@ namespace SDL [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)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetRenderTextureAddressMode(SDL_Renderer* renderer, SDL_TextureAddressMode u_mode, SDL_TextureAddressMode v_mode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_GetRenderTextureAddressMode(SDL_Renderer* renderer, SDL_TextureAddressMode* u_mode, SDL_TextureAddressMode* v_mode); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Surface* SDL_RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); @@ -409,6 +462,28 @@ namespace SDL [return: NativeTypeName("bool")] public static extern SDLBool SDL_RenderDebugTextFormat(SDL_Renderer* renderer, float x, float y, [NativeTypeName("const char *")] byte* fmt, __arglist); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode scale_mode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_GetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode* scale_mode); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_GPURenderState* SDL_CreateGPURenderState(SDL_Renderer* renderer, SDL_GPURenderStateDesc* desc); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetGPURenderStateFragmentUniforms(SDL_GPURenderState* state, [NativeTypeName("Uint32")] uint slot_index, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint length); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetRenderGPUState(SDL_Renderer* renderer, SDL_GPURenderState* state); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void SDL_DestroyGPURenderState(SDL_GPURenderState* state); + [NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")] public static ReadOnlySpan SDL_SOFTWARE_RENDERER => "software"u8; @@ -427,6 +502,15 @@ namespace SDL [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"SDL.renderer.create.present_vsync\"")] public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "SDL.renderer.create.present_vsync"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN \"SDL.renderer.create.gpu.shaders_spirv\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN => "SDL.renderer.create.gpu.shaders_spirv"u8; + + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN \"SDL.renderer.create.gpu.shaders_dxil\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN => "SDL.renderer.create.gpu.shaders_dxil"u8; + + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN \"SDL.renderer.create.gpu.shaders_msl\"")] + public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN => "SDL.renderer.create.gpu.shaders_msl"u8; + [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER \"SDL.renderer.create.vulkan.instance\"")] public static ReadOnlySpan SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => "SDL.renderer.create.vulkan.instance"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs index ba78f25..23173f3 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_surface.g.cs @@ -30,8 +30,10 @@ namespace SDL { public enum SDL_ScaleMode { + SDL_SCALEMODE_INVALID = -1, SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR, + SDL_SCALEMODE_PIXELART, } public enum SDL_FlipMode diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_version.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_version.g.cs index 5a92dba..de15f16 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_version.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_version.g.cs @@ -39,10 +39,10 @@ namespace SDL [NativeTypeName("#define SDL_MAJOR_VERSION 3")] public const int SDL_MAJOR_VERSION = 3; - [NativeTypeName("#define SDL_MINOR_VERSION 2")] - public const int SDL_MINOR_VERSION = 2; + [NativeTypeName("#define SDL_MINOR_VERSION 3")] + public const int SDL_MINOR_VERSION = 3; - [NativeTypeName("#define SDL_MICRO_VERSION 5")] - public const int SDL_MICRO_VERSION = 5; + [NativeTypeName("#define SDL_MICRO_VERSION 0")] + public const int SDL_MICRO_VERSION = 0; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs index fbd4722..5a6d865 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs @@ -80,6 +80,16 @@ namespace SDL SDL_FLASH_UNTIL_FOCUSED, } + public enum SDL_ProgressState + { + SDL_PROGRESS_STATE_INVALID = -1, + SDL_PROGRESS_STATE_NONE, + SDL_PROGRESS_STATE_INDETERMINATE, + SDL_PROGRESS_STATE_NORMAL, + SDL_PROGRESS_STATE_PAUSED, + SDL_PROGRESS_STATE_ERROR, + } + public partial struct SDL_GLContextState { } @@ -445,6 +455,20 @@ namespace SDL [return: NativeTypeName("bool")] public static extern SDLBool SDL_FlashWindow(SDL_Window* window, SDL_FlashOperation operation); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetWindowProgressState(SDL_Window* window, SDL_ProgressState state); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_ProgressState SDL_GetWindowProgressState(SDL_Window* window); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_SetWindowProgressValue(SDL_Window* window, float value); + + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float SDL_GetWindowProgressValue(SDL_Window* window); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_DestroyWindow(SDL_Window* window); @@ -665,12 +689,18 @@ namespace SDL [NativeTypeName("#define SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER \"SDL.display.KMSDRM.panel_orientation\"")] public static ReadOnlySpan SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER => "SDL.display.KMSDRM.panel_orientation"u8; + [NativeTypeName("#define SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER \"SDL.display.wayland.wl_output\"")] + public static ReadOnlySpan SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER => "SDL.display.wayland.wl_output"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN \"SDL.window.create.always_on_top\"")] public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => "SDL.window.create.always_on_top"u8; [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN \"SDL.window.create.borderless\"")] public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN => "SDL.window.create.borderless"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN \"SDL.window.create.constrain_popup\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN => "SDL.window.create.constrain_popup"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN \"SDL.window.create.focusable\"")] public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN => "SDL.window.create.focusable"u8; @@ -767,6 +797,12 @@ namespace SDL [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER \"SDL.window.create.x11.window\"")] public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER => "SDL.window.create.x11.window"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.create.emscripten.canvas_id\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.create.emscripten.canvas_id"u8; + + [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.create.emscripten.keyboard_element\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.create.emscripten.keyboard_element"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_SHAPE_POINTER \"SDL.window.shape\"")] public static ReadOnlySpan SDL_PROP_WINDOW_SHAPE_POINTER => "SDL.window.shape"u8; @@ -815,8 +851,8 @@ namespace SDL [NativeTypeName("#define SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER \"SDL.window.cocoa.metal_view_tag\"")] public static ReadOnlySpan SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER => "SDL.window.cocoa.metal_view_tag"u8; - [NativeTypeName("#define SDL_PROP_WINDOW_OPENVR_OVERLAY_ID \"SDL.window.openvr.overlay_id\"")] - public static ReadOnlySpan SDL_PROP_WINDOW_OPENVR_OVERLAY_ID => "SDL.window.openvr.overlay_id"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_OPENVR_OVERLAY_ID_NUMBER \"SDL.window.openvr.overlay_id\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_OPENVR_OVERLAY_ID_NUMBER => "SDL.window.openvr.overlay_id"u8; [NativeTypeName("#define SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER \"SDL.window.vivante.display\"")] public static ReadOnlySpan SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER => "SDL.window.vivante.display"u8; @@ -872,6 +908,12 @@ namespace SDL [NativeTypeName("#define SDL_PROP_WINDOW_X11_WINDOW_NUMBER \"SDL.window.x11.window\"")] public static ReadOnlySpan SDL_PROP_WINDOW_X11_WINDOW_NUMBER => "SDL.window.x11.window"u8; + [NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.emscripten.canvas_id\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.emscripten.canvas_id"u8; + + [NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.emscripten.keyboard_element\"")] + public static ReadOnlySpan SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.emscripten.keyboard_element"u8; + [NativeTypeName("#define SDL_WINDOW_SURFACE_VSYNC_DISABLED 0")] public const int SDL_WINDOW_SURFACE_VSYNC_DISABLED = 0; diff --git a/SDL3-CS/SDL3/SDL_events.cs b/SDL3-CS/SDL3/SDL_events.cs index dc7b1ba..5054d70 100644 --- a/SDL3-CS/SDL3/SDL_events.cs +++ b/SDL3-CS/SDL3/SDL_events.cs @@ -1,6 +1,9 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Text; + namespace SDL { public partial struct SDL_CommonEvent @@ -63,5 +66,23 @@ namespace SDL 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, bool enabled) => SDL_SetEventEnabled((uint)type, enabled); public static SDLBool SDL_EventEnabled(SDL_EventType type) => SDL_EventEnabled((uint)type); + + public static string SDL_GetEventDescription(SDL_Event @event) + { + // Buffer size taken from https://github.com/libsdl-org/SDL/blob/7dd5e765df239986f78c9b0016e3f3023d885084/src/events/SDL_events.c#L908-L913. + const int bufferSize = 256; + Span buf = stackalloc byte[bufferSize]; + + int bytesWritten; + + unsafe + { + fixed (byte* ptr = buf) + bytesWritten = SDL_GetEventDescription(&@event, ptr, bufferSize); + } + + int bytesToRead = bytesWritten > bufferSize ? bufferSize : bytesWritten; + return Encoding.UTF8.GetString(buf[..bytesToRead]); + } } } diff --git a/SDL3-CS/SDL3/SDL_haptic.cs b/SDL3-CS/SDL3/SDL_haptic.cs index 9b52131..62a3b10 100644 --- a/SDL3-CS/SDL3/SDL_haptic.cs +++ b/SDL3-CS/SDL3/SDL_haptic.cs @@ -9,6 +9,39 @@ namespace SDL [Typedef] public enum SDL_HapticID : UInt32; + [Typedef] + public enum SDL_HapticEffectType : UInt16 + { + SDL_HAPTIC_CONSTANT = (UInt16)SDL3.SDL_HAPTIC_CONSTANT, + SDL_HAPTIC_SINE = (UInt16)SDL3.SDL_HAPTIC_SINE, + SDL_HAPTIC_SQUARE = (UInt16)SDL3.SDL_HAPTIC_SQUARE, + SDL_HAPTIC_TRIANGLE = (UInt16)SDL3.SDL_HAPTIC_TRIANGLE, + SDL_HAPTIC_SAWTOOTHUP = (UInt16)SDL3.SDL_HAPTIC_SAWTOOTHUP, + SDL_HAPTIC_SAWTOOTHDOWN = (UInt16)SDL3.SDL_HAPTIC_SAWTOOTHDOWN, + SDL_HAPTIC_RAMP = (UInt16)SDL3.SDL_HAPTIC_RAMP, + SDL_HAPTIC_SPRING = (UInt16)SDL3.SDL_HAPTIC_SPRING, + SDL_HAPTIC_DAMPER = (UInt16)SDL3.SDL_HAPTIC_DAMPER, + SDL_HAPTIC_INERTIA = (UInt16)SDL3.SDL_HAPTIC_INERTIA, + SDL_HAPTIC_FRICTION = (UInt16)SDL3.SDL_HAPTIC_FRICTION, + SDL_HAPTIC_LEFTRIGHT = (UInt16)SDL3.SDL_HAPTIC_LEFTRIGHT, + SDL_HAPTIC_RESERVED1 = (UInt16)SDL3.SDL_HAPTIC_RESERVED1, + SDL_HAPTIC_RESERVED2 = (UInt16)SDL3.SDL_HAPTIC_RESERVED2, + SDL_HAPTIC_RESERVED3 = (UInt16)SDL3.SDL_HAPTIC_RESERVED3, + SDL_HAPTIC_CUSTOM = (UInt16)SDL3.SDL_HAPTIC_CUSTOM, + } + + [Typedef] + public enum SDL_HapticDirectionType : byte + { + SDL_HAPTIC_POLAR = SDL3.SDL_HAPTIC_POLAR, + SDL_HAPTIC_CARTESIAN = SDL3.SDL_HAPTIC_CARTESIAN, + SDL_HAPTIC_SPHERICAL = SDL3.SDL_HAPTIC_SPHERICAL, + SDL_HAPTIC_STEERING_AXIS = SDL3.SDL_HAPTIC_STEERING_AXIS, + } + + [Typedef] + public enum SDL_HapticEffectID : int; + public static partial class SDL3 { [MustDisposeResource]