diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs index 46b36af..b61aac4 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.Windows.g.cs @@ -28,10 +28,6 @@ using System.Runtime.Versioning; namespace SDL { - public partial struct tagMSG - { - } - public partial struct XTaskQueueObject { } @@ -44,7 +40,7 @@ namespace SDL { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] - public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); + public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [SupportedOSPlatform("Windows")] diff --git a/SDL3-CS/SDL3/SDL_system.Windows.cs b/SDL3-CS/SDL3/SDL_system.Windows.cs new file mode 100644 index 0000000..9f43b51 --- /dev/null +++ b/SDL3-CS/SDL3/SDL_system.Windows.cs @@ -0,0 +1,34 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; + +namespace SDL +{ + // https://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices#common-windows-data-types + using LONG = int; + using DWORD = uint; + using UINT = uint; + using HWND = IntPtr; + using WPARAM = UIntPtr; + using LPARAM = IntPtr; + + // https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point + public struct POINT + { + public LONG x; + public LONG y; + } + + // https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg + public struct MSG + { + public HWND hwnd; + public UINT message; + public WPARAM wParam; + public LPARAM lParam; + public DWORD time; + public POINT pt; + public DWORD lPrivate; + } +} diff --git a/SDL3-CS/SDL3/SDL_system.Windows.rsp b/SDL3-CS/SDL3/SDL_system.Windows.rsp new file mode 100644 index 0000000..1e5a359 --- /dev/null +++ b/SDL3-CS/SDL3/SDL_system.Windows.rsp @@ -0,0 +1,10 @@ +# Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +# See the LICENCE file in the repository root for full licence text. + +# Exclude struct forward declaration +--exclude +tagMSG + +# ClangSharp recommended remapping +--remap +tagMSG=MSG