From 064c11d53e95318bcf4348beb917c1c0edae2927 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Jun 2024 12:25:18 +0200 Subject: [PATCH 01/62] Remove property for getting command line arguments. --- .vscode/launch.json | 2 +- samples/AverageFrameRate/App.cs | 4 ++-- samples/BitmapViewer/App.cs | 6 +++--- samples/ParticleSystem/App.cs | 4 ++-- samples/PlasmaFractal/App.cs | 4 ++-- samples/RayTracer/App.cs | 4 ++-- samples/SwirlStars/App.cs | 4 ++-- samples/TunnelEffect/App.cs | 4 ++-- samples/WavePlayer/App.cs | 6 +++--- sources/SDL2Sharp/Application.cs | 9 --------- 10 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5d580050..5d148b5b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -89,7 +89,7 @@ "type": "coreclr", "request": "launch", "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/Debug/net6.0/WavePlayer", - "args": [], + "args": ["Roland-GR-1-Trumpet-C5.wav"], "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/Debug/net6.0", "stopAtEntry": false, "console": "internalConsole" diff --git a/samples/AverageFrameRate/App.cs b/samples/AverageFrameRate/App.cs index d45ee49b..97e26ae7 100644 --- a/samples/AverageFrameRate/App.cs +++ b/samples/AverageFrameRate/App.cs @@ -119,10 +119,10 @@ private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) _rendererInvalidated = true; } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/BitmapViewer/App.cs b/samples/BitmapViewer/App.cs index 6b263790..3959cd62 100644 --- a/samples/BitmapViewer/App.cs +++ b/samples/BitmapViewer/App.cs @@ -43,7 +43,7 @@ protected override void OnInitialized() { _window = new Window("Bitmap Viewer", 640, 480, WindowFlags.Resizable); _renderer = _window.CreateRenderer(RendererFlags.Accelerated); - _bitmapTexture = _renderer.CreateTextureFromBitmap(CommandLineArgs[0]); + _bitmapTexture = _renderer.CreateTextureFromBitmap(Environment.GetCommandLineArgs()[1]); _window.SizeChanged += OnSizeChanged; } catch (Exception e) @@ -78,10 +78,10 @@ private void Render() _renderer.Present(); } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/ParticleSystem/App.cs b/samples/ParticleSystem/App.cs index ed97e4d6..b5e2f354 100644 --- a/samples/ParticleSystem/App.cs +++ b/samples/ParticleSystem/App.cs @@ -160,10 +160,10 @@ private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) _rendererInvalidated = true; } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs index 673bcb50..6796efe5 100644 --- a/samples/PlasmaFractal/App.cs +++ b/samples/PlasmaFractal/App.cs @@ -336,10 +336,10 @@ private static void Square(PackedMemoryImage map, int centerX, int centerY map[centerY, centerX] = (byte)value; } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/RayTracer/App.cs b/samples/RayTracer/App.cs index 3c7f1464..10b3da77 100644 --- a/samples/RayTracer/App.cs +++ b/samples/RayTracer/App.cs @@ -300,10 +300,10 @@ private void OnMouseWheel(object? sender, MouseWheelEventArgs e) _camera.FieldOfView -= e.Y; } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/SwirlStars/App.cs b/samples/SwirlStars/App.cs index c144dbf0..4c19b361 100644 --- a/samples/SwirlStars/App.cs +++ b/samples/SwirlStars/App.cs @@ -199,10 +199,10 @@ private void OnWindowMouseMotion(object? sender, MouseMotionEventArgs e) _cursorLastActive = DateTime.UtcNow; } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/TunnelEffect/App.cs b/samples/TunnelEffect/App.cs index f8f3ae4f..42df2976 100644 --- a/samples/TunnelEffect/App.cs +++ b/samples/TunnelEffect/App.cs @@ -229,10 +229,10 @@ private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) _renderer.Present(); } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index c9afc3f7..820c2fc1 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -68,7 +68,7 @@ protected override void OnInitialized() _renderingThread = new Thread(Render); _rendererInvalidated = true; _rendering = true; - _waveFile = new WaveFile(CommandLineArgs[0]); + _waveFile = new WaveFile(Environment.GetCommandLineArgs()[1]); _audioDevice = new AudioDevice(_waveFile.Spec, OnAudioDeviceCallback, null!, AudioDeviceAllowedChanges.None); _renderingThread.Start(); _audioDevice.Unpause(); @@ -200,10 +200,10 @@ private void Render() } } - private static int Main(string[] args) + private static int Main() { var app = new App(); - var exitCode = app.Run(args); + var exitCode = app.Run(); return exitCode; } } diff --git a/sources/SDL2Sharp/Application.cs b/sources/SDL2Sharp/Application.cs index b09bbbb6..f46306da 100644 --- a/sources/SDL2Sharp/Application.cs +++ b/sources/SDL2Sharp/Application.cs @@ -46,8 +46,6 @@ private set } } - protected string[] CommandLineArgs { get; private set; } - protected Subsystems Subsystems { get; set; } protected int ExitCode { get; set; } @@ -55,19 +53,12 @@ private set protected Application() { Instance = this; - CommandLineArgs = Array.Empty(); Subsystems = Subsystems.All; ExitCode = 0; } public int Run() { - return Run(Environment.GetCommandLineArgs()); - } - - public int Run(string[] commandLineArgs) - { - CommandLineArgs = commandLineArgs; var @event = new SDL_Event(); var eventFilterCallback = new EventFilterCallbackDelegate(OnEventFilterCallback); From 6c0b4930d8551a74c42d016df31b2b8ec6470596 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Jun 2024 12:30:39 +0200 Subject: [PATCH 02/62] Remove property for initializing subsystems. --- samples/AverageFrameRate/App.cs | 5 ----- samples/BitmapViewer/App.cs | 5 ----- samples/ParticleSystem/App.cs | 5 ----- samples/PlasmaFractal/App.cs | 5 ----- samples/RayTracer/App.cs | 5 ----- samples/SwirlStars/App.cs | 5 ----- samples/TunnelEffect/App.cs | 5 ----- samples/WavePlayer/App.cs | 5 ----- sources/SDL2Sharp/Application.cs | 5 +---- 9 files changed, 1 insertion(+), 44 deletions(-) diff --git a/samples/AverageFrameRate/App.cs b/samples/AverageFrameRate/App.cs index 97e26ae7..9172f176 100644 --- a/samples/AverageFrameRate/App.cs +++ b/samples/AverageFrameRate/App.cs @@ -38,11 +38,6 @@ internal sealed class App : Application private volatile bool _rendering = false; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Average Frame Rate", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); diff --git a/samples/BitmapViewer/App.cs b/samples/BitmapViewer/App.cs index 3959cd62..1b12b202 100644 --- a/samples/BitmapViewer/App.cs +++ b/samples/BitmapViewer/App.cs @@ -32,11 +32,6 @@ internal sealed class App : Application private Texture _bitmapTexture = null!; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { try diff --git a/samples/ParticleSystem/App.cs b/samples/ParticleSystem/App.cs index b5e2f354..6a5b95d7 100644 --- a/samples/ParticleSystem/App.cs +++ b/samples/ParticleSystem/App.cs @@ -45,11 +45,6 @@ internal sealed class App : Application private volatile int _mouseY; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Particle System", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs index 6796efe5..c400dd64 100644 --- a/samples/PlasmaFractal/App.cs +++ b/samples/PlasmaFractal/App.cs @@ -60,11 +60,6 @@ internal sealed class App : Application private DateTime _cursorLastActive = DateTime.UtcNow; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Plasma Fractal", 512, 512, WindowFlags.Shown | WindowFlags.Resizable); diff --git a/samples/RayTracer/App.cs b/samples/RayTracer/App.cs index 10b3da77..dd2a0214 100644 --- a/samples/RayTracer/App.cs +++ b/samples/RayTracer/App.cs @@ -53,11 +53,6 @@ internal sealed class App : Application private Camera _camera = null!; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Ray Tracer", 640, 480, WindowFlags.Resizable); diff --git a/samples/SwirlStars/App.cs b/samples/SwirlStars/App.cs index 4c19b361..446ebc98 100644 --- a/samples/SwirlStars/App.cs +++ b/samples/SwirlStars/App.cs @@ -55,11 +55,6 @@ internal sealed class App : Application private List _stars = null!; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Swirl Stars", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); diff --git a/samples/TunnelEffect/App.cs b/samples/TunnelEffect/App.cs index 42df2976..600afdbc 100644 --- a/samples/TunnelEffect/App.cs +++ b/samples/TunnelEffect/App.cs @@ -68,11 +68,6 @@ public Transform(int angle, int distance) private double _frameRate; - protected override void OnInitializing() - { - Subsystems = Subsystems.Video; - } - protected override void OnInitialized() { _window = new Window("Tunnel Effect", 640, 480, WindowFlags.Resizable); diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index 820c2fc1..fa641b0e 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -52,11 +52,6 @@ internal sealed class App : Application private int _wavePosition = 0; - protected override void OnInitializing() - { - Subsystems = Subsystems.Audio | Subsystems.Video; - } - protected override void OnInitialized() { Environment.SetEnvironmentVariable("SDL_AUDIODRIVER", "directsound"); diff --git a/sources/SDL2Sharp/Application.cs b/sources/SDL2Sharp/Application.cs index f46306da..6e3a42b0 100644 --- a/sources/SDL2Sharp/Application.cs +++ b/sources/SDL2Sharp/Application.cs @@ -46,14 +46,11 @@ private set } } - protected Subsystems Subsystems { get; set; } - protected int ExitCode { get; set; } protected Application() { Instance = this; - Subsystems = Subsystems.All; ExitCode = 0; } @@ -65,7 +62,7 @@ public int Run() try { OnInitializing(); - Error.ThrowOnFailure(SDL.Init((uint)Subsystems)); + Error.ThrowOnFailure(SDL.Init((uint)Subsystems.All)); Error.ThrowOnFailure(TTF.Init()); var eventFilterCallbackPointer = Marshal.GetFunctionPointerForDelegate(eventFilterCallback); SDL.SetEventFilter(eventFilterCallbackPointer, null); From 4e06cbacd621c74bcc71f038d800e3ad2deeb465 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Jun 2024 12:32:00 +0200 Subject: [PATCH 03/62] Remove wrapper AudoDeviceSpec. --- samples/WavePlayer/App.cs | 17 ++-- sources/SDL2Sharp/AudioDevice.cs | 115 +++++++++++++-------------- sources/SDL2Sharp/AudioDeviceSpec.cs | 59 -------------- sources/SDL2Sharp/WaveFile.cs | 12 ++- 4 files changed, 77 insertions(+), 126 deletions(-) delete mode 100644 sources/SDL2Sharp/AudioDeviceSpec.cs diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index fa641b0e..6382cd46 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -64,7 +64,14 @@ protected override void OnInitialized() _rendererInvalidated = true; _rendering = true; _waveFile = new WaveFile(Environment.GetCommandLineArgs()[1]); - _audioDevice = new AudioDevice(_waveFile.Spec, OnAudioDeviceCallback, null!, AudioDeviceAllowedChanges.None); + _audioDevice = new AudioDevice( + _waveFile.Frequency, + _waveFile.Format, + _waveFile.Channels, + _waveFile.Samples, + OnAudioDeviceCallback, + null!, + AudioDeviceAllowedChanges.None); _renderingThread.Start(); _audioDevice.Unpause(); } @@ -88,14 +95,14 @@ protected override void OnQuiting() private void OnAudioDeviceCallback(object userdata, Span stream) { - stream.Fill(_waveFile.Spec.Silence); + stream.Fill(_waveFile.Silence); var sliceLength = (int)Math.Min(_waveFile.Length - _wavePosition, stream.Length); if (sliceLength <= 0) { return; } var slice = _waveFile.Buffer.Slice(_wavePosition, sliceLength); - stream.MixAudioFormat(slice, _waveFile.Spec.Format, SDL.SDL_MIX_MAXVOLUME); + stream.MixAudioFormat(slice, _waveFile.Format, SDL.SDL_MIX_MAXVOLUME); _wavePosition += sliceLength; } @@ -112,9 +119,9 @@ private void Render() var frameRate = 0d; var frameRateText = $"FPS: {frameRate:0.00}"; var frameCounter = 0; - var channelCount = (int)_waveFile.Spec.Channels; + var channelCount = (int)_waveFile.Channels; var waves = new Point[channelCount][]; - var sampleFormat = _waveFile.Spec.Format; + var sampleFormat = _waveFile.Format; var sampleSize = sampleFormat.BitSize() / 8; try diff --git a/sources/SDL2Sharp/AudioDevice.cs b/sources/SDL2Sharp/AudioDevice.cs index cd4b13f9..9ad0dc6b 100644 --- a/sources/SDL2Sharp/AudioDevice.cs +++ b/sources/SDL2Sharp/AudioDevice.cs @@ -32,8 +32,6 @@ public sealed unsafe class AudioDevice : IDisposable private AudioDeviceCallbackDelegate _unmanagedCallback = null!; - private SDL_AudioSpec _obtainedSpec; - private object _userdata = null!; private GCHandle _unmanagedUserdata = default; @@ -44,36 +42,37 @@ public sealed unsafe class AudioDevice : IDisposable public bool IsOpen => _deviceID != 0; - public AudioDeviceSpec ObtainedSpec - { - get - { - ThrowIfDisposed(); - ThrowIfClosed(); - return new AudioDeviceSpec(_obtainedSpec); - } - } + public int Frequency { get; private set; } + + public AudioFormat Format { get; private set; } + + public AudioChannelLayout Channels { get; private set; } + + public byte Silence { get; private set; } + + public ushort Samples { get; private set; } + + public uint Size { get; private set; } public AudioDevice() - : this(null!) { } - public AudioDevice(AudioDeviceSpec spec) - : this(spec, null!) + public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) + : this(frequency, format, channels, samples, null!) { } - public AudioDevice(AudioDeviceSpec spec, AudioDeviceCallback callback) - : this(spec, callback, null!) + public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) + : this(frequency, format, channels, samples, callback, null!) { } - public AudioDevice(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata) + public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata) + : this(frequency, format, channels, samples, callback, null!, AudioDeviceAllowedChanges.None) { - Open(spec, callback, userdata); } - public AudioDevice(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) + public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) { - Open(spec, callback, userdata, allowedChanges); + Open(frequency, format, channels, samples, callback, userdata, allowedChanges); } ~AudioDevice() @@ -102,67 +101,58 @@ private void Dispose(bool _) } } - public void Open(AudioDeviceSpec spec) + public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) { - if (!TryOpen(spec, null!, null!, out var error)) - { - throw error; - } + Open(frequency, format, channels, samples, null!); } - public void Open(AudioDeviceSpec spec, AudioDeviceCallback callback) + public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) { - if (!TryOpen(spec, callback, null!, out var error)) - { - throw error; - } + Open(frequency, format, channels, samples, callback, null!); } - public void Open(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata) + public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata) { - if (!TryOpen(spec, callback, userdata, out var error)) - { - throw error; - } + Open(frequency, format, channels, samples, callback, userdata, AudioDeviceAllowedChanges.None); } - public void Open(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) + public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) { - if (!TryOpen(spec, callback, userdata, allowedChanges, out var error)) + if (!TryOpen(frequency, format, channels, samples, callback, userdata, allowedChanges, out var error)) { throw error; } } - public bool TryOpen(AudioDeviceSpec spec, out Error error) + public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, out Error error) { - return TryOpen(spec, null!, null!, out error); + return TryOpen(frequency, format, channels, samples, null!, out error); } - public bool TryOpen(AudioDeviceSpec spec, AudioDeviceCallback callback, out Error error) + public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, out Error error) { - return TryOpen(spec, callback, null!, out error); + return TryOpen(frequency, format, channels, samples, callback, null!, out error); } - public bool TryOpen(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata, out Error error) + public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, out Error error) { - return TryOpen(spec, callback, userdata, AudioDeviceAllowedChanges.None, out error); + return TryOpen(frequency, format, channels, samples, callback, userdata, AudioDeviceAllowedChanges.None, out error); } - public bool TryOpen(AudioDeviceSpec spec, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges, out Error error) + public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges, out Error error) { ThrowIfDisposed(); ThrowIfOpen(); var desiredSpec = new SDL_AudioSpec { - freq = spec.Frequency, - format = (ushort)spec.Format, - channels = (byte)spec.Channels, + freq = frequency, + format = (ushort)format, + channels = (byte)channels, silence = 0, samples = 0, padding = 0, - size = spec.Size + size = 0 }; if (callback != null) @@ -176,20 +166,23 @@ public bool TryOpen(AudioDeviceSpec spec, AudioDeviceCallback callback, object u desiredSpec.userdata = (void*)(IntPtr)_unmanagedUserdata; } - fixed (SDL_AudioSpec* obtainedSpec = &_obtainedSpec) + var obtainedSpec = new SDL_AudioSpec(); + _deviceID = SDL.OpenAudioDevice(null, 0, &desiredSpec, &obtainedSpec, (int)allowedChanges); + if (_deviceID == 0) { - _deviceID = SDL.OpenAudioDevice(null, 0, &desiredSpec, obtainedSpec, (int)allowedChanges); - - if (_deviceID == 0) - { - error = new Error(new string(SDL.GetError())); - return false; - } - else - { - error = null!; - return true; - } + error = new Error(new string(SDL.GetError())); + return false; + } + else + { + Frequency = obtainedSpec.freq; + Format = (AudioFormat)obtainedSpec.format; + Channels = (AudioChannelLayout)obtainedSpec.channels; + Silence = obtainedSpec.silence; + Samples = obtainedSpec.samples; + Size = obtainedSpec.size; + error = null!; + return true; } } diff --git a/sources/SDL2Sharp/AudioDeviceSpec.cs b/sources/SDL2Sharp/AudioDeviceSpec.cs deleted file mode 100644 index 6221f1e2..00000000 --- a/sources/SDL2Sharp/AudioDeviceSpec.cs +++ /dev/null @@ -1,59 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using SDL2Sharp.Interop; - -namespace SDL2Sharp -{ - public sealed unsafe class AudioDeviceSpec - { - public AudioDeviceSpec(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) - { - Frequency = frequency; - Format = format; - Channels = channels; - Silence = 0; - Samples = samples; - Size = 0; - } - - public AudioDeviceSpec(SDL_AudioSpec audioSpec) - { - Frequency = audioSpec.freq; - Format = (AudioFormat)audioSpec.format; - Channels = (AudioChannelLayout)audioSpec.channels; - Silence = audioSpec.silence; - Samples = audioSpec.samples; - Size = audioSpec.size; - } - - public int Frequency { get; set; } - - public AudioFormat Format { get; set; } - - public AudioChannelLayout Channels { get; set; } - - public byte Silence { get; private set; } - - public ushort Samples { get; set; } - - public uint Size { get; private set; } - } -} diff --git a/sources/SDL2Sharp/WaveFile.cs b/sources/SDL2Sharp/WaveFile.cs index 2cd11420..28f3fba3 100644 --- a/sources/SDL2Sharp/WaveFile.cs +++ b/sources/SDL2Sharp/WaveFile.cs @@ -32,7 +32,17 @@ public sealed unsafe class WaveFile : IDisposable private uint _waveLength; - public AudioDeviceSpec Spec => new(_waveSpec); + public int Frequency => _waveSpec.freq; + + public AudioFormat Format => (AudioFormat)_waveSpec.format; + + public AudioChannelLayout Channels => (AudioChannelLayout)_waveSpec.channels; + + public byte Silence => _waveSpec.silence; + + public ushort Samples => _waveSpec.samples; + + public uint Size => _waveSpec.size; public ReadOnlySpan Buffer => new(_waveBuffer, (int)_waveLength); From b2527a8cd711b56f7219fea621aaec08856bbb42 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 12 Jun 2024 10:31:18 +0200 Subject: [PATCH 04/62] Calculate frame rate in Render method. --- samples/PlasmaFractal/App.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs index c400dd64..bed9b0d1 100644 --- a/samples/PlasmaFractal/App.cs +++ b/samples/PlasmaFractal/App.cs @@ -95,21 +95,13 @@ protected override void OnIdle() } } - _frameTime.Start(); Render(_realTime.Elapsed); - _frameTime.Stop(); - _frameCount++; - - if (_frameTime.ElapsedMilliseconds >= 1000d) - { - _frameRate = _frameCount * 1000d / _frameTime.ElapsedMilliseconds; - _frameCount = 0; - _frameTime.Reset(); - } } private void Render(TimeSpan realTime) { + _frameTime.Start(); + _screenImage.WithLock(screenImage => { for (var y = 0; y < screenImage.Height; ++y) @@ -137,6 +129,19 @@ private void Render(TimeSpan realTime) { _palette.RotateLeft(); } + + _frameTime.Stop(); + + if (_frameTime.ElapsedMilliseconds >= 1000d) + { + _frameRate = _frameCount * 1000d / _frameTime.ElapsedMilliseconds; + _frameCount = 0; + _frameTime.Reset(); + } + else + { + ++_frameCount; + } } private void OnWindowKeyDown(object? sender, KeyEventArgs e) From a5951371aa68b2f87501ff0baf35f7d128788558 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 12 Jun 2024 10:32:38 +0200 Subject: [PATCH 05/62] Set SDL_AUDIODRIVER environment variable on Windows to "directsound" before initializing SDL. --- samples/WavePlayer/App.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index 6382cd46..2c2fe08f 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -20,9 +20,11 @@ using System; using System.Threading; +using System.Runtime.InteropServices; using SDL2Sharp; using SDL2Sharp.Extensions; using SDL2Sharp.Interop; +using static System.Runtime.InteropServices.RuntimeInformation; namespace WavePlayer { @@ -52,10 +54,16 @@ internal sealed class App : Application private int _wavePosition = 0; - protected override void OnInitialized() + protected override void OnInitializing() { - Environment.SetEnvironmentVariable("SDL_AUDIODRIVER", "directsound"); + if (IsOSPlatform(OSPlatform.Windows)) + { + Environment.SetEnvironmentVariable("SDL_AUDIODRIVER", "directsound"); + } + } + protected override void OnInitialized() + { try { _window = new Window("Wave Player", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); From b866c704800177b87dec6328c1884397a55b6ed3 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 12 Jun 2024 13:01:37 +0200 Subject: [PATCH 06/62] Remove user data object from audio device callback. --- samples/WavePlayer/App.cs | 3 +- sources/SDL2Sharp/AudioDevice.cs | 37 ++++++------------------ sources/SDL2Sharp/AudioDeviceCallback.cs | 2 +- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index 2c2fe08f..70ca39fe 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -78,7 +78,6 @@ protected override void OnInitialized() _waveFile.Channels, _waveFile.Samples, OnAudioDeviceCallback, - null!, AudioDeviceAllowedChanges.None); _renderingThread.Start(); _audioDevice.Unpause(); @@ -101,7 +100,7 @@ protected override void OnQuiting() _window?.Dispose(); } - private void OnAudioDeviceCallback(object userdata, Span stream) + private void OnAudioDeviceCallback(Span stream) { stream.Fill(_waveFile.Silence); var sliceLength = (int)Math.Min(_waveFile.Length - _wavePosition, stream.Length); diff --git a/sources/SDL2Sharp/AudioDevice.cs b/sources/SDL2Sharp/AudioDevice.cs index 9ad0dc6b..17ffe0bc 100644 --- a/sources/SDL2Sharp/AudioDevice.cs +++ b/sources/SDL2Sharp/AudioDevice.cs @@ -32,8 +32,6 @@ public sealed unsafe class AudioDevice : IDisposable private AudioDeviceCallbackDelegate _unmanagedCallback = null!; - private object _userdata = null!; - private GCHandle _unmanagedUserdata = default; private bool _disposed = false; @@ -62,17 +60,12 @@ public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channel { } public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) - : this(frequency, format, channels, samples, callback, null!) + : this(frequency, format, channels, samples, callback, AudioDeviceAllowedChanges.None) { } - public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata) - : this(frequency, format, channels, samples, callback, null!, AudioDeviceAllowedChanges.None) + public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) { - } - - public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) - { - Open(frequency, format, channels, samples, callback, userdata, allowedChanges); + Open(frequency, format, channels, samples, callback, allowedChanges); } ~AudioDevice() @@ -108,17 +101,12 @@ public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) { - Open(frequency, format, channels, samples, callback, null!); - } - - public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata) - { - Open(frequency, format, channels, samples, callback, userdata, AudioDeviceAllowedChanges.None); + Open(frequency, format, channels, samples, callback, AudioDeviceAllowedChanges.None); } - public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges) + public void Open(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) { - if (!TryOpen(frequency, format, channels, samples, callback, userdata, allowedChanges, out var error)) + if (!TryOpen(frequency, format, channels, samples, callback, allowedChanges, out var error)) { throw error; } @@ -131,15 +119,10 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, out Error error) { - return TryOpen(frequency, format, channels, samples, callback, null!, out error); - } - - public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, out Error error) - { - return TryOpen(frequency, format, channels, samples, callback, userdata, AudioDeviceAllowedChanges.None, out error); + return TryOpen(frequency, format, channels, samples, callback, AudioDeviceAllowedChanges.None, out error); } - public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, object userdata, AudioDeviceAllowedChanges allowedChanges, out Error error) + public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges, out Error error) { ThrowIfDisposed(); ThrowIfOpen(); @@ -158,7 +141,6 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe if (callback != null) { _callback = callback; - _userdata = userdata; _unmanagedUserdata = GCHandle.Alloc(this, GCHandleType.Normal); _unmanagedCallback = new AudioDeviceCallbackDelegate(OnAudioDeviceCallback); @@ -196,7 +178,6 @@ public void Close() _deviceID = 0; _callback = null!; - _userdata = null!; _unmanagedCallback = null!; if (_unmanagedUserdata.IsAllocated) @@ -278,7 +259,7 @@ private static void OnAudioDeviceCallback(void* userdata, byte* stream, int len) var audioDeviceHandle = GCHandle.FromIntPtr((IntPtr)userdata); if (audioDeviceHandle.Target is AudioDevice audioDevice) { - audioDevice._callback(audioDevice._userdata, new Span(stream, len)); + audioDevice._callback(new Span(stream, len)); } } } diff --git a/sources/SDL2Sharp/AudioDeviceCallback.cs b/sources/SDL2Sharp/AudioDeviceCallback.cs index bf84a694..a4ca1a4f 100644 --- a/sources/SDL2Sharp/AudioDeviceCallback.cs +++ b/sources/SDL2Sharp/AudioDeviceCallback.cs @@ -22,5 +22,5 @@ namespace SDL2Sharp { - public delegate void AudioDeviceCallback(object userdata, Span stream); + public delegate void AudioDeviceCallback(Span stream); } From 240b5662800780e034ba9ce3eedaaea9734679a5 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 14 Jun 2024 14:15:17 +0200 Subject: [PATCH 07/62] Rename file to match class name. --- sources/SDL2Sharp/{PixelArrayOrder.cs => ArrayOrder.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/SDL2Sharp/{PixelArrayOrder.cs => ArrayOrder.cs} (100%) diff --git a/sources/SDL2Sharp/PixelArrayOrder.cs b/sources/SDL2Sharp/ArrayOrder.cs similarity index 100% rename from sources/SDL2Sharp/PixelArrayOrder.cs rename to sources/SDL2Sharp/ArrayOrder.cs From 3ff680d752a2c0838a8438f89172530e19dd3071 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 14 Jun 2024 14:15:37 +0200 Subject: [PATCH 08/62] Use simple using statement. --- sources/SDL2Sharp/Font.cs | 24 ++++-------- sources/SDL2Sharp/Platform.cs | 70 +++++++++++++++++++++++++++++++++++ sources/SDL2Sharp/WaveFile.cs | 24 ++++++------ sources/SDL2Sharp/Window.cs | 38 +++++++++---------- 4 files changed, 106 insertions(+), 50 deletions(-) create mode 100644 sources/SDL2Sharp/Platform.cs diff --git a/sources/SDL2Sharp/Font.cs b/sources/SDL2Sharp/Font.cs index 8539f8e1..89a01f3c 100644 --- a/sources/SDL2Sharp/Font.cs +++ b/sources/SDL2Sharp/Font.cs @@ -31,12 +31,10 @@ public sealed unsafe class Font : IDisposable public Font(string path, int pointSize) { - using (var marshaledPath = new MarshaledString(path)) - { - var handle = TTF.OpenFont(marshaledPath, pointSize); - FontError.ThrowOnFailure(handle); - _handle = handle; - } + using var marshaledPath = new MarshaledString(path); + var handle = TTF.OpenFont(marshaledPath, pointSize); + FontError.ThrowOnFailure(handle); + _handle = handle; } ~Font() @@ -60,21 +58,15 @@ private void Dispose(bool _) public Surface RenderSolid(string text, Color color) { ThrowWhenDisposed(); - - using (var marshaledText = new MarshaledString(text)) - { - return new Surface(TTF.RenderText_Solid(_handle, marshaledText, color)); - } + using var marshaledText = new MarshaledString(text); + return new Surface(TTF.RenderText_Solid(_handle, marshaledText, color)); } public Surface RenderBlended(string text, Color color) { ThrowWhenDisposed(); - - using (var marshaledText = new MarshaledString(text)) - { - return new Surface(TTF.RenderText_Blended(_handle, marshaledText, color)); - } + using var marshaledText = new MarshaledString(text); + return new Surface(TTF.RenderText_Blended(_handle, marshaledText, color)); } public static implicit operator _TTF_Font*(Font font) diff --git a/sources/SDL2Sharp/Platform.cs b/sources/SDL2Sharp/Platform.cs new file mode 100644 index 00000000..56c6fe2c --- /dev/null +++ b/sources/SDL2Sharp/Platform.cs @@ -0,0 +1,70 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp +{ + public sealed class Platform : IDisposable + { + public static Platform Instance { get; private set; } = null!; + + public Platform() + { + if (Instance != null) + { + throw new InvalidOperationException("Only one instance of Platform is allowed."); + } + + Instance = this; + + SDL.Init(0); + } + + public void Dispose() + { + if (Instance != null) + { + SDL.Quit(); + } + + Instance = null!; + } + + public EventSubsystem Events + { + + } + } + + public sealed class EventSubsystem : IDisposable + { + internal EventSubsystem() + { + SDL.InitSubSystem(SDL.SDL_INIT_EVENTS); + } + + public void Dispose() + { + SDL.QuitSubSystem(SDL.SDL_INIT_EVENTS); + } + } +} diff --git a/sources/SDL2Sharp/WaveFile.cs b/sources/SDL2Sharp/WaveFile.cs index 28f3fba3..13bc652f 100644 --- a/sources/SDL2Sharp/WaveFile.cs +++ b/sources/SDL2Sharp/WaveFile.cs @@ -50,21 +50,19 @@ public sealed unsafe class WaveFile : IDisposable public WaveFile(string filename) { - using (var unmanagedFilename = new MarshaledString(filename)) - using (var unmanagedMode = new MarshaledString("rb")) + using var unmanagedFilename = new MarshaledString(filename); + using var unmanagedMode = new MarshaledString("rb"); + var fileStream = Error.ReturnOrThrowOnFailure( + SDL.RWFromFile(unmanagedFilename, unmanagedMode) + ); + + fixed (SDL_AudioSpec* waveSpec = &_waveSpec) + fixed (byte** waveBuffer = &_waveBuffer) + fixed (uint* waveLength = &_waveLength) { - var fileStream = Error.ReturnOrThrowOnFailure( - SDL.RWFromFile(unmanagedFilename, unmanagedMode) + Error.ThrowOnFailure( + SDL.LoadWAV_RW(fileStream, 1, waveSpec, waveBuffer, waveLength) ); - - fixed (SDL_AudioSpec* waveSpec = &_waveSpec) - fixed (byte** waveBuffer = &_waveBuffer) - fixed (uint* waveLength = &_waveLength) - { - Error.ThrowOnFailure( - SDL.LoadWAV_RW(fileStream, 1, waveSpec, waveBuffer, waveLength) - ); - } } } diff --git a/sources/SDL2Sharp/Window.cs b/sources/SDL2Sharp/Window.cs index a19d3204..80bb606d 100644 --- a/sources/SDL2Sharp/Window.cs +++ b/sources/SDL2Sharp/Window.cs @@ -98,10 +98,8 @@ public string Title { ThrowWhenDisposed(); - using (var marshaledValue = new MarshaledString(value)) - { - SDL.SetWindowTitle(_handle, marshaledValue); - } + using var marshaledValue = new MarshaledString(value); + SDL.SetWindowTitle(_handle, marshaledValue); } } @@ -350,24 +348,22 @@ public Window(string title, int x, int y, int width, int height, WindowFlags fla private Window(string title, int x, int y, int width, int height, uint flags) { - using (var marshaledTitle = new MarshaledString(title)) + using var marshaledTitle = new MarshaledString(title); + _handle = Error.ReturnOrThrowOnFailure( + SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) + ); + + if (!IsBordered) { - _handle = Error.ReturnOrThrowOnFailure( - SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) + _hitTestCallback = new HitTestCallbackDelegate(HitTestCallback); + var hitTestCallback = Marshal.GetFunctionPointerForDelegate(_hitTestCallback); + Error.ThrowOnFailure( + SDL.SetWindowHitTest(_handle, hitTestCallback, null) ); - - if (!IsBordered) - { - _hitTestCallback = new HitTestCallbackDelegate(HitTestCallback); - var hitTestCallback = Marshal.GetFunctionPointerForDelegate(_hitTestCallback); - Error.ThrowOnFailure( - SDL.SetWindowHitTest(_handle, hitTestCallback, null) - ); - } - else - { - _hitTestCallback = null!; - } + } + else + { + _hitTestCallback = null!; } _all.Add(this); @@ -482,7 +478,7 @@ public bool TryCreateRenderer(RendererFlags flags, out Renderer renderer, out Er } } - public void Update() + public void UpdateSurface() { ThrowWhenDisposed(); From 855080ab3038a2063a432c9fc497677f4111bf91 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 16 Jun 2024 15:58:17 +0200 Subject: [PATCH 09/62] Move extensions to main library.. --- SDL2Sharp.sln | 7 -- samples/AverageFrameRate/App.cs | 5 +- samples/BitmapViewer/App.cs | 1 - samples/BitmapViewer/BitmapViewer.csproj | 1 - samples/ParticleSystem/App.cs | 1 - samples/ParticleSystem/Particle.cs | 8 +-- samples/ParticleSystem/ParticleEmitter.cs | 8 +-- samples/ParticleSystem/ParticleSystem.csproj | 1 - samples/PlasmaFractal/App.cs | 3 +- samples/PlasmaFractal/PlasmaFractal.csproj | 1 - samples/RayTracer/App.cs | 1 - samples/RayTracer/Camera.cs | 1 - samples/RayTracer/ISurface.cs | 2 +- samples/RayTracer/MatteSurface.cs | 2 +- samples/RayTracer/PointLight.cs | 2 +- samples/RayTracer/RayTracer.csproj | 1 - samples/RayTracer/World.cs | 2 +- samples/SwirlStars/App.cs | 2 +- samples/SwirlStars/Star.cs | 2 +- samples/SwirlStars/SwirlStars.csproj | 1 - samples/TunnelEffect/App.cs | 3 +- samples/TunnelEffect/TunnelEffect.csproj | 1 - samples/WavePlayer/App.cs | 4 +- samples/WavePlayer/WavePlayer.csproj | 1 - .../SDL2Sharp.Extensions.csproj | 18 ----- .../{Extensions => }/AudioFormatExtensions.cs | 2 +- .../Colors}/Rgb32f.cs | 2 +- .../Colors}/Rgb32fExtensions.cs | 2 +- .../MathExtensions.cs | 4 +- .../PixelFormatEnumExtensions.cs | 2 +- sources/SDL2Sharp/Platform.cs | 66 +++++++++++++++++-- .../ReadOnlySpanExtensions.cs | 2 +- .../RendererExtensions.cs | 2 +- .../SpanExtensions.cs | 2 +- .../ThreadExtensions.cs | 2 +- .../AudioFormatExtensionTests.cs | 1 - 36 files changed, 93 insertions(+), 73 deletions(-) delete mode 100644 sources/SDL2Sharp.Extensions/SDL2Sharp.Extensions.csproj rename sources/SDL2Sharp/{Extensions => }/AudioFormatExtensions.cs (98%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp/Colors}/Rgb32f.cs (99%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp/Colors}/Rgb32fExtensions.cs (98%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp}/MathExtensions.cs (95%) rename sources/SDL2Sharp/{Extensions => }/PixelFormatEnumExtensions.cs (98%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp}/ReadOnlySpanExtensions.cs (99%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp}/RendererExtensions.cs (99%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp}/SpanExtensions.cs (98%) rename sources/{SDL2Sharp.Extensions => SDL2Sharp}/ThreadExtensions.cs (97%) diff --git a/SDL2Sharp.sln b/SDL2Sharp.sln index 05bb3947..8a83c186 100644 --- a/SDL2Sharp.sln +++ b/SDL2Sharp.sln @@ -75,8 +75,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{8869 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RayTracer", "samples\RayTracer\RayTracer.csproj", "{A39F687C-F374-461F-A949-FA7BFFB6ADFC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.Extensions", "sources\SDL2Sharp.Extensions\SDL2Sharp.Extensions.csproj", "{AEA6EAFA-AB09-4B19-A103-DDD7E672D506}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwirlStars", "samples\SwirlStars\SwirlStars.csproj", "{B8107CDD-068A-451A-86A3-0C33BCEB4F99}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\Build\Build.csproj", "{6B61E97E-DF1B-4AE2-A52D-47034759F00E}" @@ -133,10 +131,6 @@ Global {A39F687C-F374-461F-A949-FA7BFFB6ADFC}.Debug|Any CPU.Build.0 = Debug|Any CPU {A39F687C-F374-461F-A949-FA7BFFB6ADFC}.Release|Any CPU.ActiveCfg = Release|Any CPU {A39F687C-F374-461F-A949-FA7BFFB6ADFC}.Release|Any CPU.Build.0 = Release|Any CPU - {AEA6EAFA-AB09-4B19-A103-DDD7E672D506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AEA6EAFA-AB09-4B19-A103-DDD7E672D506}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AEA6EAFA-AB09-4B19-A103-DDD7E672D506}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AEA6EAFA-AB09-4B19-A103-DDD7E672D506}.Release|Any CPU.Build.0 = Release|Any CPU {B8107CDD-068A-451A-86A3-0C33BCEB4F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B8107CDD-068A-451A-86A3-0C33BCEB4F99}.Debug|Any CPU.Build.0 = Debug|Any CPU {B8107CDD-068A-451A-86A3-0C33BCEB4F99}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -160,7 +154,6 @@ Global {73FBFF5C-8D51-48C6-9321-0A9532864E32} = {3B3053A4-91F3-4C66-A6A9-773B6CEEE34C} {629C4F2E-29C2-417A-BB3C-E52EA33CD365} = {3B3053A4-91F3-4C66-A6A9-773B6CEEE34C} {A39F687C-F374-461F-A949-FA7BFFB6ADFC} = {3B3053A4-91F3-4C66-A6A9-773B6CEEE34C} - {AEA6EAFA-AB09-4B19-A103-DDD7E672D506} = {1CCF39F1-02DD-4E9C-B1C2-614715E9EDB0} {B8107CDD-068A-451A-86A3-0C33BCEB4F99} = {3B3053A4-91F3-4C66-A6A9-773B6CEEE34C} {6B61E97E-DF1B-4AE2-A52D-47034759F00E} = {9966EF4F-44DE-48FF-964C-B2A7DD157128} EndGlobalSection diff --git a/samples/AverageFrameRate/App.cs b/samples/AverageFrameRate/App.cs index 9172f176..5003173f 100644 --- a/samples/AverageFrameRate/App.cs +++ b/samples/AverageFrameRate/App.cs @@ -21,6 +21,7 @@ using System; using System.Threading; using SDL2Sharp; +using static System.Math; namespace AverageFrameRate { @@ -88,8 +89,8 @@ private void Render() using (var textTexture = renderer.CreateTextureFromSurface(textSurface)) { var outputSize = renderer.OutputSize; - var x = Math.Abs(outputSize.Width - textTexture.Width) / 2; - var y = Math.Abs(outputSize.Height - textTexture.Height) / 2; + var x = Abs(outputSize.Width - textTexture.Width) / 2; + var y = Abs(outputSize.Height - textTexture.Height) / 2; var dest = new Rectangle(x, y, textTexture.Width, textTexture.Height); renderer.Copy(textTexture, dest); } diff --git a/samples/BitmapViewer/App.cs b/samples/BitmapViewer/App.cs index 1b12b202..65a07235 100644 --- a/samples/BitmapViewer/App.cs +++ b/samples/BitmapViewer/App.cs @@ -20,7 +20,6 @@ using System; using SDL2Sharp; -using SDL2Sharp.Extensions; namespace BitmapViewer { diff --git a/samples/BitmapViewer/BitmapViewer.csproj b/samples/BitmapViewer/BitmapViewer.csproj index e6b70818..49d4ba6c 100644 --- a/samples/BitmapViewer/BitmapViewer.csproj +++ b/samples/BitmapViewer/BitmapViewer.csproj @@ -21,7 +21,6 @@ - diff --git a/samples/ParticleSystem/App.cs b/samples/ParticleSystem/App.cs index 6a5b95d7..22e8fe3b 100644 --- a/samples/ParticleSystem/App.cs +++ b/samples/ParticleSystem/App.cs @@ -21,7 +21,6 @@ using System; using System.Threading; using SDL2Sharp; -using SDL2Sharp.Extensions; namespace ParticleSystem { diff --git a/samples/ParticleSystem/Particle.cs b/samples/ParticleSystem/Particle.cs index 0fab0705..ee4f0e5a 100644 --- a/samples/ParticleSystem/Particle.cs +++ b/samples/ParticleSystem/Particle.cs @@ -20,7 +20,7 @@ using System; using SDL2Sharp; -using SDL2Sharp.Extensions; +using static System.Math; namespace ParticleSystem { @@ -59,10 +59,10 @@ public void Respawn(TimeSpan lifespan, Color color, Point position, double radiu public void Update(DateTime realTime, TimeSpan elapsedTime) { var lifetime = Lifespan - Age; - var ratio = Math.Clamp(1.0 - elapsedTime / lifetime, 0.0, 1.0); + var ratio = Clamp(1.0 - elapsedTime / lifetime, 0.0, 1.0); Age += elapsedTime; Radius = ratio * Radius; - Color = new Color(Color.R, Color.G, Color.B, (byte)Math.Ceiling(ratio * Color.A)); + Color = new Color(Color.R, Color.G, Color.B, (byte)System.Math.Ceiling(ratio * Color.A)); } public void Render(Renderer renderer) @@ -74,7 +74,7 @@ public void Render(Renderer renderer) renderer.DrawColor = Color; renderer.BlendMode = BlendMode.Blend; - renderer.FillCircle(Position.X, Position.Y, (int)Math.Ceiling(Radius)); + renderer.FillCircle(Position.X, Position.Y, (int)System.Math.Ceiling(Radius)); } } } diff --git a/samples/ParticleSystem/ParticleEmitter.cs b/samples/ParticleSystem/ParticleEmitter.cs index e4fe2ea8..cdd20cf3 100644 --- a/samples/ParticleSystem/ParticleEmitter.cs +++ b/samples/ParticleSystem/ParticleEmitter.cs @@ -21,7 +21,7 @@ using System; using System.Collections.Generic; using SDL2Sharp; -using SDL2Sharp.Extensions; +using static System.Math; namespace ParticleSystem { @@ -54,9 +54,9 @@ public void Update(DateTime realTime, TimeSpan elapsedTime) { if (particle.IsDead) { - var angle = _randomizer.NextDouble() * Math.PI * 2; - var x = Position.X + Math.Cos(angle) * Radius * 2; - var y = Position.Y + Math.Sin(angle) * Radius * 2; + var angle = _randomizer.NextDouble() * System.Math.PI * 2; + var x = Position.X + Cos(angle) * Radius * 2; + var y = Position.Y + Sin(angle) * Radius * 2; var position = new Point((int)x, (int)y); var r = (byte)(_randomizer.NextDouble() * byte.MaxValue); diff --git a/samples/ParticleSystem/ParticleSystem.csproj b/samples/ParticleSystem/ParticleSystem.csproj index c63d3ebd..fb3b4bd5 100644 --- a/samples/ParticleSystem/ParticleSystem.csproj +++ b/samples/ParticleSystem/ParticleSystem.csproj @@ -21,7 +21,6 @@ - diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs index bed9b0d1..8b72f924 100644 --- a/samples/PlasmaFractal/App.cs +++ b/samples/PlasmaFractal/App.cs @@ -22,9 +22,8 @@ using System.Diagnostics; using SDL2Sharp; using SDL2Sharp.Colors; -using SDL2Sharp.Extensions; using static System.Math; -using static SDL2Sharp.Extensions.MathExtensions; +using static SDL2Sharp.Math; namespace PlasmaFractal { diff --git a/samples/PlasmaFractal/PlasmaFractal.csproj b/samples/PlasmaFractal/PlasmaFractal.csproj index c63d3ebd..fb3b4bd5 100644 --- a/samples/PlasmaFractal/PlasmaFractal.csproj +++ b/samples/PlasmaFractal/PlasmaFractal.csproj @@ -21,7 +21,6 @@ - diff --git a/samples/RayTracer/App.cs b/samples/RayTracer/App.cs index dd2a0214..19aa6c3d 100644 --- a/samples/RayTracer/App.cs +++ b/samples/RayTracer/App.cs @@ -23,7 +23,6 @@ using System.Numerics; using SDL2Sharp; using SDL2Sharp.Colors; -using SDL2Sharp.Extensions; namespace RayTracer { diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index ae6eba94..e27b9f95 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -23,7 +23,6 @@ using System.Numerics; using SDL2Sharp; using SDL2Sharp.Colors; -using SDL2Sharp.Extensions; namespace RayTracer { diff --git a/samples/RayTracer/ISurface.cs b/samples/RayTracer/ISurface.cs index 2edfe9c1..b42783cf 100644 --- a/samples/RayTracer/ISurface.cs +++ b/samples/RayTracer/ISurface.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace RayTracer { diff --git a/samples/RayTracer/MatteSurface.cs b/samples/RayTracer/MatteSurface.cs index 37c544e7..dad529be 100644 --- a/samples/RayTracer/MatteSurface.cs +++ b/samples/RayTracer/MatteSurface.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace RayTracer { diff --git a/samples/RayTracer/PointLight.cs b/samples/RayTracer/PointLight.cs index beebae59..6d04a603 100644 --- a/samples/RayTracer/PointLight.cs +++ b/samples/RayTracer/PointLight.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace RayTracer { diff --git a/samples/RayTracer/RayTracer.csproj b/samples/RayTracer/RayTracer.csproj index 30820e0c..421be704 100644 --- a/samples/RayTracer/RayTracer.csproj +++ b/samples/RayTracer/RayTracer.csproj @@ -21,7 +21,6 @@ - diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index 1be43b53..1197d677 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Collections.Generic; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace RayTracer { diff --git a/samples/SwirlStars/App.cs b/samples/SwirlStars/App.cs index 446ebc98..81a6d097 100644 --- a/samples/SwirlStars/App.cs +++ b/samples/SwirlStars/App.cs @@ -23,7 +23,7 @@ using System.Numerics; using System.Collections.Generic; using SDL2Sharp; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace SwirlStars { diff --git a/samples/SwirlStars/Star.cs b/samples/SwirlStars/Star.cs index cdc31674..c8a19b57 100644 --- a/samples/SwirlStars/Star.cs +++ b/samples/SwirlStars/Star.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Extensions; +using SDL2Sharp.Colors; namespace SwirlStars { diff --git a/samples/SwirlStars/SwirlStars.csproj b/samples/SwirlStars/SwirlStars.csproj index 30820e0c..421be704 100644 --- a/samples/SwirlStars/SwirlStars.csproj +++ b/samples/SwirlStars/SwirlStars.csproj @@ -21,7 +21,6 @@ - diff --git a/samples/TunnelEffect/App.cs b/samples/TunnelEffect/App.cs index 600afdbc..aa3447c7 100644 --- a/samples/TunnelEffect/App.cs +++ b/samples/TunnelEffect/App.cs @@ -23,9 +23,8 @@ using Microsoft.Toolkit.HighPerformance; using SDL2Sharp; using SDL2Sharp.Colors; -using SDL2Sharp.Extensions; using static System.Math; -using static SDL2Sharp.Extensions.MathExtensions; +using static SDL2Sharp.Math; namespace TunnelEffect { diff --git a/samples/TunnelEffect/TunnelEffect.csproj b/samples/TunnelEffect/TunnelEffect.csproj index 48babeb3..464cbb7b 100644 --- a/samples/TunnelEffect/TunnelEffect.csproj +++ b/samples/TunnelEffect/TunnelEffect.csproj @@ -25,7 +25,6 @@ - diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs index 70ca39fe..cb177391 100644 --- a/samples/WavePlayer/App.cs +++ b/samples/WavePlayer/App.cs @@ -22,8 +22,8 @@ using System.Threading; using System.Runtime.InteropServices; using SDL2Sharp; -using SDL2Sharp.Extensions; using SDL2Sharp.Interop; +using static System.Math; using static System.Runtime.InteropServices.RuntimeInformation; namespace WavePlayer @@ -103,7 +103,7 @@ protected override void OnQuiting() private void OnAudioDeviceCallback(Span stream) { stream.Fill(_waveFile.Silence); - var sliceLength = (int)Math.Min(_waveFile.Length - _wavePosition, stream.Length); + var sliceLength = (int)Min(_waveFile.Length - _wavePosition, stream.Length); if (sliceLength <= 0) { return; diff --git a/samples/WavePlayer/WavePlayer.csproj b/samples/WavePlayer/WavePlayer.csproj index 27abf425..17a6d817 100644 --- a/samples/WavePlayer/WavePlayer.csproj +++ b/samples/WavePlayer/WavePlayer.csproj @@ -24,7 +24,6 @@ - diff --git a/sources/SDL2Sharp.Extensions/SDL2Sharp.Extensions.csproj b/sources/SDL2Sharp.Extensions/SDL2Sharp.Extensions.csproj deleted file mode 100644 index 5c82e799..00000000 --- a/sources/SDL2Sharp.Extensions/SDL2Sharp.Extensions.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0;net461 - AnyCPU - Provides extensions for type safe wrappers for SDL2 bindings written in C#. - SDL2 - - - - - - - - - - - diff --git a/sources/SDL2Sharp/Extensions/AudioFormatExtensions.cs b/sources/SDL2Sharp/AudioFormatExtensions.cs similarity index 98% rename from sources/SDL2Sharp/Extensions/AudioFormatExtensions.cs rename to sources/SDL2Sharp/AudioFormatExtensions.cs index 7c1b10a0..bdfb9296 100644 --- a/sources/SDL2Sharp/Extensions/AudioFormatExtensions.cs +++ b/sources/SDL2Sharp/AudioFormatExtensions.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class AudioFormatExtensions { diff --git a/sources/SDL2Sharp.Extensions/Rgb32f.cs b/sources/SDL2Sharp/Colors/Rgb32f.cs similarity index 99% rename from sources/SDL2Sharp.Extensions/Rgb32f.cs rename to sources/SDL2Sharp/Colors/Rgb32f.cs index 715d95fe..a8de7d58 100644 --- a/sources/SDL2Sharp.Extensions/Rgb32f.cs +++ b/sources/SDL2Sharp/Colors/Rgb32f.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] public readonly struct Rgb32f : IEquatable diff --git a/sources/SDL2Sharp.Extensions/Rgb32fExtensions.cs b/sources/SDL2Sharp/Colors/Rgb32fExtensions.cs similarity index 98% rename from sources/SDL2Sharp.Extensions/Rgb32fExtensions.cs rename to sources/SDL2Sharp/Colors/Rgb32fExtensions.cs index bf7cd829..928900bd 100644 --- a/sources/SDL2Sharp.Extensions/Rgb32fExtensions.cs +++ b/sources/SDL2Sharp/Colors/Rgb32fExtensions.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Colors; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class Rgb32fExtensions { diff --git a/sources/SDL2Sharp.Extensions/MathExtensions.cs b/sources/SDL2Sharp/MathExtensions.cs similarity index 95% rename from sources/SDL2Sharp.Extensions/MathExtensions.cs rename to sources/SDL2Sharp/MathExtensions.cs index 26738af1..c2ac7e3c 100644 --- a/sources/SDL2Sharp.Extensions/MathExtensions.cs +++ b/sources/SDL2Sharp/MathExtensions.cs @@ -18,9 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { - public static class MathExtensions + public static class Math { public static int Mod(int a, int b) { diff --git a/sources/SDL2Sharp/Extensions/PixelFormatEnumExtensions.cs b/sources/SDL2Sharp/PixelFormatEnumExtensions.cs similarity index 98% rename from sources/SDL2Sharp/Extensions/PixelFormatEnumExtensions.cs rename to sources/SDL2Sharp/PixelFormatEnumExtensions.cs index d116477b..252ae77f 100644 --- a/sources/SDL2Sharp/Extensions/PixelFormatEnumExtensions.cs +++ b/sources/SDL2Sharp/PixelFormatEnumExtensions.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class PixelFormatEnumExtensions { diff --git a/sources/SDL2Sharp/Platform.cs b/sources/SDL2Sharp/Platform.cs index 56c6fe2c..1408c455 100644 --- a/sources/SDL2Sharp/Platform.cs +++ b/sources/SDL2Sharp/Platform.cs @@ -25,9 +25,21 @@ namespace SDL2Sharp { public sealed class Platform : IDisposable { + private VideoSubsystem _videoSubsystem = null!; + + private AudioSystem _audioSubsystem = null!; + + private EventSubsystem _eventsSubsystem = null!; + public static Platform Instance { get; private set; } = null!; - public Platform() + public VideoSubsystem Video => _videoSubsystem ??= new VideoSubsystem(); + + public AudioSystem Audio => _audioSubsystem ??= new AudioSystem(); + + public EventSubsystem Events => _eventsSubsystem ??= new EventSubsystem(); + + internal Platform() { if (Instance != null) { @@ -39,7 +51,7 @@ public Platform() SDL.Init(0); } - public void Dispose() + void IDisposable.Dispose() { if (Instance != null) { @@ -48,10 +60,46 @@ public void Dispose() Instance = null!; } + } - public EventSubsystem Events + public sealed class VideoSubsystem : IDisposable + { + internal VideoSubsystem() { + SDL.InitSubSystem(SDL.SDL_INIT_VIDEO); + } + void IDisposable.Dispose() + { + SDL.QuitSubSystem(SDL.SDL_INIT_VIDEO); + } + } + + public sealed class AudioSystem : IDisposable + { + internal AudioSystem() + { + SDL.InitSubSystem(SDL.SDL_INIT_AUDIO); + } + + void IDisposable.Dispose() + { + SDL.QuitSubSystem(SDL.SDL_INIT_AUDIO); + } + + public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) + { + return new AudioDevice(frequency, format, channels, samples); + } + + public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) + { + return new AudioDevice(frequency, format, channels, samples, callback); + } + + public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) + { + return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); } } @@ -62,9 +110,19 @@ internal EventSubsystem() SDL.InitSubSystem(SDL.SDL_INIT_EVENTS); } - public void Dispose() + void IDisposable.Dispose() { SDL.QuitSubSystem(SDL.SDL_INIT_EVENTS); } + + public bool HasEvent(uint eventType) + { + return SDL.HasEvent(eventType) == SDL_bool.SDL_TRUE; + } + + public void PumpEvents() + { + SDL.PumpEvents(); + } } } diff --git a/sources/SDL2Sharp.Extensions/ReadOnlySpanExtensions.cs b/sources/SDL2Sharp/ReadOnlySpanExtensions.cs similarity index 99% rename from sources/SDL2Sharp.Extensions/ReadOnlySpanExtensions.cs rename to sources/SDL2Sharp/ReadOnlySpanExtensions.cs index f46a20f0..3261dc18 100644 --- a/sources/SDL2Sharp.Extensions/ReadOnlySpanExtensions.cs +++ b/sources/SDL2Sharp/ReadOnlySpanExtensions.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class ReadOnlySpanExtensions { diff --git a/sources/SDL2Sharp.Extensions/RendererExtensions.cs b/sources/SDL2Sharp/RendererExtensions.cs similarity index 99% rename from sources/SDL2Sharp.Extensions/RendererExtensions.cs rename to sources/SDL2Sharp/RendererExtensions.cs index badadc5a..50d57eb9 100644 --- a/sources/SDL2Sharp.Extensions/RendererExtensions.cs +++ b/sources/SDL2Sharp/RendererExtensions.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class RendererExtensions { diff --git a/sources/SDL2Sharp.Extensions/SpanExtensions.cs b/sources/SDL2Sharp/SpanExtensions.cs similarity index 98% rename from sources/SDL2Sharp.Extensions/SpanExtensions.cs rename to sources/SDL2Sharp/SpanExtensions.cs index 8437b3f3..f83194dc 100644 --- a/sources/SDL2Sharp.Extensions/SpanExtensions.cs +++ b/sources/SDL2Sharp/SpanExtensions.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class SpanExtensions { diff --git a/sources/SDL2Sharp.Extensions/ThreadExtensions.cs b/sources/SDL2Sharp/ThreadExtensions.cs similarity index 97% rename from sources/SDL2Sharp.Extensions/ThreadExtensions.cs rename to sources/SDL2Sharp/ThreadExtensions.cs index 6f1fb128..aa7dd3ff 100644 --- a/sources/SDL2Sharp.Extensions/ThreadExtensions.cs +++ b/sources/SDL2Sharp/ThreadExtensions.cs @@ -21,7 +21,7 @@ using System; using System.Threading; -namespace SDL2Sharp.Extensions +namespace SDL2Sharp { public static class ThreadExtensions { diff --git a/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs b/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs index 33e9b558..bfe4e709 100644 --- a/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs +++ b/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs @@ -18,7 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Extensions; using Xunit; namespace SDL2Sharp.UnitTests From bb422cbae085b172ef5be1bec858c8e5fd5b1587 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 18 Jun 2024 12:17:44 +0200 Subject: [PATCH 10/62] Remove redundant inner event loop. --- sources/SDL2Sharp/Application.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sources/SDL2Sharp/Application.cs b/sources/SDL2Sharp/Application.cs index 6e3a42b0..8f145fc1 100644 --- a/sources/SDL2Sharp/Application.cs +++ b/sources/SDL2Sharp/Application.cs @@ -70,7 +70,7 @@ public int Run() while (true) { - while (0 != SDL.PollEvent(&@event)) + if (0 != SDL.PollEvent(&@event)) { var eventType = (SDL_EventType)@event.type; switch (eventType) @@ -99,8 +99,10 @@ public int Run() break; } } - - OnIdle(); + else + { + OnIdle(); + } } } finally From 8293dd7fca0f45ac5c4ef2a9535a213c7d436e16 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 19 Jun 2024 08:36:39 +0200 Subject: [PATCH 11/62] Introduce specific enumeration for packed colors. --- sources/SDL2Sharp/Colors/Abgr1555.cs | 3 +- sources/SDL2Sharp/Colors/Abgr4444.cs | 3 +- sources/SDL2Sharp/Colors/Abgr8888.cs | 3 +- sources/SDL2Sharp/Colors/Argb1555.cs | 3 +- sources/SDL2Sharp/Colors/Argb2101010.cs | 3 +- sources/SDL2Sharp/Colors/Argb4444.cs | 3 +- sources/SDL2Sharp/Colors/Argb8888.cs | 3 +- sources/SDL2Sharp/Colors/Bgr24.cs | 3 +- sources/SDL2Sharp/Colors/Bgr565.cs | 3 +- sources/SDL2Sharp/Colors/Bgra4444.cs | 3 +- sources/SDL2Sharp/Colors/Bgra5551.cs | 3 +- sources/SDL2Sharp/Colors/Bgra8888.cs | 3 +- sources/SDL2Sharp/Colors/Bgrx8888.cs | 3 +- sources/SDL2Sharp/Colors/Rgb24.cs | 3 +- sources/SDL2Sharp/Colors/Rgb332.cs | 3 +- sources/SDL2Sharp/Colors/Rgb565.cs | 3 +- sources/SDL2Sharp/Colors/Rgba4444.cs | 3 +- sources/SDL2Sharp/Colors/Rgba5551.cs | 3 +- sources/SDL2Sharp/Colors/Rgba8888.cs | 3 +- sources/SDL2Sharp/Colors/Rgbx8888.cs | 3 +- sources/SDL2Sharp/Colors/Xbgr1555.cs | 3 +- sources/SDL2Sharp/Colors/Xbgr4444.cs | 3 +- sources/SDL2Sharp/Colors/Xbgr8888.cs | 3 +- sources/SDL2Sharp/Colors/Xrgb1555.cs | 3 +- sources/SDL2Sharp/Colors/Xrgb4444.cs | 3 +- sources/SDL2Sharp/Colors/Xrgb8888.cs | 3 +- .../{Internals => }/PackedColorAttribute.cs | 10 ++-- sources/SDL2Sharp/PackedPixelFormat.cs | 52 +++++++++++++++++++ sources/SDL2Sharp/Renderer.cs | 1 - 29 files changed, 83 insertions(+), 58 deletions(-) rename sources/SDL2Sharp/{Internals => }/PackedColorAttribute.cs (81%) create mode 100644 sources/SDL2Sharp/PackedPixelFormat.cs diff --git a/sources/SDL2Sharp/Colors/Abgr1555.cs b/sources/SDL2Sharp/Colors/Abgr1555.cs index f310b555..744ec096 100644 --- a/sources/SDL2Sharp/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Colors/Abgr1555.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.ABGR1555)] + [PackedColor(PackedPixelFormat.ABGR1555)] public readonly record struct Abgr1555 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Abgr4444.cs b/sources/SDL2Sharp/Colors/Abgr4444.cs index abcdb75c..68a91b3f 100644 --- a/sources/SDL2Sharp/Colors/Abgr4444.cs +++ b/sources/SDL2Sharp/Colors/Abgr4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.ABGR4444)] + [PackedColor(PackedPixelFormat.ABGR4444)] public readonly record struct Abgr4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Abgr8888.cs b/sources/SDL2Sharp/Colors/Abgr8888.cs index fc97dd49..b099c1c3 100644 --- a/sources/SDL2Sharp/Colors/Abgr8888.cs +++ b/sources/SDL2Sharp/Colors/Abgr8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.ABGR8888)] + [PackedColor(PackedPixelFormat.ABGR8888)] public readonly record struct Abgr8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Argb1555.cs b/sources/SDL2Sharp/Colors/Argb1555.cs index ced06a17..0c70069f 100644 --- a/sources/SDL2Sharp/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Colors/Argb1555.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.ARGB1555)] + [PackedColor(PackedPixelFormat.ARGB1555)] public readonly record struct Argb1555 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Argb2101010.cs b/sources/SDL2Sharp/Colors/Argb2101010.cs index 148c9dc4..e56d6853 100644 --- a/sources/SDL2Sharp/Colors/Argb2101010.cs +++ b/sources/SDL2Sharp/Colors/Argb2101010.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.ARGB2101010)] + [PackedColor(PackedPixelFormat.ARGB2101010)] public readonly record struct Argb2101010 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Argb4444.cs b/sources/SDL2Sharp/Colors/Argb4444.cs index 27d412a5..fe3f0f56 100644 --- a/sources/SDL2Sharp/Colors/Argb4444.cs +++ b/sources/SDL2Sharp/Colors/Argb4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.ARGB4444)] + [PackedColor(PackedPixelFormat.ARGB4444)] public readonly record struct Argb4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Argb8888.cs b/sources/SDL2Sharp/Colors/Argb8888.cs index b2848e89..bfcfd628 100644 --- a/sources/SDL2Sharp/Colors/Argb8888.cs +++ b/sources/SDL2Sharp/Colors/Argb8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.ARGB8888)] + [PackedColor(PackedPixelFormat.ARGB8888)] public readonly record struct Argb8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Bgr24.cs b/sources/SDL2Sharp/Colors/Bgr24.cs index a8513168..025fb1d9 100644 --- a/sources/SDL2Sharp/Colors/Bgr24.cs +++ b/sources/SDL2Sharp/Colors/Bgr24.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PackedColor(PixelFormatEnum.BGR24)] + [PackedColor(PackedPixelFormat.BGR24)] public readonly record struct Bgr24 { private readonly byte _r, _g, _b; diff --git a/sources/SDL2Sharp/Colors/Bgr565.cs b/sources/SDL2Sharp/Colors/Bgr565.cs index 34094998..d9fa46ad 100644 --- a/sources/SDL2Sharp/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Colors/Bgr565.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.BGR565)] + [PackedColor(PackedPixelFormat.BGR565)] public readonly record struct Bgr565 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Bgra4444.cs b/sources/SDL2Sharp/Colors/Bgra4444.cs index 376827b5..3b3a8cab 100644 --- a/sources/SDL2Sharp/Colors/Bgra4444.cs +++ b/sources/SDL2Sharp/Colors/Bgra4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.BGRA4444)] + [PackedColor(PackedPixelFormat.BGRA4444)] public readonly record struct Bgra4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Bgra5551.cs b/sources/SDL2Sharp/Colors/Bgra5551.cs index c178277d..05bf109e 100644 --- a/sources/SDL2Sharp/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Colors/Bgra5551.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.BGRA5551)] + [PackedColor(PackedPixelFormat.BGRA5551)] public readonly record struct Bgra5551 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Bgra8888.cs b/sources/SDL2Sharp/Colors/Bgra8888.cs index 0b412200..a88533e0 100644 --- a/sources/SDL2Sharp/Colors/Bgra8888.cs +++ b/sources/SDL2Sharp/Colors/Bgra8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.BGRA8888)] + [PackedColor(PackedPixelFormat.BGRA8888)] public readonly record struct Bgra8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Bgrx8888.cs b/sources/SDL2Sharp/Colors/Bgrx8888.cs index 3f186e04..92b207e8 100644 --- a/sources/SDL2Sharp/Colors/Bgrx8888.cs +++ b/sources/SDL2Sharp/Colors/Bgrx8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.BGRX8888)] + [PackedColor(PackedPixelFormat.BGRX8888)] public readonly record struct Bgrx8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Rgb24.cs b/sources/SDL2Sharp/Colors/Rgb24.cs index 2d7b12ba..70d6b21a 100644 --- a/sources/SDL2Sharp/Colors/Rgb24.cs +++ b/sources/SDL2Sharp/Colors/Rgb24.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PackedColor(PixelFormatEnum.RGB24)] + [PackedColor(PackedPixelFormat.RGB24)] public readonly record struct Rgb24 { private readonly byte _b, _g, _r; diff --git a/sources/SDL2Sharp/Colors/Rgb332.cs b/sources/SDL2Sharp/Colors/Rgb332.cs index c8b3f8fb..f26feece 100644 --- a/sources/SDL2Sharp/Colors/Rgb332.cs +++ b/sources/SDL2Sharp/Colors/Rgb332.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.RGB332)] + [PackedColor(PackedPixelFormat.RGB332)] public readonly record struct Rgb332 { private readonly byte _value; diff --git a/sources/SDL2Sharp/Colors/Rgb565.cs b/sources/SDL2Sharp/Colors/Rgb565.cs index fd9869f0..85a6d47f 100644 --- a/sources/SDL2Sharp/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Colors/Rgb565.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.RGB565)] + [PackedColor(PackedPixelFormat.RGB565)] public readonly record struct Rgb565 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Rgba4444.cs b/sources/SDL2Sharp/Colors/Rgba4444.cs index a8871981..ae90f705 100644 --- a/sources/SDL2Sharp/Colors/Rgba4444.cs +++ b/sources/SDL2Sharp/Colors/Rgba4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.RGBA4444)] + [PackedColor(PackedPixelFormat.RGBA4444)] public readonly record struct Rgba4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Rgba5551.cs b/sources/SDL2Sharp/Colors/Rgba5551.cs index 42c2bdb7..6ea25498 100644 --- a/sources/SDL2Sharp/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Colors/Rgba5551.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.RGBA5551)] + [PackedColor(PackedPixelFormat.RGBA5551)] public readonly record struct Rgba5551 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Rgba8888.cs b/sources/SDL2Sharp/Colors/Rgba8888.cs index 2cd96553..9e1f9add 100644 --- a/sources/SDL2Sharp/Colors/Rgba8888.cs +++ b/sources/SDL2Sharp/Colors/Rgba8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.RGBA8888)] + [PackedColor(PackedPixelFormat.RGBA8888)] public readonly record struct Rgba8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Rgbx8888.cs b/sources/SDL2Sharp/Colors/Rgbx8888.cs index b5e935a4..2e0abf23 100644 --- a/sources/SDL2Sharp/Colors/Rgbx8888.cs +++ b/sources/SDL2Sharp/Colors/Rgbx8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.RGBX8888)] + [PackedColor(PackedPixelFormat.RGBX8888)] public readonly record struct Rgbx8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Colors/Xbgr1555.cs index 14e98890..2c308345 100644 --- a/sources/SDL2Sharp/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Colors/Xbgr1555.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.XBGR1555)] + [PackedColor(PackedPixelFormat.XBGR1555)] public readonly record struct Xbgr1555 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Xbgr4444.cs b/sources/SDL2Sharp/Colors/Xbgr4444.cs index f71a5bd6..6c85753b 100644 --- a/sources/SDL2Sharp/Colors/Xbgr4444.cs +++ b/sources/SDL2Sharp/Colors/Xbgr4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.XBGR4444)] + [PackedColor(PackedPixelFormat.XBGR4444)] public readonly record struct Xbgr4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Xbgr8888.cs b/sources/SDL2Sharp/Colors/Xbgr8888.cs index 49e09f32..ae455037 100644 --- a/sources/SDL2Sharp/Colors/Xbgr8888.cs +++ b/sources/SDL2Sharp/Colors/Xbgr8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.XBGR8888)] + [PackedColor(PackedPixelFormat.XBGR8888)] public readonly record struct Xbgr8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Colors/Xrgb1555.cs index 6012c6f8..a021d49d 100644 --- a/sources/SDL2Sharp/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Colors/Xrgb1555.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PixelFormatEnum.XRGB1555)] + [PackedColor(PackedPixelFormat.XRGB1555)] public readonly record struct Xrgb1555 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Xrgb4444.cs b/sources/SDL2Sharp/Colors/Xrgb4444.cs index 43bdafbb..b6e6421c 100644 --- a/sources/SDL2Sharp/Colors/Xrgb4444.cs +++ b/sources/SDL2Sharp/Colors/Xrgb4444.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PixelFormatEnum.XRGB4444)] + [PackedColor(PackedPixelFormat.XRGB4444)] public readonly record struct Xrgb4444 { private readonly ushort _value; diff --git a/sources/SDL2Sharp/Colors/Xrgb8888.cs b/sources/SDL2Sharp/Colors/Xrgb8888.cs index ed6a9b7a..1417a338 100644 --- a/sources/SDL2Sharp/Colors/Xrgb8888.cs +++ b/sources/SDL2Sharp/Colors/Xrgb8888.cs @@ -19,12 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Runtime.InteropServices; -using SDL2Sharp.Internals; namespace SDL2Sharp.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PixelFormatEnum.XRGB8888)] + [PackedColor(PackedPixelFormat.XRGB8888)] public readonly record struct Xrgb8888 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Internals/PackedColorAttribute.cs b/sources/SDL2Sharp/PackedColorAttribute.cs similarity index 81% rename from sources/SDL2Sharp/Internals/PackedColorAttribute.cs rename to sources/SDL2Sharp/PackedColorAttribute.cs index ebb6de6d..ad79ec8e 100644 --- a/sources/SDL2Sharp/Internals/PackedColorAttribute.cs +++ b/sources/SDL2Sharp/PackedColorAttribute.cs @@ -21,25 +21,25 @@ using System; using System.Reflection; -namespace SDL2Sharp.Internals +namespace SDL2Sharp { [AttributeUsage(AttributeTargets.Struct)] internal sealed class PackedColorAttribute : Attribute { - public PixelFormatEnum PixelFormat { get; } + public PackedPixelFormat PixelFormat { get; } - public PackedColorAttribute(PixelFormatEnum pixelFormat) + public PackedColorAttribute(PackedPixelFormat pixelFormat) { PixelFormat = pixelFormat; } - public static PixelFormatEnum GetPixelFormatOf() + public static PackedPixelFormat GetPixelFormatOf() { var pixelFormatType = typeof(TPackedColor); var pixelFormatAttribute = pixelFormatType.GetCustomAttribute(); if (pixelFormatAttribute == null) { - return PixelFormatEnum.Unknown; + throw new NotSupportedException($"The type {pixelFormatType} does not have a {nameof(PackedColorAttribute)}."); } return pixelFormatAttribute.PixelFormat; } diff --git a/sources/SDL2Sharp/PackedPixelFormat.cs b/sources/SDL2Sharp/PackedPixelFormat.cs new file mode 100644 index 00000000..42fcc7e6 --- /dev/null +++ b/sources/SDL2Sharp/PackedPixelFormat.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp +{ + public enum PackedPixelFormat : uint + { + ABGR1555 = PixelFormatEnum.ABGR1555, + ABGR4444 = PixelFormatEnum.ABGR4444, + ABGR8888 = PixelFormatEnum.ABGR8888, + ARGB1555 = PixelFormatEnum.ARGB1555, + ARGB4444 = PixelFormatEnum.ARGB4444, + ARGB8888 = PixelFormatEnum.ARGB8888, + ARGB2101010 = PixelFormatEnum.ARGB2101010, + BGR24 = PixelFormatEnum.BGR24, + BGR565 = PixelFormatEnum.BGR565, + BGRA4444 = PixelFormatEnum.BGRA4444, + BGRA5551 = PixelFormatEnum.BGRA5551, + BGRA8888 = PixelFormatEnum.BGRA8888, + BGRX8888 = PixelFormatEnum.BGRX8888, + RGB24 = PixelFormatEnum.RGB24, + RGB332 = PixelFormatEnum.RGB332, + RGB565 = PixelFormatEnum.RGB565, + RGBA4444 = PixelFormatEnum.RGBA4444, + RGBA5551 = PixelFormatEnum.RGBA5551, + RGBA8888 = PixelFormatEnum.RGBA8888, + RGBX8888 = PixelFormatEnum.RGBX8888, + XBGR1555 = PixelFormatEnum.XBGR1555, + XBGR4444 = PixelFormatEnum.XBGR4444, + XBGR8888 = PixelFormatEnum.XBGR8888, + XRGB1555 = PixelFormatEnum.XRGB1555, + XRGB4444 = PixelFormatEnum.XRGB4444, + XRGB8888 = PixelFormatEnum.XRGB8888 + } +} diff --git a/sources/SDL2Sharp/Renderer.cs b/sources/SDL2Sharp/Renderer.cs index 065c12a5..f191dd1f 100644 --- a/sources/SDL2Sharp/Renderer.cs +++ b/sources/SDL2Sharp/Renderer.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Internals; using SDL2Sharp.Interop; namespace SDL2Sharp From 7bcb21ca25cec8caed1096cb87da2dd8caf72c03 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 19 Jun 2024 11:42:57 +0200 Subject: [PATCH 12/62] Texture class should be either abstract or sealed. --- sources/SDL2Sharp/PackedTexture.cs | 111 ++++++++++++++++++++++++++++- sources/SDL2Sharp/Renderer.cs | 51 +++++++++++++ sources/SDL2Sharp/Texture.cs | 4 +- 3 files changed, 161 insertions(+), 5 deletions(-) diff --git a/sources/SDL2Sharp/PackedTexture.cs b/sources/SDL2Sharp/PackedTexture.cs index 5f197231..a0e642d9 100644 --- a/sources/SDL2Sharp/PackedTexture.cs +++ b/sources/SDL2Sharp/PackedTexture.cs @@ -18,6 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Microsoft.Toolkit.HighPerformance; @@ -25,11 +26,97 @@ namespace SDL2Sharp { - public sealed unsafe class PackedTexture : Texture where TPackedColor : struct + public sealed unsafe class PackedTexture : IDisposable where TPackedColor : struct { + private SDL_Texture* _handle; + + public PackedPixelFormat Format + { + get + { + uint format; + Error.ThrowOnFailure(SDL.QueryTexture(_handle, &format, null, null, null)); + return (PackedPixelFormat)format; + } + } + + public TextureAccess Access + { + get + { + int access; + Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, &access, null, null)); + return (TextureAccess)access; + } + } + + public int Width + { + get + { + int width; + Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, &width, null)); + return width; + } + } + + public int Height + { + get + { + int height; + Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, null, &height)); + return height; + } + } + + public BlendMode BlendMode + { + get + { + SDL_BlendMode blendMode; + Error.ThrowOnFailure( + SDL.GetTextureBlendMode(_handle, &blendMode) + ); + return (BlendMode)blendMode; + } + set + { + Error.ThrowOnFailure( + SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) + ); + } + } + + public bool IsValid => 0 == SDL.QueryTexture(_handle, null, null, null, null); + internal PackedTexture(SDL_Texture* texture) - : base(texture) - { } + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + _handle = texture; + } + + ~PackedTexture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_handle is null) return; + SDL.DestroyTexture(_handle); + _handle = null; + } public void WithLock(WithLockPackedImageCallback callback) { @@ -126,5 +213,23 @@ private void Update(SDL_Rect* rect, void* pixels, int pitch) SDL.UpdateTexture(this, rect, pixels, pitch) ); } + + private void ThrowWhenDisposed() + { + if (_handle is null) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + + public static implicit operator SDL_Texture*(PackedTexture texture) + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + return texture._handle; + } } } diff --git a/sources/SDL2Sharp/Renderer.cs b/sources/SDL2Sharp/Renderer.cs index f191dd1f..9fbcffff 100644 --- a/sources/SDL2Sharp/Renderer.cs +++ b/sources/SDL2Sharp/Renderer.cs @@ -329,6 +329,57 @@ public void Copy(Texture texture, Rectangle source, Rectangle destination) ); } + public void Copy(PackedTexture texture) where TPackedColor : struct + { + ThrowWhenDisposed(); + + Error.ThrowOnFailure( + SDL.RenderCopy(_handle, texture, null, null) + ); + } + + public void Copy(PackedTexture texture, Rectangle destination) where TPackedColor : struct + { + ThrowWhenDisposed(); + + var dest = new SDL_Rect + { + x = destination.X, + y = destination.Y, + w = destination.Width, + h = destination.Height + }; + + Error.ThrowOnFailure( + SDL.RenderCopy(_handle, texture, null, &dest) + ); + } + + public void Copy(PackedTexture texture, Rectangle source, Rectangle destination) where TPackedColor : struct + { + ThrowWhenDisposed(); + + var src = new SDL_Rect + { + x = source.X, + y = source.Y, + w = source.Width, + h = source.Height + }; + + var dest = new SDL_Rect + { + x = destination.X, + y = destination.Y, + w = destination.Width, + h = destination.Height + }; + + Error.ThrowOnFailure( + SDL.RenderCopy(_handle, texture, &src, &dest) + ); + } + public void DrawLine(int x1, int y1, int x2, int y2) { ThrowWhenDisposed(); diff --git a/sources/SDL2Sharp/Texture.cs b/sources/SDL2Sharp/Texture.cs index 69d1293b..3b68c159 100644 --- a/sources/SDL2Sharp/Texture.cs +++ b/sources/SDL2Sharp/Texture.cs @@ -24,7 +24,7 @@ namespace SDL2Sharp { - public unsafe class Texture : IDisposable + public sealed unsafe class Texture : IDisposable { private SDL_Texture* _handle; @@ -174,7 +174,7 @@ public void WithLock(int x, int y, int width, int height, WithLock SDL.UnlockTexture(this); } - protected void ThrowWhenDisposed() + private void ThrowWhenDisposed() { if (_handle is null) { From b91d70edd7671577f653359dee14f677fc794fe9 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 19 Jun 2024 15:38:35 +0200 Subject: [PATCH 13/62] Use handle instead of implicit conversion operator. --- sources/SDL2Sharp/PackedTexture.cs | 10 +++++----- sources/SDL2Sharp/Texture.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/SDL2Sharp/PackedTexture.cs b/sources/SDL2Sharp/PackedTexture.cs index a0e642d9..e91f626a 100644 --- a/sources/SDL2Sharp/PackedTexture.cs +++ b/sources/SDL2Sharp/PackedTexture.cs @@ -136,14 +136,14 @@ public void WithLock(int x, int y, int width, int height, WithLockPackedImageCal void* pixels; int pitchInBytes; Error.ThrowOnFailure( - SDL.LockTexture(this, &rect, &pixels, &pitchInBytes) + SDL.LockTexture(_handle, &rect, &pixels, &pitchInBytes) ); var bytesPerPixel = Marshal.SizeOf(); var pitch = pitchInBytes / bytesPerPixel; var image = new PackedImage(pixels, height, width, pitch); callback(image); - SDL.UnlockTexture(this); + SDL.UnlockTexture(_handle); } public void WithLock(WithLockSurfaceCallback callback) @@ -163,11 +163,11 @@ public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallbac var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; Error.ThrowOnFailure( - SDL.LockTextureToSurface(this, &rect, &surfaceHandle) + SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) ); var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); - SDL.UnlockTexture(this); + SDL.UnlockTexture(_handle); } public void Update(PackedMemoryImage image) @@ -210,7 +210,7 @@ public void Update(TPackedColor[,] pixels) private void Update(SDL_Rect* rect, void* pixels, int pitch) { Error.ThrowOnFailure( - SDL.UpdateTexture(this, rect, pixels, pitch) + SDL.UpdateTexture(_handle, rect, pixels, pitch) ); } diff --git a/sources/SDL2Sharp/Texture.cs b/sources/SDL2Sharp/Texture.cs index 3b68c159..27d3be6e 100644 --- a/sources/SDL2Sharp/Texture.cs +++ b/sources/SDL2Sharp/Texture.cs @@ -144,7 +144,7 @@ public void WithLock(int x, int y, int width, int height, WithLock var pitch = pitchInBytes / bytesPerPixel; var image = new PackedImage(pixels, height, width, pitch); callback.Invoke(image); - SDL.UnlockTexture(this); + SDL.UnlockTexture(_handle); } public void WithLock(WithLockSurfaceCallback callback) @@ -171,7 +171,7 @@ public void WithLock(int x, int y, int width, int height, WithLock ); var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); - SDL.UnlockTexture(this); + SDL.UnlockTexture(_handle); } private void ThrowWhenDisposed() From aafec8784f97a15ec3bc2b4b55026d7e86481474 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 20 Jun 2024 10:34:24 +0200 Subject: [PATCH 14/62] Make generic Surface and Texture classes wrap untyped equivalents. --- sources/SDL2Sharp/Font.cs | 6 +- sources/SDL2Sharp/PackedTexture.cs | 108 +++++------------------- sources/SDL2Sharp/Renderer.cs | 77 ----------------- sources/SDL2Sharp/RendererExtensions.cs | 37 ++++++++ sources/SDL2Sharp/Surface.cs | 6 +- sources/SDL2Sharp/Surface{T}.cs | 101 +++++++--------------- 6 files changed, 93 insertions(+), 242 deletions(-) diff --git a/sources/SDL2Sharp/Font.cs b/sources/SDL2Sharp/Font.cs index 89a01f3c..95b04e7e 100644 --- a/sources/SDL2Sharp/Font.cs +++ b/sources/SDL2Sharp/Font.cs @@ -59,14 +59,16 @@ public Surface RenderSolid(string text, Color color) { ThrowWhenDisposed(); using var marshaledText = new MarshaledString(text); - return new Surface(TTF.RenderText_Solid(_handle, marshaledText, color)); + var surfaceHandle = TTF.RenderText_Solid(_handle, marshaledText, color); + return new Surface(surfaceHandle); } public Surface RenderBlended(string text, Color color) { ThrowWhenDisposed(); using var marshaledText = new MarshaledString(text); - return new Surface(TTF.RenderText_Blended(_handle, marshaledText, color)); + var surfaceHandle = TTF.RenderText_Blended(_handle, marshaledText, color); + return new Surface(surfaceHandle); } public static implicit operator _TTF_Font*(Font font) diff --git a/sources/SDL2Sharp/PackedTexture.cs b/sources/SDL2Sharp/PackedTexture.cs index e91f626a..b2f3b8a5 100644 --- a/sources/SDL2Sharp/PackedTexture.cs +++ b/sources/SDL2Sharp/PackedTexture.cs @@ -28,76 +28,28 @@ namespace SDL2Sharp { public sealed unsafe class PackedTexture : IDisposable where TPackedColor : struct { - private SDL_Texture* _handle; + private Texture _texture; - public PackedPixelFormat Format - { - get - { - uint format; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, &format, null, null, null)); - return (PackedPixelFormat)format; - } - } + public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; - public TextureAccess Access - { - get - { - int access; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, &access, null, null)); - return (TextureAccess)access; - } - } + public TextureAccess Access => _texture.Access; - public int Width - { - get - { - int width; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, &width, null)); - return width; - } - } + public int Width => _texture.Width; - public int Height - { - get - { - int height; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, null, &height)); - return height; - } - } + public int Height => _texture.Height; public BlendMode BlendMode { - get - { - SDL_BlendMode blendMode; - Error.ThrowOnFailure( - SDL.GetTextureBlendMode(_handle, &blendMode) - ); - return (BlendMode)blendMode; - } - set - { - Error.ThrowOnFailure( - SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) - ); - } + get => _texture.BlendMode; + + set => _texture.BlendMode = value; } - public bool IsValid => 0 == SDL.QueryTexture(_handle, null, null, null, null); + public bool IsValid => _texture.IsValid; - internal PackedTexture(SDL_Texture* texture) + internal PackedTexture(Texture texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } - - _handle = texture; + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } ~PackedTexture() @@ -113,9 +65,9 @@ public void Dispose() private void Dispose(bool _) { - if (_handle is null) return; - SDL.DestroyTexture(_handle); - _handle = null; + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; } public void WithLock(WithLockPackedImageCallback callback) @@ -130,20 +82,7 @@ public void WithLock(Rectangle rectangle, WithLockPackedImageCallback callback) { - ThrowWhenDisposed(); - - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - void* pixels; - int pitchInBytes; - Error.ThrowOnFailure( - SDL.LockTexture(_handle, &rect, &pixels, &pitchInBytes) - ); - - var bytesPerPixel = Marshal.SizeOf(); - var pitch = pitchInBytes / bytesPerPixel; - var image = new PackedImage(pixels, height, width, pitch); - callback(image); - SDL.UnlockTexture(_handle); + _texture.WithLock(x, y, width, height, callback); } public void WithLock(WithLockSurfaceCallback callback) @@ -160,14 +99,7 @@ public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallbac { ThrowWhenDisposed(); - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - SDL_Surface* surfaceHandle; - Error.ThrowOnFailure( - SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) - ); - var surface = new Surface(surfaceHandle, false); - callback.Invoke(surface); - SDL.UnlockTexture(_handle); + _texture.WithLock(x, y, width, height, callback); } public void Update(PackedMemoryImage image) @@ -210,26 +142,26 @@ public void Update(TPackedColor[,] pixels) private void Update(SDL_Rect* rect, void* pixels, int pitch) { Error.ThrowOnFailure( - SDL.UpdateTexture(_handle, rect, pixels, pitch) + SDL.UpdateTexture(_texture, rect, pixels, pitch) ); } private void ThrowWhenDisposed() { - if (_handle is null) + if (_texture is null) { throw new ObjectDisposedException(GetType().FullName); } } - public static implicit operator SDL_Texture*(PackedTexture texture) + public static implicit operator Texture(PackedTexture texture) { if (texture is null) { throw new ArgumentNullException(nameof(texture)); } - return texture._handle; + return texture._texture; } } } diff --git a/sources/SDL2Sharp/Renderer.cs b/sources/SDL2Sharp/Renderer.cs index 9fbcffff..39b49b2a 100644 --- a/sources/SDL2Sharp/Renderer.cs +++ b/sources/SDL2Sharp/Renderer.cs @@ -234,22 +234,6 @@ public Texture CreateTexture(PixelFormatEnum pixelFormat, TextureAccess access, return new Texture(texture); } - - public PackedTexture CreateTexture(TextureAccess access, Size size) where TPackedColor : struct - { - return CreateTexture(access, size.Width, size.Height); - } - - public PackedTexture CreateTexture(TextureAccess access, int width, int height) where TPackedColor : struct - { - ThrowWhenDisposed(); - - var pixelFormat = PackedColorAttribute.GetPixelFormatOf(); - var texture = SDL.CreateTexture(_handle, (uint)pixelFormat, (int)access, width, height); - Error.ThrowOnFailure(texture); - return new PackedTexture(texture); - } - public Texture CreateTextureFromSurface(Surface surface) { ThrowWhenDisposed(); @@ -259,16 +243,6 @@ public Texture CreateTextureFromSurface(Surface surface) return new Texture(texture); } - - public PackedTexture CreateTextureFromSurface(Surface surface) where TPackedColor : struct - { - ThrowWhenDisposed(); - - var texture = SDL.CreateTextureFromSurface(_handle, surface); - Error.ThrowOnFailure(texture); - return new PackedTexture(texture); - } - public void Clear() { ThrowWhenDisposed(); @@ -329,57 +303,6 @@ public void Copy(Texture texture, Rectangle source, Rectangle destination) ); } - public void Copy(PackedTexture texture) where TPackedColor : struct - { - ThrowWhenDisposed(); - - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, null, null) - ); - } - - public void Copy(PackedTexture texture, Rectangle destination) where TPackedColor : struct - { - ThrowWhenDisposed(); - - var dest = new SDL_Rect - { - x = destination.X, - y = destination.Y, - w = destination.Width, - h = destination.Height - }; - - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, null, &dest) - ); - } - - public void Copy(PackedTexture texture, Rectangle source, Rectangle destination) where TPackedColor : struct - { - ThrowWhenDisposed(); - - var src = new SDL_Rect - { - x = source.X, - y = source.Y, - w = source.Width, - h = source.Height - }; - - var dest = new SDL_Rect - { - x = destination.X, - y = destination.Y, - w = destination.Width, - h = destination.Height - }; - - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, &src, &dest) - ); - } - public void DrawLine(int x1, int y1, int x2, int y2) { ThrowWhenDisposed(); diff --git a/sources/SDL2Sharp/RendererExtensions.cs b/sources/SDL2Sharp/RendererExtensions.cs index 50d57eb9..a70ef449 100644 --- a/sources/SDL2Sharp/RendererExtensions.cs +++ b/sources/SDL2Sharp/RendererExtensions.cs @@ -24,6 +24,43 @@ namespace SDL2Sharp { public static class RendererExtensions { + public static PackedTexture CreateTexture(this Renderer renderer, TextureAccess access, Size size) + where TPackedColor : struct + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + return renderer.CreateTexture(access, size.Width, size.Height); + } + + public static PackedTexture CreateTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TPackedColor : struct + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + var pixelFormat = PackedColorAttribute.GetPixelFormatOf(); + var texture = renderer.CreateTexture((PixelFormatEnum)pixelFormat, access, width, height); + return new PackedTexture(texture); + } + + public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) + where TPackedColor : struct + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + var texture = renderer.CreateTextureFromSurface(surface); + var packedTexture = new PackedTexture(texture); + return packedTexture; + } + public static Texture CreateTextureFromBitmap(this Renderer renderer, string filename) { if (renderer is null) diff --git a/sources/SDL2Sharp/Surface.cs b/sources/SDL2Sharp/Surface.cs index edb33446..79de6f2d 100644 --- a/sources/SDL2Sharp/Surface.cs +++ b/sources/SDL2Sharp/Surface.cs @@ -60,11 +60,11 @@ public static Surface LoadBitmap(string filename) return new Surface(bitmap); } - public Surface(SDL_Surface* handle) + internal Surface(SDL_Surface* handle) : this(handle, true) { } - public Surface(SDL_Surface* handle, bool freeHandle) + internal Surface(SDL_Surface* handle, bool freeHandle) { if (handle is null) { @@ -131,7 +131,7 @@ public void Blit(Surface surface) ); } - public Surface Convert(PixelFormatEnum format) + public Surface ConvertTo(PixelFormatEnum format) { ThrowWhenDisposed(); diff --git a/sources/SDL2Sharp/Surface{T}.cs b/sources/SDL2Sharp/Surface{T}.cs index ad4e6d02..23b3c1a6 100644 --- a/sources/SDL2Sharp/Surface{T}.cs +++ b/sources/SDL2Sharp/Surface{T}.cs @@ -19,70 +19,39 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using Microsoft.Toolkit.HighPerformance; using SDL2Sharp.Interop; namespace SDL2Sharp { - public sealed unsafe class Surface : IDisposable where TPackedColor : struct + public sealed class Surface : IDisposable where TPackedColor : struct { - private SDL_Surface* _handle; + private Surface _surface; - private readonly bool _freeHandle; + public PixelFormat Format => _surface.Format; - public PixelFormat Format => new(_handle->format, false); + public int Width => _surface.Width; - public int Width => _handle->w; + public int Height => _surface.Height; - public int Height => _handle->h; + public int Pitch => _surface.Pitch; - public int Pitch => _handle->pitch; + public PackedImage Pixels => _surface.Pixels(); - public Span2D Pixels - { - get - { - // In SDL pitch is synonymous to stride, and is defined as the - // length of a row of pixels in bytes. Span2D, however, defines - // pitch as the difference between stride and width in pixels. - return new Span2D(_handle->pixels, _handle->h, _handle->w, - _handle->pitch - _handle->w * _handle->format->BytesPerPixel); - } - } + public bool MustLock => _surface.MustLock; - public bool MustLock => ((_handle->flags & SDL.SDL_RLEACCEL) != 0); + internal unsafe Surface(SDL_Surface* surface) + : this(new Surface(surface)) + { } - internal Surface(SDL_Surface* handle) - : this(handle, true) + internal unsafe Surface(SDL_Surface* surface, bool freeHandle) + : this(new Surface(surface, freeHandle)) { } - internal Surface(SDL_Surface* handle, bool freeHandle) + internal Surface(Surface surface) { - if (handle is null) - { - throw new ArgumentNullException(nameof(handle)); - } - - _handle = handle; - _freeHandle = freeHandle; + _surface = surface ?? throw new ArgumentNullException(nameof(surface)); } - internal Surface(int width, int height, int depth, PixelFormatEnum format) - : this(SDL.CreateRGBSurfaceWithFormat(0, width, height, depth, (uint)format)) - { } - - internal Surface(int width, int height, int depth, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(SDL.CreateRGBSurface(0, width, height, depth, redMask, greenMask, blueMask, alphaMask)) - { } - - internal Surface(void* pixels, int width, int height, int depth, int pitch, PixelFormatEnum format) - : this(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, depth, pitch, (uint)format)) - { } - - internal Surface(void* pixels, int width, int height, int depth, int pitch, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(SDL.CreateRGBSurfaceFrom(pixels, width, height, depth, pitch, redMask, greenMask, blueMask, alphaMask)) - { } - ~Surface() { Dispose(false); @@ -96,17 +65,9 @@ public void Dispose() private void Dispose(bool _) { - if (_handle is null) - { - return; - } - - if (_freeHandle) - { - SDL.FreeSurface(_handle); - } - - _handle = null; + if (_surface is null) return; + _surface.Dispose(); + _surface = null!; } public void Blit(Surface surface) @@ -118,59 +79,55 @@ public void Blit(Surface surface) throw new ArgumentNullException(nameof(surface)); } - Error.ThrowOnFailure( - SDL.Blit(_handle, null, surface._handle, null) - ); + _surface.Blit(surface._surface); } - public Surface Convert(PixelFormatEnum format) + public Surface Convert() where TTargetColor : struct { ThrowWhenDisposed(); - return new Surface(SDL.ConvertSurfaceFormat(_handle, (uint)format, 0)); + var targetPixelFormat = PackedColorAttribute.GetPixelFormatOf(); + var targetSurface = _surface.ConvertTo((PixelFormatEnum)targetPixelFormat); + return new Surface(targetSurface); } public void FillRect(uint color) { ThrowWhenDisposed(); - Error.ThrowOnFailure( - SDL.FillRect(_handle, null, color) - ); + _surface.FillRect(color); } public void Lock() { ThrowWhenDisposed(); - Error.ThrowOnFailure( - SDL.LockSurface(_handle) - ); + _surface.Lock(); } public void Unlock() { ThrowWhenDisposed(); - SDL.UnlockSurface(_handle); + _surface.Unlock(); } private void ThrowWhenDisposed() { - if (_handle is null) + if (_surface is null) { throw new ObjectDisposedException(GetType().FullName); } } - public static implicit operator SDL_Surface*(Surface surface) + public static implicit operator Surface(Surface surface) { if (surface is null) { throw new ArgumentNullException(nameof(surface)); } - return surface._handle; + return surface._surface; } } } From c9aaa8149d7aebbeae46c08bc28a30edbed66d1f Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 20 Jun 2024 10:39:38 +0200 Subject: [PATCH 15/62] Fix absolute size of 2-byte colors. --- sources/SDL2Sharp/Colors/Abgr1555.cs | 2 +- sources/SDL2Sharp/Colors/Argb1555.cs | 2 +- sources/SDL2Sharp/Colors/Bgr565.cs | 2 +- sources/SDL2Sharp/Colors/Bgra5551.cs | 2 +- sources/SDL2Sharp/Colors/Rgb565.cs | 2 +- sources/SDL2Sharp/Colors/Rgba5551.cs | 2 +- sources/SDL2Sharp/Colors/Xbgr1555.cs | 2 +- sources/SDL2Sharp/Colors/Xrgb1555.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/SDL2Sharp/Colors/Abgr1555.cs b/sources/SDL2Sharp/Colors/Abgr1555.cs index 744ec096..7ef97ca5 100644 --- a/sources/SDL2Sharp/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Colors/Abgr1555.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ABGR1555)] public readonly record struct Abgr1555 { diff --git a/sources/SDL2Sharp/Colors/Argb1555.cs b/sources/SDL2Sharp/Colors/Argb1555.cs index 0c70069f..58399135 100644 --- a/sources/SDL2Sharp/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Colors/Argb1555.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ARGB1555)] public readonly record struct Argb1555 { diff --git a/sources/SDL2Sharp/Colors/Bgr565.cs b/sources/SDL2Sharp/Colors/Bgr565.cs index d9fa46ad..775e5485 100644 --- a/sources/SDL2Sharp/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Colors/Bgr565.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.BGR565)] public readonly record struct Bgr565 { diff --git a/sources/SDL2Sharp/Colors/Bgra5551.cs b/sources/SDL2Sharp/Colors/Bgra5551.cs index 05bf109e..7eaecbda 100644 --- a/sources/SDL2Sharp/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Colors/Bgra5551.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.BGRA5551)] public readonly record struct Bgra5551 { diff --git a/sources/SDL2Sharp/Colors/Rgb565.cs b/sources/SDL2Sharp/Colors/Rgb565.cs index 85a6d47f..f073c179 100644 --- a/sources/SDL2Sharp/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Colors/Rgb565.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.RGB565)] public readonly record struct Rgb565 { diff --git a/sources/SDL2Sharp/Colors/Rgba5551.cs b/sources/SDL2Sharp/Colors/Rgba5551.cs index 6ea25498..7c1ce41f 100644 --- a/sources/SDL2Sharp/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Colors/Rgba5551.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.RGBA5551)] public readonly record struct Rgba5551 { diff --git a/sources/SDL2Sharp/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Colors/Xbgr1555.cs index 2c308345..32853d79 100644 --- a/sources/SDL2Sharp/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Colors/Xbgr1555.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XBGR1555)] public readonly record struct Xbgr1555 { diff --git a/sources/SDL2Sharp/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Colors/Xrgb1555.cs index a021d49d..a1e57e83 100644 --- a/sources/SDL2Sharp/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Colors/Xrgb1555.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XRGB1555)] public readonly record struct Xrgb1555 { From e6ed768023a5adba48f66ea14d25b1a0300669d1 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 20 Jun 2024 11:54:34 +0200 Subject: [PATCH 16/62] Add support for packed color formats YUY2, UYVY, and YVYU. --- sources/SDL2Sharp/Colors/Uyvy.cs | 47 ++++++++++++++++ sources/SDL2Sharp/Colors/Yuy2.cs | 47 ++++++++++++++++ sources/SDL2Sharp/Colors/Yvyu.cs | 47 ++++++++++++++++ sources/SDL2Sharp/PackedPixelFormat.cs | 5 +- sources/SDL2Sharp/Surface.cs | 56 ++++++++++--------- sources/SDL2Sharp/Surface{T}.cs | 19 ++----- .../SDL2Sharp/WithLockPackedImageCallback.cs | 2 +- sources/SDL2Sharp/WithLockSurfaceCallback.cs | 2 +- .../SDL2Sharp.UnitTests/PackedTextureTests.cs | 51 +++++++++++++---- tests/SDL2Sharp.UnitTests/SurfaceTests.cs | 54 ++++++++++++++++++ 10 files changed, 274 insertions(+), 56 deletions(-) create mode 100644 sources/SDL2Sharp/Colors/Uyvy.cs create mode 100644 sources/SDL2Sharp/Colors/Yuy2.cs create mode 100644 sources/SDL2Sharp/Colors/Yvyu.cs create mode 100644 tests/SDL2Sharp.UnitTests/SurfaceTests.cs diff --git a/sources/SDL2Sharp/Colors/Uyvy.cs b/sources/SDL2Sharp/Colors/Uyvy.cs new file mode 100644 index 00000000..83e2b19f --- /dev/null +++ b/sources/SDL2Sharp/Colors/Uyvy.cs @@ -0,0 +1,47 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Colors +{ + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] + [PackedColor(PackedPixelFormat.UYVY)] + public readonly record struct Uyvy + { + private readonly uint _value; + + public byte U0 => (byte)(_value >> 24 & 0xFF); + + public byte Y0 => (byte)(_value >> 16 & 0xFF); + + public byte V0 => (byte)(_value >> 8 & 0xFF); + + public byte Y1 => (byte)(_value & 0xFF); + + public Uyvy(byte u0, byte y0, byte v0, byte y1) + { + unchecked + { + _value = (uint)(u0 << 24 | y0 << 16 | v0 << 8 | y1); + } + } + } +} diff --git a/sources/SDL2Sharp/Colors/Yuy2.cs b/sources/SDL2Sharp/Colors/Yuy2.cs new file mode 100644 index 00000000..4fdc3d6f --- /dev/null +++ b/sources/SDL2Sharp/Colors/Yuy2.cs @@ -0,0 +1,47 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Colors +{ + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] + [PackedColor(PackedPixelFormat.YUY2)] + public readonly record struct Yuy2 + { + private readonly uint _value; + + public byte Y0 => (byte)(_value >> 24 & 0xFF); + + public byte U0 => (byte)(_value >> 16 & 0xFF); + + public byte Y1 => (byte)(_value >> 8 & 0xFF); + + public byte V0 => (byte)(_value & 0xFF); + + public Yuy2(byte y0, byte u0, byte y1, byte v0) + { + unchecked + { + _value = (uint)(y0 << 24 | u0 << 16 | y1 << 8 | v0); + } + } + } +} diff --git a/sources/SDL2Sharp/Colors/Yvyu.cs b/sources/SDL2Sharp/Colors/Yvyu.cs new file mode 100644 index 00000000..d99d05e2 --- /dev/null +++ b/sources/SDL2Sharp/Colors/Yvyu.cs @@ -0,0 +1,47 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Colors +{ + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] + [PackedColor(PackedPixelFormat.YVYU)] + public readonly record struct Yvyu + { + private readonly uint _value; + + public byte Y0 => (byte)(_value >> 24 & 0xFF); + + public byte V0 => (byte)(_value >> 16 & 0xFF); + + public byte Y1 => (byte)(_value >> 8 & 0xFF); + + public byte U0 => (byte)(_value & 0xFF); + + public Yvyu(byte y0, byte v0, byte y1, byte u0) + { + unchecked + { + _value = (uint)(y0 << 24 | v0 << 16 | y1 << 8 | u0); + } + } + } +} diff --git a/sources/SDL2Sharp/PackedPixelFormat.cs b/sources/SDL2Sharp/PackedPixelFormat.cs index 42fcc7e6..050f5334 100644 --- a/sources/SDL2Sharp/PackedPixelFormat.cs +++ b/sources/SDL2Sharp/PackedPixelFormat.cs @@ -47,6 +47,9 @@ public enum PackedPixelFormat : uint XBGR8888 = PixelFormatEnum.XBGR8888, XRGB1555 = PixelFormatEnum.XRGB1555, XRGB4444 = PixelFormatEnum.XRGB4444, - XRGB8888 = PixelFormatEnum.XRGB8888 + XRGB8888 = PixelFormatEnum.XRGB8888, + YUY2 = PixelFormatEnum.YUY2, + UYVY = PixelFormatEnum.UYVY, + YVYU = PixelFormatEnum.YVYU, } } diff --git a/sources/SDL2Sharp/Surface.cs b/sources/SDL2Sharp/Surface.cs index 79de6f2d..df28ba4a 100644 --- a/sources/SDL2Sharp/Surface.cs +++ b/sources/SDL2Sharp/Surface.cs @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.InteropServices; using SDL2Sharp.Internals; using SDL2Sharp.Interop; @@ -38,16 +39,7 @@ public sealed unsafe class Surface : IDisposable public int Pitch => _handle->pitch; - public PackedImage Pixels() - { - return new PackedImage( - _handle->pixels, - _handle->h, - _handle->w, - _handle->pitch); - } - - public bool MustLock => ((_handle->flags & SDL.SDL_RLEACCEL) != 0); + private bool MustLock => (_handle->flags & SDL.SDL_RLEACCEL) != 0; public static Surface LoadBitmap(string filename) { @@ -75,20 +67,20 @@ internal Surface(SDL_Surface* handle, bool freeHandle) _freeHandle = freeHandle; } - public Surface(int width, int height, int depth, PixelFormatEnum format) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormat(0, width, height, depth, (uint)format))) + public Surface(int width, int height, PixelFormatEnum format) + : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) { } - public Surface(int width, int height, int depth, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurface(0, width, height, depth, redMask, greenMask, blueMask, alphaMask))) + public Surface(int width, int height, uint redMask, uint greenMask, uint blueMask, uint alphaMask) + : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) { } - public Surface(void* pixels, int width, int height, int depth, int pitch, PixelFormatEnum format) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, depth, pitch, (uint)format))) + public Surface(void* pixels, int width, int height, int pitch, PixelFormatEnum format) + : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) { } - public Surface(void* pixels, int width, int height, int depth, int pitch, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceFrom(pixels, width, height, depth, pitch, redMask, greenMask, blueMask, alphaMask))) + public Surface(void* pixels, int width, int height, int pitch, uint redMask, uint greenMask, uint blueMask, uint alphaMask) + : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) { } ~Surface() @@ -147,20 +139,30 @@ public void FillRect(uint color) ); } - public void Lock() + public void WithLock(WithLockPackedImageCallback callback) + where TPackedColor : struct { ThrowWhenDisposed(); - Error.ThrowOnFailure( - SDL.LockSurface(_handle) - ); - } + var mustLock = MustLock; + if (mustLock) + { + Error.ThrowOnFailure( + SDL.LockSurface(_handle) + ); + } - public void Unlock() - { - ThrowWhenDisposed(); + var bytesPerPixel = Marshal.SizeOf(); + var pitchInBytes = _handle->pitch; + var pitch = pitchInBytes / bytesPerPixel; + var pixels = new PackedImage(_handle->pixels, _handle->w, _handle->h, pitch); - SDL.UnlockSurface(_handle); + callback.Invoke(pixels); + + if (mustLock) + { + SDL.UnlockSurface(_handle); + } } private void ThrowWhenDisposed() diff --git a/sources/SDL2Sharp/Surface{T}.cs b/sources/SDL2Sharp/Surface{T}.cs index 23b3c1a6..ec7fa826 100644 --- a/sources/SDL2Sharp/Surface{T}.cs +++ b/sources/SDL2Sharp/Surface{T}.cs @@ -35,9 +35,9 @@ public sealed class Surface : IDisposable where TPackedColor : str public int Pitch => _surface.Pitch; - public PackedImage Pixels => _surface.Pixels(); - - public bool MustLock => _surface.MustLock; + public Surface(int width, int height) + : this(new Surface(width, height, (PixelFormatEnum)PackedColorAttribute.GetPixelFormatOf())) + { } internal unsafe Surface(SDL_Surface* surface) : this(new Surface(surface)) @@ -98,18 +98,9 @@ public void FillRect(uint color) _surface.FillRect(color); } - public void Lock() + public void WithLock(WithLockPackedImageCallback callback) { - ThrowWhenDisposed(); - - _surface.Lock(); - } - - public void Unlock() - { - ThrowWhenDisposed(); - - _surface.Unlock(); + _surface.WithLock(callback); } private void ThrowWhenDisposed() diff --git a/sources/SDL2Sharp/WithLockPackedImageCallback.cs b/sources/SDL2Sharp/WithLockPackedImageCallback.cs index b011369a..51fff197 100644 --- a/sources/SDL2Sharp/WithLockPackedImageCallback.cs +++ b/sources/SDL2Sharp/WithLockPackedImageCallback.cs @@ -20,6 +20,6 @@ namespace SDL2Sharp { - public delegate void WithLockPackedImageCallback(PackedImage image) + public delegate void WithLockPackedImageCallback(PackedImage pixels) where TPackedColor : struct; } diff --git a/sources/SDL2Sharp/WithLockSurfaceCallback.cs b/sources/SDL2Sharp/WithLockSurfaceCallback.cs index 9a5a0fab..c6b6c6d0 100644 --- a/sources/SDL2Sharp/WithLockSurfaceCallback.cs +++ b/sources/SDL2Sharp/WithLockSurfaceCallback.cs @@ -20,6 +20,6 @@ namespace SDL2Sharp { - public delegate void WithLockSurfaceCallback(Surface image) + public delegate void WithLockSurfaceCallback(Surface pixels) where TPackedColor : struct; } diff --git a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs b/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs index e2878fab..ada0d1f6 100644 --- a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs @@ -28,20 +28,47 @@ public static class PackedTextureTests [Fact] public static void CreatePackedTextureOfArgb8888() { - using var window = new Window("TextureTests", 640, 480, WindowFlags.Hidden); + var color = new Argb8888(255, 255, 255, 255); + using var window = new Window("CreatePackedTextureOfArgb8888", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); - var white = new Argb8888(255, 255, 255, 255); - texture.WithLock(image => - { - for (var y = 0; y < image.Height; ++y) - { - for (var x = 0; x < image.Width; ++x) - { - image[y, x] = white; - } - } - }); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreatePackedTextureOfYUY2() + { + var color = new Yuy2(255, 255, 255, 255); + using var window = new Window("CreatePackedTextureOfYUY2", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreatePackedTextureOfYVYU() + { + var color = new Yvyu(255, 255, 255, 255); + using var window = new Window("CreatePackedTextureOfYVYU", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreatePackedTextureOfUYVY() + { + var color = new Uyvy(255, 255, 255, 255); + using var window = new Window("CreatePackedTextureOfUYVY", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); renderer.Copy(texture); renderer.Present(); } diff --git a/tests/SDL2Sharp.UnitTests/SurfaceTests.cs b/tests/SDL2Sharp.UnitTests/SurfaceTests.cs new file mode 100644 index 00000000..5f451561 --- /dev/null +++ b/tests/SDL2Sharp.UnitTests/SurfaceTests.cs @@ -0,0 +1,54 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Colors; +using Xunit; + +namespace SDL2Sharp.UnitTests +{ + public static class SurfaceTests + { + [Fact] + public static void CreateSurfaceOfArgb8888() + { + var color = new Argb8888(255, 255, 255, 255); + using var surface = new Surface(512, 512); + surface.WithLock(pixels => pixels.Fill(color)); + } + + [Fact] + public static void CreateSurfaceOfYuy2() + { + Assert.Throws(() => new Surface(512, 512)); + } + + [Fact] + public static void CreateSurfaceOfYvyu() + { + Assert.Throws(() => new Surface(512, 512)); + } + + [Fact] + public static void CreateSurfaceOfUyvy() + { + Assert.Throws(() => new Surface(512, 512)); + } + } +} From 1b9f52041968556a6612c2d1ecf270151b4580d5 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 20 Jun 2024 13:24:03 +0200 Subject: [PATCH 17/62] Add missing target frameworks. --- samples/ParticleSystem/ParticleSystem.csproj | 2 +- samples/PlasmaFractal/PlasmaFractal.csproj | 2 +- samples/RayTracer/RayTracer.csproj | 2 +- samples/SwirlStars/SwirlStars.csproj | 2 +- samples/TunnelEffect/TunnelEffect.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/ParticleSystem/ParticleSystem.csproj b/samples/ParticleSystem/ParticleSystem.csproj index fb3b4bd5..441e3869 100644 --- a/samples/ParticleSystem/ParticleSystem.csproj +++ b/samples/ParticleSystem/ParticleSystem.csproj @@ -2,7 +2,7 @@ WinExe - net6.0 + net8.0;net7.0;net6.0 AnyCPU false diff --git a/samples/PlasmaFractal/PlasmaFractal.csproj b/samples/PlasmaFractal/PlasmaFractal.csproj index fb3b4bd5..441e3869 100644 --- a/samples/PlasmaFractal/PlasmaFractal.csproj +++ b/samples/PlasmaFractal/PlasmaFractal.csproj @@ -2,7 +2,7 @@ WinExe - net6.0 + net8.0;net7.0;net6.0 AnyCPU false diff --git a/samples/RayTracer/RayTracer.csproj b/samples/RayTracer/RayTracer.csproj index 421be704..90cfdefd 100644 --- a/samples/RayTracer/RayTracer.csproj +++ b/samples/RayTracer/RayTracer.csproj @@ -2,7 +2,7 @@ WinExe - net6.0 + net8.0;net7.0;net6.0 AnyCPU false diff --git a/samples/SwirlStars/SwirlStars.csproj b/samples/SwirlStars/SwirlStars.csproj index 421be704..90cfdefd 100644 --- a/samples/SwirlStars/SwirlStars.csproj +++ b/samples/SwirlStars/SwirlStars.csproj @@ -2,7 +2,7 @@ WinExe - net6.0 + net8.0;net7.0;net6.0 AnyCPU false diff --git a/samples/TunnelEffect/TunnelEffect.csproj b/samples/TunnelEffect/TunnelEffect.csproj index 464cbb7b..964bbd2a 100644 --- a/samples/TunnelEffect/TunnelEffect.csproj +++ b/samples/TunnelEffect/TunnelEffect.csproj @@ -2,7 +2,7 @@ WinExe - net6.0 + net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 AnyCPU false From 9e3ac8a2adbd259c2e98339690f87b81b6125ae2 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 20 Jun 2024 13:26:15 +0200 Subject: [PATCH 18/62] Allow the configuration and framework to be choosen when launching a sample. --- .vscode/launch.json | 77 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5d148b5b..406c408d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,9 +18,9 @@ "name": "Launch AverageFrameRate", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/AverageFrameRate/Debug/net6.0/AverageFrameRate", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/AverageFrameRate/${input:Configuration}/${input:CoreClrFramework}/AverageFrameRate", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/AverageFrameRate/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/AverageFrameRate/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -28,9 +28,9 @@ "name": "Launch BitmapViewer", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/Debug/net6.0/BitmapViewer", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/${input:Configuration}/${input:CoreClrFramework}/BitmapViewer", "args": ["Sample.bmp"], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -38,9 +38,9 @@ "name": "Launch ParticleSystem", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/ParticleSystem/Debug/net6.0/ParticleSystem", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/ParticleSystem/${input:Configuration}/${input:CoreClrFramework}/ParticleSystem", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/ParticleSystem/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/ParticleSystem/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -48,9 +48,9 @@ "name": "Launch PlasmaFractal", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/PlasmaFractal/Debug/net6.0/PlasmaFractal", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/PlasmaFractal/${input:Configuration}/${input:CoreClrFramework}/PlasmaFractal", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/PlasmaFractal/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/PlasmaFractal/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -58,9 +58,9 @@ "name": "Launch RayTracer", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/RayTracer/Debug/net6.0/RayTracer", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/RayTracer/${input:Configuration}/${input:CoreClrFramework}/RayTracer", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/RayTracer/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/RayTracer/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -68,9 +68,9 @@ "name": "Launch SwirlStars", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/SwirlStars/Debug/net6.0/SwirlStars", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/SwirlStars/${input:Configuration}/${input:CoreClrFramework}/SwirlStars", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/SwirlStars/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/SwirlStars/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -78,9 +78,9 @@ "name": "Launch TunnelEffect", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/TunnelEffect/Debug/net6.0/TunnelEffect", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/TunnelEffect/${input:Configuration}/${input:CoreClrFramework}/TunnelEffect", "args": [], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/TunnelEffect/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/TunnelEffect/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" }, @@ -88,14 +88,59 @@ "name": "Launch WavePlayer", "type": "coreclr", "request": "launch", - "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/Debug/net6.0/WavePlayer", + "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/${input:Configuration}/${input:CoreClrFramework}/WavePlayer", "args": ["Roland-GR-1-Trumpet-C5.wav"], - "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/Debug/net6.0", + "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" } ], "inputs": [ + { + "id": "Configuration", + "description": "Choose which configuration should be used.", + "default": "Debug", + "type": "pickString", + "options": [ + "Debug", + "Release" + ] + }, + { + "id": "Architecture", + "description": "Choose which architecture should be used.", + "default": "x64", + "type": "pickString", + "options": [ + "x86", + "x64" + ] + }, + { + "id": "ClrFramework", + "description": "Choose which .NET target framework should be used.", + "default": "net481", + "type": "pickString", + "options": [ + "net481", + "net48", + "net472", + "net471", + "net47", + "net462" + ] + }, + { + "id": "CoreClrFramework", + "description": "Choose which .NET target framework should be used.", + "default": "net8.0", + "type": "pickString", + "options": [ + "net8.0", + "net7.0", + "net6.0", + ] + }, { "id": "NukeBuildTargets", "description": "Choose which target to build", From 50b4464066c14cff5bae32015e4b28651e553f8a Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 25 Jun 2024 12:14:54 +0200 Subject: [PATCH 19/62] Fix failing tests due to SDL not being initialized/deinitialized and tests running in parallel. --- tests/Directory.Build.props | 1 + tests/SDL2Sharp.UnitTests/App.config | 6 --- tests/SDL2Sharp.UnitTests/AssemblyFixture.cs | 39 +++++++++++++++++++ .../SDL2Sharp.UnitTests/PackedTextureTests.cs | 2 +- .../SDL2Sharp.UnitTests.csproj | 2 +- tests/SDL2Sharp.UnitTests/SurfaceTests.cs | 2 +- tests/SDL2Sharp.UnitTests/xunit.runner.json | 6 +++ 7 files changed, 49 insertions(+), 9 deletions(-) delete mode 100644 tests/SDL2Sharp.UnitTests/App.config create mode 100644 tests/SDL2Sharp.UnitTests/AssemblyFixture.cs create mode 100644 tests/SDL2Sharp.UnitTests/xunit.runner.json diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index a5a00a99..9f45b65b 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -26,6 +26,7 @@ + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/SDL2Sharp.UnitTests/App.config b/tests/SDL2Sharp.UnitTests/App.config deleted file mode 100644 index 7c16b080..00000000 --- a/tests/SDL2Sharp.UnitTests/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/SDL2Sharp.UnitTests/AssemblyFixture.cs b/tests/SDL2Sharp.UnitTests/AssemblyFixture.cs new file mode 100644 index 00000000..807ab7a9 --- /dev/null +++ b/tests/SDL2Sharp.UnitTests/AssemblyFixture.cs @@ -0,0 +1,39 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.UnitTests +{ + public sealed class AssemblyFixture : IDisposable + { + public AssemblyFixture() + { + Error.ThrowOnFailure(SDL.Init(SDL.SDL_INIT_EVERYTHING)); + } + + public void Dispose() + { + SDL.Quit(); + } + } +} + diff --git a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs b/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs index ada0d1f6..2a9bd0de 100644 --- a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.UnitTests { - public static class PackedTextureTests + public sealed class PackedTextureTests : IAssemblyFixture { [Fact] public static void CreatePackedTextureOfArgb8888() diff --git a/tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj b/tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj index cb6ae263..5fb9dd4e 100644 --- a/tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj +++ b/tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj @@ -8,7 +8,7 @@ - + diff --git a/tests/SDL2Sharp.UnitTests/SurfaceTests.cs b/tests/SDL2Sharp.UnitTests/SurfaceTests.cs index 5f451561..4eb68049 100644 --- a/tests/SDL2Sharp.UnitTests/SurfaceTests.cs +++ b/tests/SDL2Sharp.UnitTests/SurfaceTests.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.UnitTests { - public static class SurfaceTests + public sealed class SurfaceTests : IAssemblyFixture { [Fact] public static void CreateSurfaceOfArgb8888() diff --git a/tests/SDL2Sharp.UnitTests/xunit.runner.json b/tests/SDL2Sharp.UnitTests/xunit.runner.json new file mode 100644 index 00000000..be78ad92 --- /dev/null +++ b/tests/SDL2Sharp.UnitTests/xunit.runner.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "shadowCopy": false, + "parallelizeAssembly": false, + "parallelizeTestCollections": false +} From 492f8c2bf63faa759d811a0560656959306be97f Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 25 Jun 2024 12:15:13 +0200 Subject: [PATCH 20/62] Add tests for Texture. --- tests/SDL2Sharp.UnitTests/TextureTests.cs | 76 +++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/SDL2Sharp.UnitTests/TextureTests.cs diff --git a/tests/SDL2Sharp.UnitTests/TextureTests.cs b/tests/SDL2Sharp.UnitTests/TextureTests.cs new file mode 100644 index 00000000..070ec6c3 --- /dev/null +++ b/tests/SDL2Sharp.UnitTests/TextureTests.cs @@ -0,0 +1,76 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Colors; +using Xunit; + +namespace SDL2Sharp.UnitTests +{ + public sealed class TextureTests : IAssemblyFixture + { + [Fact] + public static void CreateTextureOfArgb8888() + { + var color = new Argb8888(255, 255, 255, 255); + using var window = new Window("CreateTextureOfArgb8888", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(PixelFormatEnum.ARGB8888, TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreateTextureOfYUY2() + { + var color = new Yuy2(255, 255, 255, 255); + using var window = new Window("CreateTextureOfYUY2", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(PixelFormatEnum.YUY2, TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreateTextureOfYVYU() + { + var color = new Yvyu(255, 255, 255, 255); + using var window = new Window("CreateTextureOfYVYU", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(PixelFormatEnum.YVYU, TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + + [Fact] + public static void CreateTextureOfUYVY() + { + var color = new Uyvy(255, 255, 255, 255); + using var window = new Window("CreateTextureOfUYVY", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(PixelFormatEnum.UYVY, TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + } + } +} From 707e8d41a47845c51948aeaa8ac17a58066f222e Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 25 Jun 2024 12:22:46 +0200 Subject: [PATCH 21/62] Rename SDL2Sharp.UnitTests and SDL2Sharp.Interop.UnitTests to SDL2Sharp.Tests and SDL2Sharp.Interop.Tests, respectively. --- SDL2Sharp.sln | 4 ++-- build/Build/IGenerate.cs | 6 +++--- build/Build/ITest.cs | 2 +- sources/Directory.Build.props | 2 +- .../App.config | 0 .../ID3D11DeviceTests.cs | 2 +- .../ID3D12DeviceTests.cs | 2 +- .../IDirect3DDevice9Tests.cs | 2 +- .../IMG_AnimationTests.cs | 2 +- .../SDL2Sharp.Interop.Tests.csproj} | 0 .../SDL_AudioCVTTests.cs | 2 +- .../SDL_AudioDeviceEventTests.cs | 2 +- .../SDL_AudioSpecTests.cs | 2 +- .../SDL_BlitMapTests.cs | 2 +- .../SDL_ColorTests.cs | 2 +- .../SDL_CommonEventTests.cs | 2 +- .../SDL_ControllerAxisEventTests.cs | 2 +- .../SDL_ControllerButtonEventTests.cs | 2 +- .../SDL_ControllerDeviceEventTests.cs | 2 +- .../SDL_ControllerSensorEventTests.cs | 2 +- .../SDL_ControllerTouchpadEventTests.cs | 2 +- .../SDL_CursorTests.cs | 2 +- .../SDL_DisplayEventTests.cs | 2 +- .../SDL_DisplayModeTests.cs | 2 +- .../SDL_DollarGestureEventTests.cs | 2 +- .../SDL_DropEventTests.cs | 2 +- .../SDL_EventTests.cs | 2 +- .../SDL_FPointTests.cs | 2 +- .../SDL_FRectTests.cs | 2 +- .../SDL_GUIDTests.cs | 2 +- .../SDL_JoyAxisEventTests.cs | 2 +- .../SDL_JoyBallEventTests.cs | 2 +- .../SDL_JoyBatteryEventTests.cs | 2 +- .../SDL_JoyButtonEventTests.cs | 2 +- .../SDL_JoyDeviceEventTests.cs | 2 +- .../SDL_JoyHatEventTests.cs | 2 +- .../SDL_KeyboardEventTests.cs | 2 +- .../SDL_KeysymTests.cs | 2 +- .../SDL_MouseButtonEventTests.cs | 2 +- .../SDL_MouseMotionEventTests.cs | 2 +- .../SDL_MouseWheelEventTests.cs | 2 +- .../SDL_MultiGestureEventTests.cs | 2 +- .../SDL_OSEventTests.cs | 2 +- .../SDL_PaletteTests.cs | 2 +- .../SDL_PixelFormatTests.cs | 2 +- .../SDL_PointTests.cs | 2 +- .../SDL_QuitEventTests.cs | 2 +- .../SDL_RWopsTests.cs | 2 +- .../SDL_RectTests.cs | 2 +- .../SDL_RendererInfoTests.cs | 2 +- .../SDL_RendererTests.cs | 2 +- .../SDL_SensorEventTests.cs | 2 +- .../SDL_SurfaceTests.cs | 2 +- .../SDL_SysWMEventTests.cs | 2 +- .../SDL_SysWMmsgTests.cs | 2 +- .../SDL_TextEditingEventTests.cs | 2 +- .../SDL_TextEditingExtEventTests.cs | 2 +- .../SDL_TextInputEventTests.cs | 2 +- .../SDL_TextureTests.cs | 2 +- .../SDL_TouchFingerEventTests.cs | 2 +- .../SDL_UserEventTests.cs | 2 +- .../SDL_VertexTests.cs | 2 +- .../SDL_VirtualJoystickDescTests.cs | 2 +- .../SDL_WindowEventTests.cs | 2 +- .../SDL_WindowTests.cs | 2 +- .../SDL_versionTests.cs | 2 +- .../_SDL_AudioStreamTests.cs | 2 +- .../_SDL_JoystickTests.cs | 2 +- .../_SDL_iconv_tTests.cs | 2 +- .../_TTF_FontTests.cs | 2 +- .../ApplicationTests.cs | 2 +- .../AssemblyFixture.cs | 2 +- .../AudioFormatExtensionTests.cs | 2 +- .../PackedTextureTests.cs | 2 +- .../SDL2Sharp.Tests.csproj} | 0 .../SurfaceTests.cs | 2 +- .../TextureTests.cs | 2 +- .../xunit.runner.json | 0 78 files changed, 77 insertions(+), 77 deletions(-) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/App.config (100%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/ID3D11DeviceTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/ID3D12DeviceTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/IDirect3DDevice9Tests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/IMG_AnimationTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests/SDL2Sharp.Interop.UnitTests.csproj => SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj} (100%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_AudioCVTTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_AudioDeviceEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_AudioSpecTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_BlitMapTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ColorTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_CommonEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ControllerAxisEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ControllerButtonEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ControllerDeviceEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ControllerSensorEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_ControllerTouchpadEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_CursorTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_DisplayEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_DisplayModeTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_DollarGestureEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_DropEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_EventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_FPointTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_FRectTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_GUIDTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyAxisEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyBallEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyBatteryEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyButtonEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyDeviceEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_JoyHatEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_KeyboardEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_KeysymTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_MouseButtonEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_MouseMotionEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_MouseWheelEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_MultiGestureEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_OSEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_PaletteTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_PixelFormatTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_PointTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_QuitEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_RWopsTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_RectTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_RendererInfoTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_RendererTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_SensorEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_SurfaceTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_SysWMEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_SysWMmsgTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_TextEditingEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_TextEditingExtEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_TextInputEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_TextureTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_TouchFingerEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_UserEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_VertexTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_VirtualJoystickDescTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_WindowEventTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_WindowTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/SDL_versionTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/_SDL_AudioStreamTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/_SDL_JoystickTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/_SDL_iconv_tTests.cs (98%) rename tests/{SDL2Sharp.Interop.UnitTests => SDL2Sharp.Interop.Tests}/_TTF_FontTests.cs (98%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/ApplicationTests.cs (97%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/AssemblyFixture.cs (97%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/AudioFormatExtensionTests.cs (98%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/PackedTextureTests.cs (99%) rename tests/{SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj => SDL2Sharp.Tests/SDL2Sharp.Tests.csproj} (100%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/SurfaceTests.cs (98%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/TextureTests.cs (99%) rename tests/{SDL2Sharp.UnitTests => SDL2Sharp.Tests}/xunit.runner.json (100%) diff --git a/SDL2Sharp.sln b/SDL2Sharp.sln index 8a83c186..23c11dd4 100644 --- a/SDL2Sharp.sln +++ b/SDL2Sharp.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 17.1.32319.34 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp", "sources\SDL2Sharp\SDL2Sharp.csproj", "{648556E3-AFD4-4432-8424-89EED2126F82}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.UnitTests", "tests\SDL2Sharp.UnitTests\SDL2Sharp.UnitTests.csproj", "{0EA1CB52-0E1E-4EEC-80B5-5EA37F436EAF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.Tests", "tests\SDL2Sharp.Tests\SDL2Sharp.Tests.csproj", "{0EA1CB52-0E1E-4EEC-80B5-5EA37F436EAF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sources", "sources", "{1CCF39F1-02DD-4E9C-B1C2-614715E9EDB0}" ProjectSection(SolutionItems) = preProject @@ -29,7 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3B30 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.Interop", "sources\SDL2Sharp.Interop\SDL2Sharp.Interop.csproj", "{A03FB552-F079-4852-8E1A-6ADD6C1BD3A8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.Interop.UnitTests", "tests\SDL2Sharp.Interop.UnitTests\SDL2Sharp.Interop.UnitTests.csproj", "{C4E13408-B833-4B51-BC7B-BABBC759FB1B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL2Sharp.Interop.Tests", "tests\SDL2Sharp.Interop.Tests\SDL2Sharp.Interop.Tests.csproj", "{C4E13408-B833-4B51-BC7B-BABBC759FB1B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".root", ".root", "{5E4EF724-335F-42C6-A2ED-4DFECD530B7F}" ProjectSection(SolutionItems) = preProject diff --git a/build/Build/IGenerate.cs b/build/Build/IGenerate.cs index 455c0c93..c1591965 100644 --- a/build/Build/IGenerate.cs +++ b/build/Build/IGenerate.cs @@ -45,7 +45,7 @@ private void GenerateBindingsForSDL2() { var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.UnitTests"; + var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; const string packageId = "SDL2"; var packageFolder = packageId.ToLower(); @@ -336,7 +336,7 @@ private void GenerateBindingsForSDL2Image() { var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.UnitTests"; + var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; const string basePackageId = "SDL2"; var basePackageFolder = basePackageId.ToLower(); @@ -391,7 +391,7 @@ private void GenerateBindingsForSDL2TTF() { var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.UnitTests"; + var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; const string basePackageId = "SDL2"; var basePackageFolder = basePackageId.ToLower(); diff --git a/build/Build/ITest.cs b/build/Build/ITest.cs index 1024b41e..fee426c7 100644 --- a/build/Build/ITest.cs +++ b/build/Build/ITest.cs @@ -31,7 +31,7 @@ interface ITest : IBuild .Produces(ArtifactsDirectory / "tst" / "*.*", ArtifactsDirectory / "log" / "*.*") .Executes(() => { - foreach (var targetFramework in GetTargetFrameworks(project => project.Name.EndsWith(".UnitTests"))) + foreach (var targetFramework in GetTargetFrameworks(project => project.Name.EndsWith(".Tests"))) { DotNetTest(settings => settings .SetProjectFile(Solution) diff --git a/sources/Directory.Build.props b/sources/Directory.Build.props index 1019778a..8454ffd6 100644 --- a/sources/Directory.Build.props +++ b/sources/Directory.Build.props @@ -22,7 +22,7 @@ - + \ No newline at end of file diff --git a/tests/SDL2Sharp.Interop.UnitTests/App.config b/tests/SDL2Sharp.Interop.Tests/App.config similarity index 100% rename from tests/SDL2Sharp.Interop.UnitTests/App.config rename to tests/SDL2Sharp.Interop.Tests/App.config diff --git a/tests/SDL2Sharp.Interop.UnitTests/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/ID3D11DeviceTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/ID3D11DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/ID3D11DeviceTests.cs index b09ed038..902ee933 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/ID3D11DeviceTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/ID3D11DeviceTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class ID3D11DeviceTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/ID3D12DeviceTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/ID3D12DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/ID3D12DeviceTests.cs index 1b556ba4..f448df0c 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/ID3D12DeviceTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/ID3D12DeviceTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class ID3D12DeviceTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/IDirect3DDevice9Tests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/IDirect3DDevice9Tests.cs rename to tests/SDL2Sharp.Interop.Tests/IDirect3DDevice9Tests.cs index a26be6ac..992608aa 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/IDirect3DDevice9Tests.cs +++ b/tests/SDL2Sharp.Interop.Tests/IDirect3DDevice9Tests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class IDirect3DDevice9Tests diff --git a/tests/SDL2Sharp.Interop.UnitTests/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/IMG_AnimationTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/IMG_AnimationTests.cs rename to tests/SDL2Sharp.Interop.Tests/IMG_AnimationTests.cs index 59c1f784..c81a240f 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/IMG_AnimationTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/IMG_AnimationTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class IMG_AnimationTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL2Sharp.Interop.UnitTests.csproj b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj similarity index 100% rename from tests/SDL2Sharp.Interop.UnitTests/SDL2Sharp.Interop.UnitTests.csproj rename to tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_AudioCVTTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_AudioCVTTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_AudioCVTTests.cs index 1b531da1..62687097 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioCVTTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_AudioCVTTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_AudioCVTTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_AudioDeviceEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_AudioDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_AudioDeviceEventTests.cs index 65e37b33..aa9e76b5 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioDeviceEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_AudioDeviceEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_AudioDeviceEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_AudioSpecTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_AudioSpecTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_AudioSpecTests.cs index 70c0419b..ced0ef42 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_AudioSpecTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_AudioSpecTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_AudioSpecTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_BlitMapTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_BlitMapTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_BlitMapTests.cs index 65b9912d..d3cd923f 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_BlitMapTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_BlitMapTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_BlitMapTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ColorTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ColorTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ColorTests.cs index fe3aa3a9..45d6d0fa 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ColorTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ColorTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ColorTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_CommonEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_CommonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_CommonEventTests.cs index 12a4bebe..34d3a8a8 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_CommonEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_CommonEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_CommonEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerAxisEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ControllerAxisEventTests.cs index d212730f..2b1f7950 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerAxisEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerAxisEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ControllerAxisEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerButtonEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ControllerButtonEventTests.cs index ff457408..8f2d5876 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerButtonEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerButtonEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ControllerButtonEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerDeviceEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ControllerDeviceEventTests.cs index 1815dae9..99ba365d 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerDeviceEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerDeviceEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ControllerDeviceEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerSensorEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerSensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ControllerSensorEventTests.cs index 2ebab759..1b77f29c 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerSensorEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerSensorEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ControllerSensorEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerTouchpadEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerTouchpadEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_ControllerTouchpadEventTests.cs index ef0e793c..306a0df9 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_ControllerTouchpadEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_ControllerTouchpadEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_ControllerTouchpadEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_CursorTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_CursorTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_CursorTests.cs index f34ab0cc..5c354b2c 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_CursorTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_CursorTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_CursorTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_DisplayEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_DisplayEventTests.cs index dcddfb63..1c22bb9b 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_DisplayEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_DisplayEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_DisplayModeTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayModeTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_DisplayModeTests.cs index b0af4e4c..0362d9c3 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_DisplayModeTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_DisplayModeTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_DisplayModeTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_DollarGestureEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_DollarGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_DollarGestureEventTests.cs index 35a91ba7..e39269e4 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_DollarGestureEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_DollarGestureEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_DollarGestureEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_DropEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_DropEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_DropEventTests.cs index 87bf5ceb..113aef6b 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_DropEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_DropEventTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_DropEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_EventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_EventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_EventTests.cs index f9f2e6ab..0c10bd35 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_EventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_EventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_EventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_FPointTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_FPointTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_FPointTests.cs index bbb20815..248145ee 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_FPointTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_FPointTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_FPointTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_FRectTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_FRectTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_FRectTests.cs index 5756f915..d2b27926 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_FRectTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_FRectTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_FRectTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_GUIDTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_GUIDTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_GUIDTests.cs index 7760fccf..0c1206c3 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_GUIDTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_GUIDTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_GUIDTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyAxisEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyAxisEventTests.cs index 48785e1a..61815df1 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyAxisEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyAxisEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyAxisEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBallEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBallEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyBallEventTests.cs index 6ec2d277..32fbe2db 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBallEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBallEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyBallEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBatteryEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs index 2a78c742..baf6c8fd 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyBatteryEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyBatteryEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyButtonEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyButtonEventTests.cs index b6b95d1d..80a08286 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyButtonEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyButtonEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyButtonEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyDeviceEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyDeviceEventTests.cs index 4f9d2cc5..d4006a86 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyDeviceEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyDeviceEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyDeviceEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyHatEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_JoyHatEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_JoyHatEventTests.cs index a9cca4ca..17801a2a 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_JoyHatEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyHatEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_JoyHatEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_KeyboardEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_KeyboardEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_KeyboardEventTests.cs index af353cbb..00f466a7 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_KeyboardEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_KeyboardEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_KeyboardEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_KeysymTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_KeysymTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_KeysymTests.cs index 7f411b4c..1bd03489 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_KeysymTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_KeysymTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_KeysymTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_MouseButtonEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_MouseButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_MouseButtonEventTests.cs index 929d5374..6109eb33 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseButtonEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_MouseButtonEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_MouseButtonEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_MouseMotionEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_MouseMotionEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_MouseMotionEventTests.cs index ae086b9d..687c7ddd 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseMotionEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_MouseMotionEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_MouseMotionEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_MouseWheelEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_MouseWheelEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_MouseWheelEventTests.cs index 4130b6c6..97d5d0bf 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_MouseWheelEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_MouseWheelEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_MouseWheelEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_MultiGestureEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_MultiGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_MultiGestureEventTests.cs index a29b6e21..394c37e0 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_MultiGestureEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_MultiGestureEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_MultiGestureEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_OSEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_OSEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_OSEventTests.cs index af26566b..5522a976 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_OSEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_OSEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_OSEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_PaletteTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_PaletteTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_PaletteTests.cs index 14eaf236..6c7592aa 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_PaletteTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_PaletteTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_PaletteTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_PixelFormatTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_PixelFormatTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_PixelFormatTests.cs index 54d58a49..8341e951 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_PixelFormatTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_PixelFormatTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_PixelFormatTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_PointTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_PointTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_PointTests.cs index 8350c2c1..8bda4439 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_PointTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_PointTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_PointTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_QuitEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_QuitEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_QuitEventTests.cs index 61667e01..85cfe3f4 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_QuitEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_QuitEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_QuitEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_RWopsTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_RWopsTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_RWopsTests.cs index 668aa727..947afb58 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_RWopsTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_RWopsTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_RWopsTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_RectTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_RectTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_RectTests.cs index 78b861a0..f6585ac2 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_RectTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_RectTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_RectTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_RendererInfoTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_RendererInfoTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_RendererInfoTests.cs index 653f1156..b770b631 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_RendererInfoTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_RendererInfoTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_RendererInfoTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_RendererTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_RendererTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_RendererTests.cs index dc309548..8f11ffe5 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_RendererTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_RendererTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_RendererTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_SensorEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_SensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_SensorEventTests.cs index faa132ff..e3e1d9ee 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_SensorEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_SensorEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_SensorEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_SurfaceTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_SurfaceTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_SurfaceTests.cs index 64c0e525..42417b72 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_SurfaceTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_SurfaceTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_SurfaceTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_SysWMEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_SysWMEventTests.cs index fad39a04..25302a8b 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_SysWMEventTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_SysWMEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_SysWMmsgTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMmsgTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_SysWMmsgTests.cs index ee8e49b2..67d9f79e 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_SysWMmsgTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_SysWMmsgTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_SysWMmsgTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_TextEditingEventTests.cs index 2d8ebb60..44e086b8 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_TextEditingEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingExtEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingExtEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_TextEditingExtEventTests.cs index b19b7643..22589af6 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextEditingExtEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingExtEventTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_TextEditingExtEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_TextInputEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_TextInputEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_TextInputEventTests.cs index beb5bfb0..79c68c7e 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextInputEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_TextInputEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_TextInputEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_TextureTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_TextureTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_TextureTests.cs index 18f5a908..56f97725 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_TextureTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_TextureTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_TextureTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_TouchFingerEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_TouchFingerEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_TouchFingerEventTests.cs index 78dec80d..633fbb9b 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_TouchFingerEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_TouchFingerEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_TouchFingerEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_UserEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_UserEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_UserEventTests.cs index 31998d00..1be2e6ca 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_UserEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_UserEventTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_UserEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_VertexTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_VertexTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_VertexTests.cs index 2617b17b..127103bb 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_VertexTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_VertexTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_VertexTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_VirtualJoystickDescTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_VirtualJoystickDescTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_VirtualJoystickDescTests.cs index 4f4c2c9c..f51bf206 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_VirtualJoystickDescTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_VirtualJoystickDescTests.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_VirtualJoystickDescTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_WindowEventTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_WindowEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_WindowEventTests.cs index 8f1b1dfd..1a2d68b2 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_WindowEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_WindowEventTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_WindowEventTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_WindowTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_WindowTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_WindowTests.cs index ee124144..e7ee2a5a 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_WindowTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_WindowTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_WindowTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_versionTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/SDL_versionTests.cs rename to tests/SDL2Sharp.Interop.Tests/SDL_versionTests.cs index 788f36bd..13bda700 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/SDL_versionTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_versionTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class SDL_versionTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/_SDL_AudioStreamTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/_SDL_AudioStreamTests.cs rename to tests/SDL2Sharp.Interop.Tests/_SDL_AudioStreamTests.cs index 4d7861f3..56f6b8eb 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/_SDL_AudioStreamTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/_SDL_AudioStreamTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class _SDL_AudioStreamTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/_SDL_JoystickTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/_SDL_JoystickTests.cs rename to tests/SDL2Sharp.Interop.Tests/_SDL_JoystickTests.cs index 1627d0c3..44a03429 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/_SDL_JoystickTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/_SDL_JoystickTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class _SDL_JoystickTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/_SDL_iconv_tTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/_SDL_iconv_tTests.cs rename to tests/SDL2Sharp.Interop.Tests/_SDL_iconv_tTests.cs index 9d323452..2771dc57 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/_SDL_iconv_tTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/_SDL_iconv_tTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class _SDL_iconv_tTests diff --git a/tests/SDL2Sharp.Interop.UnitTests/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/_TTF_FontTests.cs similarity index 98% rename from tests/SDL2Sharp.Interop.UnitTests/_TTF_FontTests.cs rename to tests/SDL2Sharp.Interop.Tests/_TTF_FontTests.cs index 96c515c3..1b15952a 100644 --- a/tests/SDL2Sharp.Interop.UnitTests/_TTF_FontTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/_TTF_FontTests.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace SDL2Sharp.Interop.UnitTests +namespace SDL2Sharp.Interop.Tests { /// Provides validation of the struct. public static unsafe partial class _TTF_FontTests diff --git a/tests/SDL2Sharp.UnitTests/ApplicationTests.cs b/tests/SDL2Sharp.Tests/ApplicationTests.cs similarity index 97% rename from tests/SDL2Sharp.UnitTests/ApplicationTests.cs rename to tests/SDL2Sharp.Tests/ApplicationTests.cs index 27ac47de..f69ec610 100644 --- a/tests/SDL2Sharp.UnitTests/ApplicationTests.cs +++ b/tests/SDL2Sharp.Tests/ApplicationTests.cs @@ -20,7 +20,7 @@ using Xunit; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public static class ApplicationTests { diff --git a/tests/SDL2Sharp.UnitTests/AssemblyFixture.cs b/tests/SDL2Sharp.Tests/AssemblyFixture.cs similarity index 97% rename from tests/SDL2Sharp.UnitTests/AssemblyFixture.cs rename to tests/SDL2Sharp.Tests/AssemblyFixture.cs index 807ab7a9..17a3d12e 100644 --- a/tests/SDL2Sharp.UnitTests/AssemblyFixture.cs +++ b/tests/SDL2Sharp.Tests/AssemblyFixture.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public sealed class AssemblyFixture : IDisposable { diff --git a/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs b/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs similarity index 98% rename from tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs rename to tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs index bfe4e709..77ffa6e5 100644 --- a/tests/SDL2Sharp.UnitTests/AudioFormatExtensionTests.cs +++ b/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs @@ -20,7 +20,7 @@ using Xunit; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public static class AudioFormatExtensionTests { diff --git a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs similarity index 99% rename from tests/SDL2Sharp.UnitTests/PackedTextureTests.cs rename to tests/SDL2Sharp.Tests/PackedTextureTests.cs index 2a9bd0de..c4f26d44 100644 --- a/tests/SDL2Sharp.UnitTests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -21,7 +21,7 @@ using SDL2Sharp.Colors; using Xunit; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public sealed class PackedTextureTests : IAssemblyFixture { diff --git a/tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj b/tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj similarity index 100% rename from tests/SDL2Sharp.UnitTests/SDL2Sharp.UnitTests.csproj rename to tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj diff --git a/tests/SDL2Sharp.UnitTests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/SurfaceTests.cs similarity index 98% rename from tests/SDL2Sharp.UnitTests/SurfaceTests.cs rename to tests/SDL2Sharp.Tests/SurfaceTests.cs index 4eb68049..3fb75df6 100644 --- a/tests/SDL2Sharp.UnitTests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/SurfaceTests.cs @@ -21,7 +21,7 @@ using SDL2Sharp.Colors; using Xunit; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public sealed class SurfaceTests : IAssemblyFixture { diff --git a/tests/SDL2Sharp.UnitTests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs similarity index 99% rename from tests/SDL2Sharp.UnitTests/TextureTests.cs rename to tests/SDL2Sharp.Tests/TextureTests.cs index 070ec6c3..5b232804 100644 --- a/tests/SDL2Sharp.UnitTests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -21,7 +21,7 @@ using SDL2Sharp.Colors; using Xunit; -namespace SDL2Sharp.UnitTests +namespace SDL2Sharp.Tests { public sealed class TextureTests : IAssemblyFixture { diff --git a/tests/SDL2Sharp.UnitTests/xunit.runner.json b/tests/SDL2Sharp.Tests/xunit.runner.json similarity index 100% rename from tests/SDL2Sharp.UnitTests/xunit.runner.json rename to tests/SDL2Sharp.Tests/xunit.runner.json From 5a01de842b50e8cdc5f384934a138143ddd2649a Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 26 Jun 2024 13:51:01 +0200 Subject: [PATCH 22/62] Rename PackedMemoryImage to MemoryImage and use it instead of Memory2D. --- samples/PlasmaFractal/App.cs | 14 +++++----- samples/RayTracer/App.cs | 6 ++--- samples/RayTracer/Camera.cs | 2 +- samples/TunnelEffect/App.cs | 23 +++++++--------- .../{PackedMemoryImage.cs => MemoryImage.cs} | 18 ++++++------- sources/SDL2Sharp/PackedTexture.cs | 11 +------- tests/SDL2Sharp.Tests/TextureTests.cs | 26 ++++++++++++++++--- 7 files changed, 53 insertions(+), 47 deletions(-) rename sources/SDL2Sharp/{PackedMemoryImage.cs => MemoryImage.cs} (87%) diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs index 8b72f924..ae8629ed 100644 --- a/samples/PlasmaFractal/App.cs +++ b/samples/PlasmaFractal/App.cs @@ -43,7 +43,7 @@ internal sealed class App : Application private PackedTexture _screenImage = null!; - private PackedMemoryImage _sourceImage = null!; + private MemoryImage _sourceImage = null!; private Palette _palette = null!; @@ -199,21 +199,21 @@ private static Palette GeneratePalette() return palette; } - private static PackedMemoryImage GenerateDiamondSquareImage(Size size) + private static MemoryImage GenerateDiamondSquareImage(Size size) { return GenerateDiamondSquareImage(size.Width, size.Height); } - private static PackedMemoryImage GenerateDiamondSquareImage(int width, int height) + private static MemoryImage GenerateDiamondSquareImage(int width, int height) { var size = NextPowerOfTwo(Max(width, height)) + 1; var image = GenerateDiamondSquareImage(size); return image.Crop(0, 0, height, width); } - private static PackedMemoryImage GenerateDiamondSquareImage(int size) + private static MemoryImage GenerateDiamondSquareImage(int size) { - var image = new PackedMemoryImage(size, size); + var image = new MemoryImage(size, size); var randomness = 256; @@ -249,7 +249,7 @@ private static PackedMemoryImage GenerateDiamondSquareImage(int size) return image; } - private static void Diamond(PackedMemoryImage map, int centerX, int centerY, int distance, int randomness) + private static void Diamond(MemoryImage map, int centerX, int centerY, int distance, int randomness) { var sum = 0; var count = 0; @@ -296,7 +296,7 @@ private static void Diamond(PackedMemoryImage map, int centerX, int center map[centerY, centerX] = (byte)value; } - private static void Square(PackedMemoryImage map, int centerX, int centerY, int distance, int randomness) + private static void Square(MemoryImage map, int centerX, int centerY, int distance, int randomness) { var sum = 0; var count = 0; diff --git a/samples/RayTracer/App.cs b/samples/RayTracer/App.cs index 19aa6c3d..0be5cd7d 100644 --- a/samples/RayTracer/App.cs +++ b/samples/RayTracer/App.cs @@ -40,7 +40,7 @@ internal sealed class App : Application private PackedTexture _screenTexture = null!; - private PackedMemoryImage _screenImage = null!; + private MemoryImage _screenImage = null!; private Stopwatch _frameTime = null!; @@ -60,7 +60,7 @@ protected override void OnInitialized() _window.MouseWheel += OnMouseWheel; _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); _screenTexture = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _screenImage = new PackedMemoryImage(_renderer.OutputSize); + _screenImage = new MemoryImage(_renderer.OutputSize); _frameTime = new Stopwatch(); _world = new World { @@ -286,7 +286,7 @@ private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) _renderer?.Dispose(); _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); _screenTexture = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _screenImage = new PackedMemoryImage(_renderer.OutputSize); + _screenImage = new MemoryImage(_renderer.OutputSize); } private void OnMouseWheel(object? sender, MouseWheelEventArgs e) diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index e27b9f95..0b260c7c 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -101,7 +101,7 @@ public void Rotate(float yaw, float pitch, float roll) _viewMatrix *= Matrix4x4.CreateFromYawPitchRoll(yaw, pitch, roll); } - public void Shoot(World world, PackedMemoryImage image) + public void Shoot(World world, MemoryImage image) { if (world is null) { diff --git a/samples/TunnelEffect/App.cs b/samples/TunnelEffect/App.cs index aa3447c7..9a370f0c 100644 --- a/samples/TunnelEffect/App.cs +++ b/samples/TunnelEffect/App.cs @@ -55,9 +55,9 @@ public Transform(int angle, int distance) private PackedTexture _screenTexture = null!; - private Memory2D _sourceImage = null!; + private MemoryImage _sourceImage = null!; - private Memory2D _transformTable = null!; + private MemoryImage _transformTable = null!; private Stopwatch _realTime = null!; @@ -111,14 +111,11 @@ private void Render(TimeSpan realTime) var screenWidth = screenImage.Width; var screenHeight = screenImage.Height; - var sourceImage = _sourceImage.Span; var sourceWidth = _sourceImage.Width; var sourceHeight = _sourceImage.Height; var sourceWidthMask = sourceWidth - 1; var sourceHeightMask = sourceHeight - 1; - var transformTable = _transformTable.Span; - var shiftX = (int)(screenWidth * 1.0 * realTime.TotalSeconds); var shiftY = (int)(screenHeight * 0.25 * realTime.TotalSeconds); var lookX = (sourceWidth - screenWidth) / 2; @@ -149,14 +146,14 @@ private void Render(TimeSpan realTime) _renderer.Present(); } - private static Memory2D GenerateXorImage(int size) + private static MemoryImage GenerateXorImage(int size) { return GenerateXorImage(size, size); } - private static Memory2D GenerateXorImage(int width, int height) + private static MemoryImage GenerateXorImage(int width, int height) { - var image = new Argb8888[height, width]; + var image = new MemoryImage(width, height); for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) @@ -169,18 +166,18 @@ private static Memory2D GenerateXorImage(int width, int height) ); } } - return new Memory2D(image); + return image; } - private static Memory2D GenerateTransformTable(int size) + private static MemoryImage GenerateTransformTable(int size) { return GenerateTransformTable(size, size); } - private static Memory2D GenerateTransformTable(int width, int height) + private static MemoryImage GenerateTransformTable(int width, int height) { const double ratio = 32d; - var transformTable = new Transform[height, width]; + var transformTable = new MemoryImage(width, height); for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) @@ -193,7 +190,7 @@ private static Memory2D GenerateTransformTable(int width, int height) } } } - return new Memory2D(transformTable); + return transformTable; } private void OnWindowKeyDown(object? sender, KeyEventArgs e) diff --git a/sources/SDL2Sharp/PackedMemoryImage.cs b/sources/SDL2Sharp/MemoryImage.cs similarity index 87% rename from sources/SDL2Sharp/PackedMemoryImage.cs rename to sources/SDL2Sharp/MemoryImage.cs index 1916de5f..0189b3f9 100644 --- a/sources/SDL2Sharp/PackedMemoryImage.cs +++ b/sources/SDL2Sharp/MemoryImage.cs @@ -23,19 +23,19 @@ namespace SDL2Sharp { - public sealed class PackedMemoryImage where TPackedColor : struct + public sealed class MemoryImage where TColor : struct { private readonly int _height; private readonly int _width; - private readonly TPackedColor[] _pixels; + private readonly TColor[] _pixels; public int Height => _height; public int Width => _width; - public TPackedColor this[int y, int x] + public TColor this[int y, int x] { get { @@ -47,7 +47,7 @@ public sealed class PackedMemoryImage where TPackedColor : struct } } - public PackedMemoryImage(int width, int height) + public MemoryImage(int width, int height) { if (width <= 0) { @@ -67,14 +67,14 @@ public PackedMemoryImage(int width, int height) _width = width; _height = height; - _pixels = new TPackedColor[_height * _width]; + _pixels = new TColor[_height * _width]; } - public PackedMemoryImage(Size size) + public MemoryImage(Size size) : this(size.Width, size.Height) { } - public PackedMemoryImage Crop(int top, int left, int bottom, int right) + public MemoryImage Crop(int top, int left, int bottom, int right) { if (top < 0) { @@ -124,7 +124,7 @@ public PackedMemoryImage Crop(int top, int left, int bottom, int r "The right of the crop rectangle cannot be less than or equal to the left of the crop rectangle."); } - var croppedImage = new PackedMemoryImage(right - left, bottom - top); + var croppedImage = new MemoryImage(right - left, bottom - top); for (var y = 0; y < croppedImage.Height; ++y) { for (var x = 0; x < croppedImage.Width; ++x) @@ -135,7 +135,7 @@ public PackedMemoryImage Crop(int top, int left, int bottom, int r return croppedImage; } - public ref TPackedColor DangerousGetReference() + public ref TColor DangerousGetReference() { return ref _pixels.DangerousGetReference(); } diff --git a/sources/SDL2Sharp/PackedTexture.cs b/sources/SDL2Sharp/PackedTexture.cs index b2f3b8a5..9699542c 100644 --- a/sources/SDL2Sharp/PackedTexture.cs +++ b/sources/SDL2Sharp/PackedTexture.cs @@ -102,7 +102,7 @@ public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallbac _texture.WithLock(x, y, width, height, callback); } - public void Update(PackedMemoryImage image) + public void Update(MemoryImage image) { ThrowWhenDisposed(); @@ -120,15 +120,6 @@ public void Update(PackedImage pixels) Update(null, pointer, pitch); } - public void Update(Span2D pixels) - { - ThrowWhenDisposed(); - - var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); - var pitch = pixels.Width * Marshal.SizeOf(); - Update(null, pointer, pitch); - } - public void Update(TPackedColor[,] pixels) { ThrowWhenDisposed(); diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index 5b232804..0b01cde1 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -18,6 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using SDL2Sharp.Colors; using Xunit; @@ -26,7 +27,7 @@ namespace SDL2Sharp.Tests public sealed class TextureTests : IAssemblyFixture { [Fact] - public static void CreateTextureOfArgb8888() + public void CreateTextureOfArgb8888() { var color = new Argb8888(255, 255, 255, 255); using var window = new Window("CreateTextureOfArgb8888", 640, 480, WindowFlags.Hidden); @@ -38,7 +39,7 @@ public static void CreateTextureOfArgb8888() } [Fact] - public static void CreateTextureOfYUY2() + public void CreateTextureOfYUY2() { var color = new Yuy2(255, 255, 255, 255); using var window = new Window("CreateTextureOfYUY2", 640, 480, WindowFlags.Hidden); @@ -50,7 +51,7 @@ public static void CreateTextureOfYUY2() } [Fact] - public static void CreateTextureOfYVYU() + public void CreateTextureOfYVYU() { var color = new Yvyu(255, 255, 255, 255); using var window = new Window("CreateTextureOfYVYU", 640, 480, WindowFlags.Hidden); @@ -62,7 +63,7 @@ public static void CreateTextureOfYVYU() } [Fact] - public static void CreateTextureOfUYVY() + public void CreateTextureOfUYVY() { var color = new Uyvy(255, 255, 255, 255); using var window = new Window("CreateTextureOfUYVY", 640, 480, WindowFlags.Hidden); @@ -72,5 +73,22 @@ public static void CreateTextureOfUYVY() renderer.Copy(texture); renderer.Present(); } + + [Fact] + public void CreateTextureOfYV12() + { + var color = new Uyvy(255, 255, 255, 255); + using var window = new Window("CreateTextureOfYV12", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateTexture(PixelFormatEnum.YV12, TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock((Yv12Image pixels) => + { + pixels.Y.Fill(255); + pixels.U.Fill(255); + pixels.V.Fill(255); + }); + renderer.Copy(texture); + renderer.Present(); + } } } From 70e3c09fc310988c7ba42e49170ffaec464b5b4e Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 15 Jul 2024 13:27:28 +0200 Subject: [PATCH 23/62] Fix naming of static fields. --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index f0bb9fcf..519f49d2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -96,7 +96,7 @@ dotnet_naming_symbols.constants.required_modifiers = const dotnet_naming_style.constant_style.capitalization = pascal_case -# Static fields are camelCase and start with s_ +# Static fields are camelCase and start with _ dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style @@ -105,7 +105,7 @@ dotnet_naming_symbols.static_fields.applicable_kinds = field dotnet_naming_symbols.static_fields.required_modifiers = static dotnet_naming_style.static_field_style.capitalization = camel_case -dotnet_naming_style.static_field_style.required_prefix = s_ +dotnet_naming_style.static_field_style.required_prefix = _ # Instance fields are camelCase and start with _ dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion From 4cf8039b41d9c6011f472a50015fc5544db25145 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 15 Jul 2024 13:29:33 +0200 Subject: [PATCH 24/62] Allow developer to specify the filename of the bitmap to view when running the BitMapViewer sample. --- .vscode/launch.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 406c408d..c515d947 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -29,7 +29,7 @@ "type": "coreclr", "request": "launch", "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/${input:Configuration}/${input:CoreClrFramework}/BitmapViewer", - "args": ["Sample.bmp"], + "args": ["${input:BitMapViewerArg}"], "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/BitmapViewer/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" @@ -155,6 +155,12 @@ "Test", "Pack", ] + }, + { + "id": "BitMapViewerArg", + "description": "Specify the filename of the bitmap to view", + "default": "Sample.bmp", + "type": "promptString" } ] } \ No newline at end of file From 4d68a32e080870df802e9868b5819d07cec66e0a Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 15 Jul 2024 13:29:59 +0200 Subject: [PATCH 25/62] Allow developer to specify the filename of the WAVE file to play when running the WavePlayer sample. --- .vscode/launch.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c515d947..a75fe817 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -89,7 +89,7 @@ "type": "coreclr", "request": "launch", "program": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/${input:Configuration}/${input:CoreClrFramework}/WavePlayer", - "args": ["Roland-GR-1-Trumpet-C5.wav"], + "args": ["${input:WavePlayerArg}"], "cwd": "${workspaceFolder:SDL2Sharp}/artifacts/bin/samples/WavePlayer/${input:Configuration}/${input:CoreClrFramework}", "stopAtEntry": false, "console": "internalConsole" @@ -161,6 +161,12 @@ "description": "Specify the filename of the bitmap to view", "default": "Sample.bmp", "type": "promptString" + }, + { + "id": "WavePlayerArg", + "description": "Specify the filename of the WAVE file to play.", + "default": "Roland-GR-1-Trumpet-C5.wav", + "type": "promptString" } ] } \ No newline at end of file From 0da64f2336c699312c09baadd0d0e12a9a87bbdf Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 15 Jul 2024 13:42:38 +0200 Subject: [PATCH 26/62] Major overhaul. --- samples/AverageFrameRate/App.cs | 125 ------- samples/AverageFrameRate/Program.cs | 96 +++++ samples/BitmapViewer/App.cs | 82 ----- samples/BitmapViewer/BitmapViewer.csproj | 3 + samples/BitmapViewer/Program.cs | 98 +++++ samples/BitmapViewer/lazy.ttf | Bin 0 -> 103160 bytes samples/ParticleSystem/App.cs | 164 --------- samples/ParticleSystem/Particle.cs | 81 ++-- samples/ParticleSystem/ParticleEmitter.cs | 113 +++--- samples/ParticleSystem/Program.cs | 107 ++++++ samples/PlasmaFractal/App.cs | 345 ------------------ samples/PlasmaFractal/Program.cs | 287 +++++++++++++++ samples/RayTracer/App.cs | 304 --------------- samples/RayTracer/Camera.cs | 257 +++++++------ samples/RayTracer/Frustum.cs | 37 +- samples/RayTracer/IObject.cs | 11 +- samples/RayTracer/ISurface.cs | 9 +- samples/RayTracer/Intersection.cs | 41 +-- samples/RayTracer/MatteSurface.cs | 19 +- samples/RayTracer/Plane.cs | 43 +-- samples/RayTracer/PointLight.cs | 11 +- samples/RayTracer/Program.cs | 267 ++++++++++++++ samples/RayTracer/Ray.cs | 33 +- samples/RayTracer/RayExtensions.cs | 21 +- samples/RayTracer/Resolution.cs | 75 ++-- samples/RayTracer/Sphere.cs | 55 ++- samples/RayTracer/VectorExtensions.cs | 17 +- samples/RayTracer/World.cs | 13 +- samples/SwirlStars/App.cs | 204 ----------- samples/SwirlStars/Program.cs | 159 ++++++++ samples/SwirlStars/Star.cs | 13 +- samples/TunnelEffect/App.cs | 230 ------------ samples/TunnelEffect/Program.cs | 185 ++++++++++ .../TunnelEffect/Transform.cs | 21 +- samples/WavePlayer/App.cs | 219 ----------- samples/WavePlayer/Program.cs | 173 +++++++++ sources/SDL2Sharp/Application.cs | 203 ----------- .../{ => Audio}/AudioChannelLayout.cs | 4 +- sources/SDL2Sharp/{ => Audio}/AudioDevice.cs | 35 +- .../{ => Audio}/AudioDeviceAllowedChanges.cs | 4 +- .../{ => Audio}/AudioDeviceCallback.cs | 4 +- sources/SDL2Sharp/{ => Audio}/AudioFormat.cs | 4 +- .../{ => Audio}/AudioFormatExtensions.cs | 4 +- sources/SDL2Sharp/Audio/AudioStatus.cs | 31 ++ sources/SDL2Sharp/Audio/AudioSubsystem.cs | 67 ++++ .../{ => Audio}/ReadOnlySpanExtensions.cs | 4 +- .../SDL2Sharp/{ => Audio}/SpanExtensions.cs | 4 +- sources/SDL2Sharp/{ => Audio}/WaveFile.cs | 6 +- sources/SDL2Sharp/{ => Fonts}/Font.cs | 9 +- sources/SDL2Sharp/{ => Fonts}/FontError.cs | 4 +- sources/SDL2Sharp/Fonts/FontSubsystem.cs | 43 +++ sources/SDL2Sharp/Hints.cs | 2 +- .../Input/AppDidEnterBackgroundEvent.cs | 16 +- .../Input/AppDidEnterForegroundEvent.cs | 31 ++ sources/SDL2Sharp/Input/AppLowMemoryEvent.cs | 31 ++ .../SDL2Sharp/Input/AppTerminatingEvent.cs | 31 ++ .../Input/AppWillEnterBackgroundEvent.cs | 31 ++ .../Input/AppWillEnterForegroundEvent.cs | 31 ++ .../SDL2Sharp/Input/AudioDeviceAddedEvent.cs | 31 ++ .../Input/AudioDeviceRemovedEvent.cs | 31 ++ .../SDL2Sharp/Input/ClipboardUpdateEvent.cs | 31 ++ .../Input/ControllerAxisMotionEvent.cs | 31 ++ .../Input/ControllerButtonDownEvent.cs | 31 ++ .../Input/ControllerButtonUpEvent.cs | 31 ++ .../Input/ControllerDeviceAddedEvent.cs | 31 ++ .../Input/ControllerDeviceRemappedEvent.cs | 31 ++ .../Input/ControllerDeviceRemovedEvent.cs | 31 ++ .../Input/ControllerSensorUpdateEvent.cs | 31 ++ .../Input/ControllerTouchpadDownEvent.cs | 31 ++ .../Input/ControllerTouchpadMotionEvent.cs | 31 ++ .../Input/ControllerTouchpadUpEvent.cs | 31 ++ sources/SDL2Sharp/Input/DisplayEvent.cs | 31 ++ sources/SDL2Sharp/Input/DollarGestureEvent.cs | 31 ++ sources/SDL2Sharp/Input/DollarRecordEvent.cs | 31 ++ sources/SDL2Sharp/Input/DropBeginEvent.cs | 31 ++ sources/SDL2Sharp/Input/DropCompleteEvent.cs | 31 ++ sources/SDL2Sharp/Input/DropFileEvent.cs | 31 ++ sources/SDL2Sharp/Input/DropTextEvent.cs | 31 ++ .../Event.cs} | 23 +- sources/SDL2Sharp/Input/EventSubsystem.cs | 275 ++++++++++++++ sources/SDL2Sharp/Input/FingerDownEvent.cs | 31 ++ sources/SDL2Sharp/Input/FingerMotionEvent.cs | 31 ++ sources/SDL2Sharp/Input/FingerUpEvent.cs | 31 ++ .../Input/JoystickAxisMotionEvent.cs | 31 ++ .../Input/JoystickBallMotionEvent.cs | 31 ++ .../Input/JoystickBatteryUpdatedEvent.cs | 31 ++ .../Input/JoystickButtonDownEvent.cs | 31 ++ .../SDL2Sharp/Input/JoystickButtonUpEvent.cs | 31 ++ .../Input/JoystickDeviceAddedEvent.cs | 31 ++ .../Input/JoystickDeviceRemovedEvent.cs | 31 ++ .../SDL2Sharp/Input/JoystickHatMotionEvent.cs | 31 ++ sources/SDL2Sharp/{ => Input}/KeyCode.cs | 4 +- sources/SDL2Sharp/Input/KeyDownEvent.cs | 31 ++ sources/SDL2Sharp/Input/KeyMapChangedEvent.cs | 31 ++ sources/SDL2Sharp/{ => Input}/KeyModifiers.cs | 4 +- sources/SDL2Sharp/Input/KeyUpEvent.cs | 31 ++ .../Keyboard.cs} | 41 ++- .../{Subsystems.cs => Input/KeyboardEvent.cs} | 32 +- sources/SDL2Sharp/Input/LocaleChangedEvent.cs | 31 ++ .../SDL2Sharp/Input/MouseButtonDownEvent.cs | 31 ++ sources/SDL2Sharp/Input/MouseButtonUpEvent.cs | 31 ++ sources/SDL2Sharp/Input/MouseMotionEvent.cs | 41 +++ .../{ => Input}/MouseWheelDirection.cs | 4 +- .../MouseWheelEvent.cs} | 32 +- sources/SDL2Sharp/Input/MultiGestureEvent.cs | 31 ++ sources/SDL2Sharp/Input/PollSentinelEvent.cs | 31 ++ sources/SDL2Sharp/Input/QuitEvent.cs | 35 ++ .../SDL2Sharp/Input/RenderDeviceResetEvent.cs | 31 ++ .../Input/RenderTargetsResetEvent.cs | 31 ++ sources/SDL2Sharp/{ => Input}/Scancode.cs | 4 +- sources/SDL2Sharp/Input/SensorUpdateEvent.cs | 31 ++ .../Input/SystemWindowManagerEvent.cs | 31 ++ sources/SDL2Sharp/Input/TextEditingEvent.cs | 31 ++ .../SDL2Sharp/Input/TextEditingExtEvent.cs | 31 ++ sources/SDL2Sharp/Input/TextInputEvent.cs | 31 ++ sources/SDL2Sharp/Input/UserEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowCloseEvent.cs | 31 ++ .../Input/WindowDisplayChangedEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowEnterEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowEvent.cs | 33 ++ sources/SDL2Sharp/Input/WindowExposedEvent.cs | 31 ++ .../SDL2Sharp/Input/WindowFocusGainedEvent.cs | 31 ++ .../SDL2Sharp/Input/WindowFocusLostEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowHiddenEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowHitTestEvent.cs | 31 ++ .../Input/WindowIccProfileChangedEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowLeaveEvent.cs | 31 ++ .../SDL2Sharp/Input/WindowMaximizedEvent.cs | 31 ++ .../SDL2Sharp/Input/WindowMinimizedEvent.cs | 31 ++ .../WindowMovedEvent.cs} | 20 +- sources/SDL2Sharp/Input/WindowResizedEvent.cs | 35 ++ .../SDL2Sharp/Input/WindowRestoredEvent.cs | 31 ++ sources/SDL2Sharp/Input/WindowShownEvent.cs | 31 ++ .../SDL2Sharp/Input/WindowSizeChangedEvent.cs | 35 ++ .../SDL2Sharp/Input/WindowTakeFocusEvent.cs | 31 ++ sources/SDL2Sharp/KeyEventArgs.cs | 49 --- .../SDL2Sharp/MainSystem.cs | 11 +- .../SDL2Sharp/{MathExtensions.cs => Math.cs} | 0 sources/SDL2Sharp/MouseWheelEventArgs.cs | 47 --- sources/SDL2Sharp/Platform.cs | 128 ------- sources/SDL2Sharp/{ => Video}/ArrayOrder.cs | 4 +- sources/SDL2Sharp/{ => Video}/BitmapOrder.cs | 4 +- sources/SDL2Sharp/{ => Video}/BlendMode.cs | 4 +- sources/SDL2Sharp/{ => Video}/Color.cs | 16 +- sources/SDL2Sharp/Video/ColorPlane.cs | 157 ++++++++ .../SDL2Sharp/{ => Video}/Colors/Abgr1555.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Abgr4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Abgr8888.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Argb1555.cs | 4 +- .../{ => Video}/Colors/Argb2101010.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Argb4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Argb8888.cs | 4 +- sources/SDL2Sharp/{ => Video}/Colors/Bgr24.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Bgr565.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Bgra4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Bgra5551.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Bgra8888.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Bgrx8888.cs | 4 +- sources/SDL2Sharp/{ => Video}/Colors/Rgb24.cs | 2 +- .../SDL2Sharp/{ => Video}/Colors/Rgb32f.cs | 2 +- .../{ => Video}/Colors/Rgb32fExtensions.cs | 6 +- .../SDL2Sharp/{ => Video}/Colors/Rgb332.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Rgb565.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Rgba4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Rgba5551.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Rgba8888.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Rgbx8888.cs | 4 +- sources/SDL2Sharp/{ => Video}/Colors/Uyvy.cs | 2 +- .../SDL2Sharp/{ => Video}/Colors/Xbgr1555.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Xbgr4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Xbgr8888.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Xrgb1555.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Xrgb4444.cs | 4 +- .../SDL2Sharp/{ => Video}/Colors/Xrgb8888.cs | 4 +- sources/SDL2Sharp/{ => Video}/Colors/Yuy2.cs | 2 +- sources/SDL2Sharp/{ => Video}/Colors/Yvyu.cs | 2 +- sources/SDL2Sharp/{ => Video}/Cursor.cs | 4 +- sources/SDL2Sharp/{ => Video}/MemoryImage.cs | 4 +- .../{ => Video}/PackedColorAttribute.cs | 4 +- sources/SDL2Sharp/{ => Video}/PackedImage.cs | 6 +- .../{ => Video}/PackedPixelFormat.cs | 2 +- .../SDL2Sharp/{ => Video}/PackedTexture.cs | 4 +- sources/SDL2Sharp/{ => Video}/Palette.cs | 4 +- sources/SDL2Sharp/{ => Video}/PixelFormat.cs | 4 +- .../SDL2Sharp/{ => Video}/PixelFormatEnum.cs | 4 +- .../{ => Video}/PixelFormatEnumExtensions.cs | 4 +- sources/SDL2Sharp/{ => Video}/PixelType.cs | 4 +- sources/SDL2Sharp/{ => Video}/Point.cs | 4 +- sources/SDL2Sharp/{ => Video}/Rectangle.cs | 4 +- sources/SDL2Sharp/{ => Video}/Renderer.cs | 4 +- .../{ => Video}/RendererExtensions.cs | 62 +++- .../SDL2Sharp/{ => Video}/RendererFlags.cs | 4 +- sources/SDL2Sharp/{ => Video}/RendererInfo.cs | 4 +- sources/SDL2Sharp/{ => Video}/Scale.cs | 4 +- sources/SDL2Sharp/{ => Video}/Size.cs | 4 +- sources/SDL2Sharp/{ => Video}/Surface.cs | 4 +- sources/SDL2Sharp/{ => Video}/Surface{T}.cs | 4 +- sources/SDL2Sharp/{ => Video}/Texture.cs | 65 +++- .../SDL2Sharp/{ => Video}/TextureAccess.cs | 4 +- sources/SDL2Sharp/Video/VideoSubsystem.cs | 60 +++ sources/SDL2Sharp/{ => Video}/Window.cs | 302 ++------------- sources/SDL2Sharp/{ => Video}/WindowFlags.cs | 4 +- .../WithLockPackedImageCallback.cs | 4 +- .../{ => Video}/WithLockSurfaceCallback.cs | 6 +- .../{ => Video}/YuvConversionMode.cs | 4 +- .../AudioFormatExtensionTests.cs | 1 + tests/SDL2Sharp.Tests/PackedTextureTests.cs | 33 +- tests/SDL2Sharp.Tests/SurfaceTests.cs | 21 +- tests/SDL2Sharp.Tests/TextureTests.cs | 30 +- 209 files changed, 5166 insertions(+), 3103 deletions(-) delete mode 100644 samples/AverageFrameRate/App.cs create mode 100644 samples/AverageFrameRate/Program.cs delete mode 100644 samples/BitmapViewer/App.cs create mode 100644 samples/BitmapViewer/Program.cs create mode 100644 samples/BitmapViewer/lazy.ttf delete mode 100644 samples/ParticleSystem/App.cs create mode 100644 samples/ParticleSystem/Program.cs delete mode 100644 samples/PlasmaFractal/App.cs create mode 100644 samples/PlasmaFractal/Program.cs delete mode 100644 samples/RayTracer/App.cs create mode 100644 samples/RayTracer/Program.cs delete mode 100644 samples/SwirlStars/App.cs create mode 100644 samples/SwirlStars/Program.cs delete mode 100644 samples/TunnelEffect/App.cs create mode 100644 samples/TunnelEffect/Program.cs rename sources/SDL2Sharp/WindowMovedEventArgs.cs => samples/TunnelEffect/Transform.cs (77%) delete mode 100644 samples/WavePlayer/App.cs create mode 100644 samples/WavePlayer/Program.cs delete mode 100644 sources/SDL2Sharp/Application.cs rename sources/SDL2Sharp/{ => Audio}/AudioChannelLayout.cs (96%) rename sources/SDL2Sharp/{ => Audio}/AudioDevice.cs (86%) rename sources/SDL2Sharp/{ => Audio}/AudioDeviceAllowedChanges.cs (97%) rename sources/SDL2Sharp/{ => Audio}/AudioDeviceCallback.cs (96%) rename sources/SDL2Sharp/{ => Audio}/AudioFormat.cs (97%) rename sources/SDL2Sharp/{ => Audio}/AudioFormatExtensions.cs (98%) create mode 100644 sources/SDL2Sharp/Audio/AudioStatus.cs create mode 100644 sources/SDL2Sharp/Audio/AudioSubsystem.cs rename sources/SDL2Sharp/{ => Audio}/ReadOnlySpanExtensions.cs (99%) rename sources/SDL2Sharp/{ => Audio}/SpanExtensions.cs (97%) rename sources/SDL2Sharp/{ => Audio}/WaveFile.cs (97%) rename sources/SDL2Sharp/{ => Fonts}/Font.cs (95%) rename sources/SDL2Sharp/{ => Fonts}/FontError.cs (98%) create mode 100644 sources/SDL2Sharp/Fonts/FontSubsystem.cs rename tests/SDL2Sharp.Tests/ApplicationTests.cs => sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs (79%) create mode 100644 sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs create mode 100644 sources/SDL2Sharp/Input/AppLowMemoryEvent.cs create mode 100644 sources/SDL2Sharp/Input/AppTerminatingEvent.cs create mode 100644 sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs create mode 100644 sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs create mode 100644 sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs create mode 100644 sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs create mode 100644 sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs create mode 100644 sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs create mode 100644 sources/SDL2Sharp/Input/DisplayEvent.cs create mode 100644 sources/SDL2Sharp/Input/DollarGestureEvent.cs create mode 100644 sources/SDL2Sharp/Input/DollarRecordEvent.cs create mode 100644 sources/SDL2Sharp/Input/DropBeginEvent.cs create mode 100644 sources/SDL2Sharp/Input/DropCompleteEvent.cs create mode 100644 sources/SDL2Sharp/Input/DropFileEvent.cs create mode 100644 sources/SDL2Sharp/Input/DropTextEvent.cs rename sources/SDL2Sharp/{WindowSizeChangedEventArgs.cs => Input/Event.cs} (75%) create mode 100644 sources/SDL2Sharp/Input/EventSubsystem.cs create mode 100644 sources/SDL2Sharp/Input/FingerDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/FingerMotionEvent.cs create mode 100644 sources/SDL2Sharp/Input/FingerUpEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs create mode 100644 sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs rename sources/SDL2Sharp/{ => Input}/KeyCode.cs (99%) create mode 100644 sources/SDL2Sharp/Input/KeyDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/KeyMapChangedEvent.cs rename sources/SDL2Sharp/{ => Input}/KeyModifiers.cs (97%) create mode 100644 sources/SDL2Sharp/Input/KeyUpEvent.cs rename sources/SDL2Sharp/{Internals/PlanarColorAttribute.cs => Input/Keyboard.cs} (57%) rename sources/SDL2Sharp/{Subsystems.cs => Input/KeyboardEvent.cs} (65%) create mode 100644 sources/SDL2Sharp/Input/LocaleChangedEvent.cs create mode 100644 sources/SDL2Sharp/Input/MouseButtonDownEvent.cs create mode 100644 sources/SDL2Sharp/Input/MouseButtonUpEvent.cs create mode 100644 sources/SDL2Sharp/Input/MouseMotionEvent.cs rename sources/SDL2Sharp/{ => Input}/MouseWheelDirection.cs (96%) rename sources/SDL2Sharp/{MouseMotionEventArgs.cs => Input/MouseWheelEvent.cs} (61%) create mode 100644 sources/SDL2Sharp/Input/MultiGestureEvent.cs create mode 100644 sources/SDL2Sharp/Input/PollSentinelEvent.cs create mode 100644 sources/SDL2Sharp/Input/QuitEvent.cs create mode 100644 sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs create mode 100644 sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs rename sources/SDL2Sharp/{ => Input}/Scancode.cs (99%) create mode 100644 sources/SDL2Sharp/Input/SensorUpdateEvent.cs create mode 100644 sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs create mode 100644 sources/SDL2Sharp/Input/TextEditingEvent.cs create mode 100644 sources/SDL2Sharp/Input/TextEditingExtEvent.cs create mode 100644 sources/SDL2Sharp/Input/TextInputEvent.cs create mode 100644 sources/SDL2Sharp/Input/UserEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowCloseEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowEnterEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowExposedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowFocusLostEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowHiddenEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowHitTestEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowLeaveEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowMaximizedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowMinimizedEvent.cs rename sources/SDL2Sharp/{WindowResizedEventArgs.cs => Input/WindowMovedEvent.cs} (75%) create mode 100644 sources/SDL2Sharp/Input/WindowResizedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowRestoredEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowShownEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs create mode 100644 sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs delete mode 100644 sources/SDL2Sharp/KeyEventArgs.cs rename tests/SDL2Sharp.Tests/AssemblyFixture.cs => sources/SDL2Sharp/MainSystem.cs (84%) rename sources/SDL2Sharp/{MathExtensions.cs => Math.cs} (100%) delete mode 100644 sources/SDL2Sharp/MouseWheelEventArgs.cs delete mode 100644 sources/SDL2Sharp/Platform.cs rename sources/SDL2Sharp/{ => Video}/ArrayOrder.cs (97%) rename sources/SDL2Sharp/{ => Video}/BitmapOrder.cs (96%) rename sources/SDL2Sharp/{ => Video}/BlendMode.cs (97%) rename sources/SDL2Sharp/{ => Video}/Color.cs (77%) create mode 100644 sources/SDL2Sharp/Video/ColorPlane.cs rename sources/SDL2Sharp/{ => Video}/Colors/Abgr1555.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Abgr4444.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Abgr8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Argb1555.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Argb2101010.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Argb4444.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Argb8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgr24.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgr565.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgra4444.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgra5551.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgra8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Bgrx8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgb24.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgb32f.cs (99%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgb32fExtensions.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgb332.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgb565.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgba4444.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgba5551.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgba8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Rgbx8888.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Uyvy.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Xbgr1555.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Xbgr4444.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Xbgr8888.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Xrgb1555.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Xrgb4444.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Xrgb8888.cs (96%) rename sources/SDL2Sharp/{ => Video}/Colors/Yuy2.cs (97%) rename sources/SDL2Sharp/{ => Video}/Colors/Yvyu.cs (97%) rename sources/SDL2Sharp/{ => Video}/Cursor.cs (97%) rename sources/SDL2Sharp/{ => Video}/MemoryImage.cs (99%) rename sources/SDL2Sharp/{ => Video}/PackedColorAttribute.cs (97%) rename sources/SDL2Sharp/{ => Video}/PackedImage.cs (98%) rename sources/SDL2Sharp/{ => Video}/PackedPixelFormat.cs (98%) rename sources/SDL2Sharp/{ => Video}/PackedTexture.cs (99%) rename sources/SDL2Sharp/{ => Video}/Palette.cs (98%) rename sources/SDL2Sharp/{ => Video}/PixelFormat.cs (98%) rename sources/SDL2Sharp/{ => Video}/PixelFormatEnum.cs (99%) rename sources/SDL2Sharp/{ => Video}/PixelFormatEnumExtensions.cs (98%) rename sources/SDL2Sharp/{ => Video}/PixelType.cs (97%) rename sources/SDL2Sharp/{ => Video}/Point.cs (96%) rename sources/SDL2Sharp/{ => Video}/Rectangle.cs (97%) rename sources/SDL2Sharp/{ => Video}/Renderer.cs (99%) rename sources/SDL2Sharp/{ => Video}/RendererExtensions.cs (85%) rename sources/SDL2Sharp/{ => Video}/RendererFlags.cs (97%) rename sources/SDL2Sharp/{ => Video}/RendererInfo.cs (98%) rename sources/SDL2Sharp/{ => Video}/Scale.cs (96%) rename sources/SDL2Sharp/{ => Video}/Size.cs (96%) rename sources/SDL2Sharp/{ => Video}/Surface.cs (99%) rename sources/SDL2Sharp/{ => Video}/Surface{T}.cs (98%) rename sources/SDL2Sharp/{ => Video}/Texture.cs (74%) rename sources/SDL2Sharp/{ => Video}/TextureAccess.cs (96%) create mode 100644 sources/SDL2Sharp/Video/VideoSubsystem.cs rename sources/SDL2Sharp/{ => Video}/Window.cs (59%) rename sources/SDL2Sharp/{ => Video}/WindowFlags.cs (98%) rename sources/SDL2Sharp/{ => Video}/WithLockPackedImageCallback.cs (96%) rename sources/SDL2Sharp/{ => Video}/WithLockSurfaceCallback.cs (90%) rename sources/SDL2Sharp/{ => Video}/YuvConversionMode.cs (97%) diff --git a/samples/AverageFrameRate/App.cs b/samples/AverageFrameRate/App.cs deleted file mode 100644 index 5003173f..00000000 --- a/samples/AverageFrameRate/App.cs +++ /dev/null @@ -1,125 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Threading; -using SDL2Sharp; -using static System.Math; - -namespace AverageFrameRate -{ - internal sealed class App : Application - { - private static readonly Color _drawColor = new(255, 255, 255, 0); - - private static readonly Color _textColor = new(0, 0, 0, 255); - - private Window _window = null!; - - private Thread _renderingThread = null!; - - private volatile bool _rendererInvalidated = false; - - private volatile bool _rendering = false; - - protected override void OnInitialized() - { - _window = new Window("Average Frame Rate", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); - _window.SizeChanged += OnWindowSizeChanged; - _renderingThread = new Thread(Render); - _rendererInvalidated = true; - _rendering = true; - _renderingThread.Start(); - } - - protected override void OnQuiting() - { - _rendererInvalidated = false; - _rendering = false; - _renderingThread?.Join(); - _window?.Dispose(); - } - - private void Render() - { - Font font = new Font("lazy.ttf", 28); - Renderer renderer = null!; - DateTime lastUpdateTime = DateTime.UtcNow; - TimeSpan updateInterval = TimeSpan.FromMilliseconds(500d); - int frameCount = 0; - - try - { - while (_rendering) - { - var currentTime = DateTime.UtcNow; - var elapsedTime = currentTime - lastUpdateTime; - if (_rendererInvalidated || elapsedTime > updateInterval) - { - if (_rendererInvalidated) - { - renderer?.Dispose(); - renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - renderer.DrawColor = _drawColor; - _rendererInvalidated = false; - } - - renderer.Clear(); - - var frameRate = frameCount / elapsedTime.TotalSeconds; - var text = $"Average frame rate = {frameRate:0.00}"; - using (var textSurface = font.RenderBlended(text, _textColor)) - using (var textTexture = renderer.CreateTextureFromSurface(textSurface)) - { - var outputSize = renderer.OutputSize; - var x = Abs(outputSize.Width - textTexture.Width) / 2; - var y = Abs(outputSize.Height - textTexture.Height) / 2; - var dest = new Rectangle(x, y, textTexture.Width, textTexture.Height); - renderer.Copy(textTexture, dest); - } - - lastUpdateTime = currentTime; - frameCount = 0; - } - - renderer.Present(); - frameCount++; - } - } - finally - { - renderer?.Dispose(); - font?.Dispose(); - } - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _rendererInvalidated = true; - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/AverageFrameRate/Program.cs b/samples/AverageFrameRate/Program.cs new file mode 100644 index 00000000..90153c1a --- /dev/null +++ b/samples/AverageFrameRate/Program.cs @@ -0,0 +1,96 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubsystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubsystem.CreateWindow("Average Frame Rate", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + renderer.DrawColor = Color.White; + renderer.Clear(); + renderer.DrawColor = Color.Black; + renderer.DrawTextBlendedCentered(lazyFont, $"Average Frames Per Second: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } +} diff --git a/samples/BitmapViewer/App.cs b/samples/BitmapViewer/App.cs deleted file mode 100644 index 65a07235..00000000 --- a/samples/BitmapViewer/App.cs +++ /dev/null @@ -1,82 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using SDL2Sharp; - -namespace BitmapViewer -{ - internal sealed class App : Application - { - private Window _window = null!; - - private Renderer _renderer = null!; - - private Texture _bitmapTexture = null!; - - protected override void OnInitialized() - { - try - { - _window = new Window("Bitmap Viewer", 640, 480, WindowFlags.Resizable); - _renderer = _window.CreateRenderer(RendererFlags.Accelerated); - _bitmapTexture = _renderer.CreateTextureFromBitmap(Environment.GetCommandLineArgs()[1]); - _window.SizeChanged += OnSizeChanged; - } - catch (Exception e) - { - Console.Error.WriteLine($"Could not run sample: {e.Message}"); - Quit(1); - } - } - - protected override void OnQuiting() - { - _window.SizeChanged -= OnSizeChanged; - _bitmapTexture?.Dispose(); - _renderer?.Dispose(); - _window?.Dispose(); - } - - protected override void OnIdle() - { - Render(); - } - - private void OnSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - Render(); - } - - private void Render() - { - _renderer.Clear(); - _renderer.Copy(_bitmapTexture); - _renderer.Present(); - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/BitmapViewer/BitmapViewer.csproj b/samples/BitmapViewer/BitmapViewer.csproj index 49d4ba6c..83ae8c91 100644 --- a/samples/BitmapViewer/BitmapViewer.csproj +++ b/samples/BitmapViewer/BitmapViewer.csproj @@ -15,6 +15,9 @@ + + PreserveNewest + PreserveNewest diff --git a/samples/BitmapViewer/Program.cs b/samples/BitmapViewer/Program.cs new file mode 100644 index 00000000..f118ee66 --- /dev/null +++ b/samples/BitmapViewer/Program.cs @@ -0,0 +1,98 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubsystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubsystem.CreateWindow("Bitmap Viewer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var bitmapTexture = renderer.CreateTextureFromBitmap(Environment.GetCommandLineArgs()[1]); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + renderer.DrawColor = Color.Black; + renderer.Clear(); + renderer.Copy(bitmapTexture); + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } +} diff --git a/samples/BitmapViewer/lazy.ttf b/samples/BitmapViewer/lazy.ttf new file mode 100644 index 0000000000000000000000000000000000000000..eb1000bcad0d83e1d1561bbcf191b2173ede705c GIT binary patch literal 103160 zcmeFadAuCgUEq7Fs%!7AuIhd7zFXf_cVBe1TZ?VQwj|4nEFsyB*Q`zgN`jpsB*bJv zStf)eBoH7&7Kj6k*%C!eSYikX1B_W_GB6pEnF%vMVBYW^1H%&OeSfFAudZYV_-%tJbDC7KNFM81?n0t>aV|u1NKj;FS37%{qYw)`l`o%W%U)8*#AFDSs!`X zD;~Umcl^Dh%6NU2W54_8{g1uUitN7vevJCPm*4;B!=GFH^#jUy!&j6F>{q_x!mAGd z=p%JyT>K**xBbd*dH9tyHp}yHe|kjv##HJK|C@i|zWkp5t?Cx_l=_8NAN<4N_Ug&2 zBi5bP2K&C$)gP`i|L4`ys$=}c)st5~Y~86_8l2RdKh{V7*t|_OhF7o+J3UQ06uT9t4^Ffd6zn%?9qDq3_RPHd&)=- zP{H^M^WU)P3B;C?RuIOUxb zxkm2s=M>JXU!i=AB5f>C-c0#^%Hx!GbNw<~x$kQ!FQ#0eypUp*=q{jSRUbB*3FvH!n;_fS4UDO2QGe}HQ^r;bp*jq+C%x$gg>a87+E z)yx{9_~i>^62A#^Hs*9-ED8 zps{dRc5c5tJv7+J5lUYUuE>|(-M-!4gszZ&-Oio3SD!oTcG=NQ4%)xnILv=qH9aFc zw;Q8_TEjC^M_+Q-I6NyAZr6_@r=_{ujon-Ox;4#>kPb@ysqfgzmXD*qGy3~RaCmUr z+2JAE)(6w8uO0k*p=aId`r6muW&7TCm}`c+89M`*ey2^z8OL^p71Ebe!S(OD?XFuD z<+|%0@7jwAr0ZQfw5^421P)r0)7M=$*x7#Lw0SvkUCkR?mP@w3tDJxKyN0f#9QnBV zo3|Q%wt;`oA)Z^#rdQus?>U+nRvBD(Z5K%TR5tp1__cjc!`BWBA?XLXY;gTn6Yj7= z+Lp>*_paL?`MQeN^~CmCgGamm(C|6G!FF5aZQxdA`?{W!$9S$>UG(mC;NZyiv%^D!dfv7De=MY*=D8}%b6ooj_lDbRXSNwtWY9+wL~-#ulYw zdRo50)>d5se9zz7*H^0ex_8~)+VvInnddlk-MenT{O^I&jv4gNv+G@dm+SYQU0WZK zO55L64sL%}eMgl9zVhW0$QL!XKHESp)1U2!whnANxDDKD=D7e}@7a|HN7%@N4nAAJ zwL{xZ4IWr3N#706q}$;7eN_wt704$He7>a&KHI?I;q8ZXts5@6@zQ72-`+GQuboe! z;rF%U&#v>Vi=<7tK(IAvf3OL!-&f^qsKWFUu#qzOYy*c!28XUcbN$}%>VJ4E-Ftnl zzqk1t>dKYZ4hcka*AD20v)AvdS}v=y^2zD%ZC~LwcmO`fp=?$keAd;^zW7;3zR@+; z-{tzfXEl-@kV;`TysmC8o4am5tC~@yqV$uCq8w%T*#-`eXSXU2DoLGf^@iY$+hLQ# z?X~mQAZaPx<2!e)RXH|1uD9uqGzFwDp|*g->*ZAXxmH#7RXd+o`ScU9kuvyf1M^Y3 zlS@xsJ0sAwz3rf`x$V@T(d`XH)W5FAU?(TH+d44>o>g1lSw9%3sFi*{$9*`Y8&SO^ zRKZrh4=zjZ zqQ9T3Mk2S{Iw8QYY`<*^4<1-H`m*62(u=NZq^M>pWmT3>MSpMmde(t*xs;xMjx*13 zXj@a?2pqI`!|CTf`W$x{9;%c}fHz(?JS(khSk2d}sw$t_w(lFk!O3bxpBV0?JKyjS zC(<^z*Zar7gS-4=s&23I?8|Pry;^S6Rb4&}{k`q$x&!G>ZQJSV!Rsntf9mhqyP>_o z?hQx(p6jnWb>n5V8(&GSx0E{A(Jb&Z<;F{++y#3I2__^+~ z{n)m;+rUAM8{Rax z`txmdXmnJKZhc0!pc{bn#5X+soV9N_c;l{aY}n%V_D4q98=lZt$s&QGMl@M3#v2=zoFuyi~o6Z-ao-%hfB?E4N}-`sB8+ zqv~7K1@$UwzD9j3Egn>d)M0f*-K=g^w-9x@P2HhxSI5+Gbwb^#cB)OaOYK&B)Lyku z?I#X(6MpQw)G76Rb+qj*L%mTwp}teSNWDU-3C)O*$Y)Pw4K)%(>4)c2|H zS07YApng#Okou7NSL%n=ht)^aN7cvFkEkD2A6HMRPpBVLKdyd4{cH7<`bqUu^y$y2 zpH-h!pHi39r`2WkbL!uy�eQzo33m{gV2udRqOm`W5v#^{eXh>I>@E)W21~u6{%P zruuj48TDK0x7F{c-&Ox!{RiTr|55#(`hE4E)R)wMR)3(rtiGcDi~6tXtLne0KUDu+ z{SWm=Dq~1w_khF)**f%oj{e#Nqo?Sl*U}gAY=5o(R$VpjGVV7XGu~}}&iqoZ)NAxQ zz0qF3x7gd&`!U8>{pwX(uxTLxQ;T5z2splyT4I?XPh)%u+>7bSL?NUJ>A0Q zRtt}SiHB&181L0zpnQh%CzL-<3*X6=|MB%te*K-)(Vwpz_{tqhefihF{NNwFMF?7d zcJVE(yoMsNQmHKw+_!58fX`bw^G@(3pY&UxA$7m{A4T2IP08PgQioLcpvJ%(c!F<- zmV~N=#vamC_OPbH7eRq<`Tubv2>JggZWx+s?zT(HKXK+K4db0>FBw3?>aL!^3*S0yx6?Rdkpq38S2IZ2L=ataW3J-k6bd|aDr>u zjEywqz}U#x2#<%S;Jgf6Z4E0M_|H?dM{w#dy6PIC-HD%4- z)P!GI$PNphZ^73sWRQhSvEbzvi>Pl+8$$LpRv&~svRReJKC3Xk>M_{ujn)Sia$3^)36%H z&z|dxr+41%PI-771UaQI8)1|) zKnwjDSYgIaHg7uIp1E^I`uwBC#ijYg%VaFuSiE;p4zV%E!@vl_^Pf83-P2t%?Ih^7 zybQ?FJ#S@+4H-JFvmh5La!xDH{Vhk*Shb8c^1Rj>a!_p8BOW{twg5lRHPNBW6+@Gjz;E~;J~7~!6>j99N7oB`JlwDIPv({Xq0$dlFia6$1F2rnXZiw#LeKW%OvAT4rf6w zo|>7A;!57LjZ7|Q*`eRb84hF6$z>X|E9KVRrw?5@$q+W15RAE;cuBqF&}P<_2l705 zK*J1U+cM0Iz((2etL3~^=$5*N4OQ}EQF)JJ^ za%|&EjI|I8LwHKaf%GwH2smv79>336u2dmrxc0oUruQm^s&E$>K@1#--b(kO@Ab1# zV+gX1=YRD15UAdvyM?0|mihc2Ib~QzkcCz2BVjHuJlA}Ogz=7CJYpSw%Mk%TaOIir z(+uUd_ugjBf76a!tya(J13qFY55jfzJ-y$4v^f~5i{ z^PJ3cQsCpj$3;9i^M**xYyCI|2xDv+ZmELo=#N78x~u1nYJZkjgUq z>#H=d$5>nKPddfr{@8NG=pX={ptiicT$diM&Q}=+^q=4C__bQefnD;KGhM@v;qj)O zH8b$dZs7V_WYDOan$8D!if zv|Q9Bcxu)63O=$R<7C3cm09=YzxQ(U>yHZ)G#C}8x!?R4Hv8z12c|sZ3A#jdk`E5H zA9-fT4ierMbpknv5k?SXjr_ zzbGTZRFISMpTfpuB4XKb$3`dlTOI3FHvWC0)eF zPaKfth<*Q(_ z9A`in@(GmNdD|nJ;Ceh@5RLOphVPl#V1&oCvaM{K%eSItGb@5wh{6i8B1UcB%jb9$ zr&Oy4VU*1VUa4I2yj);eg~_U$%O{~*trn~tDprBx-jyp(hTH1rLR%97ZA=7tKZ1JD zKLz)1zxtQvcbFeUA${U9j;Jg{L-Wl9zL~%`6ZmEVg(QsS1iqQTHxu|~0^dyFn+bd~ zfo~>5zL~%`6Nd0*_;HqKpXj*4@JcfFB->HOUKOGmaz%ktxijQu%axV2zBxIRG@_kC zUh7(y!oc`fn%6j4$3REb;swdF^w5JZSn#tM$J_a;*Sy9}d6o6O#_abB3cmNse|W!G z87Q*_l&2_D_H8oed4F4F%!kb%#gp}aF5_0)%i~>Euf|m|=!Yr#VTyj3q93N{hbj7D zihh`)AExMsDf(fGewd;krs#*MVLwdK4^vuxO!0yfjGzg6VJ~p1pkGq22L2X~e+%}& z-MEv!g}%~U@Cmr!6GJZe1YGb5xZo3T!6)E?PrwDAfD1kW7kmOP_yk<=3Ao@BaKR_w zf=_5J_ylb~LfemUPk~8#R4X#pt9{K05Jc&JsxXu*rK%{}1lb0f!y2XunlWr( z@Nc0r8!t3+wi}Q2YEFhU0T>`e>sYo6>kOROu}Nh@`GoV4Z)tc{PC(vP)kCk%gw*l; zpqAvFyh(-DQqS;`pk|YC;I*7+qn}cXa07C{Mg4HO+9?(CMur>ke7T%cEJob*rkM8U zcJ0ji^=2cqi2i2`ZU&!7#`BV_(P}rtV?S`LyMO=wj+aHfv2wkGhY$76{p`8O@vN+A z`}t0%SFCMx!a_Ez`RgxRX|LC#R(|Saztl_mHy4ls9xT~3qs#-JePHQ2S^g^?cs-u<@3O9%7JZPj~2O0CtK{jK1{P{_t z7+@A9^+Gf<(#39qGkbR4P1@zC6QS|Cg3zyjzeeMnX=6}1UOX8Gg!jcWF|oK(49ih< zrR0Y8YrgiaNjuS1{aiCDcUqnD3qEtdbLHnuQ}AqJ4}TLn)G@s5E`FH`nn`gz)%Lc= zRtkt!IuM~)tYwCi_Ny?i@jVB%M>RSM-+FlJkw_AWkKFPYan+8A!E+u zbz@WpYexhUU0NzRo)a|4p>+L;#0-MM#^y>sDksR&dc9)fZJ`4~GZQtF>PFqBhLtbG zIlHmCIGZ5PET=ZxE3X)#J3kU&6k1Vp>_k6TEH4(loa^V}f(5F5JUAJ%I$w6krLjj( z^xdpiF2xpEx_&iuJljn)7cg$k+U>diWZjD$(&XI4@tSZ1tYdgat6ep%j28yc#{OOT z?nWcy+sRm59x2&gWR^Uu6xg{sYCs%0)rqO)$-F(a(eRQmU(Cn3*fQcMX%-p%PSmh@ z9B+2#fnAH)Fi4zAwP9ck5E*L{^H??8=9BoB?ot2#lDd~s zbRXqjMvuiPvVe!?!hIYoGrESlvBmxr`$N@V_IGm4POcGnC`&}f9N@U<)u+CsrN}9y z$f=s0Wrea%*@@T+w7^7eYh`SGV_B0>Wm!|0_JP3RHIsKH%g?3775k2xETb>tOVNH1 zp!Gg710sZEFBzy^mFaT-mhpU}3IZ5(Fy>rRaBE9TOO=*z1}A=DNL4IPZXGW9uWL zSLNK=>OKP<-&*UBQ4#$+ZDAmHlFo$`c!F^Y~sodw$)Ig52!V zV&eBk+IGI0$51hYs0kiXonhmk2~?GEc4f@$+Mb6l8yHcbC0BAJD!=FNgy7}MmveTOubQtsbwcdYQ`Hvd*eg{nUf7| zD8e=UoNN1qA}YIKI8oRc>4kQ&7-MoFaatSg>`1~xxyUH2xzzoM>f-orgh7amvfaAl zcz)Wv>~o)(yDdrk(K zH8p)(-_PbdvB{htY;xq5X`)t`<;{9`Z`b^8-$(TRSmCy1_ zft?8vV50iw+BjhSAXBZE%$Vagnu6Fc=T*V@iuo2|`>NPy#BQut7;rf4*3k?qPTDo2 zvenGkET!IloXr{mR<+OYH6x63x)F9TaAS95*ura8@ox{XqjA(vTeR-8BEJX$)roO; zo8ygAXg4Cq^01ss^#ZPlTvW(me`c#eREpe^7sf$ptlbFB(24V?T6xE7bb7hYt%p`T zSU^O_dilLK-&DvJGL|p1ZtN(73%D>-&X;p`*^5e9uUah{|98Qz&WC8^bh~5bn*9oT zMNkYHamKN6Jd;puqH7df6tJ*^ZD89qFD?|Cb#CpA%q+}Jgi$1hgk78*3v!kh_&FzA z2yq$|LU(p?#=&nNxNgZ#u=%T5oZo&c$mN@G`KH#qn~bBO>>mT}F}8Z*V~ll3 z@G@beKDVP1Cx=Qy3~W`o73|t<-W58oFMu+~w!I(-##S9FkpnZj_ z=9(UR2eg`68ZXYAnhCQ9UVlK?@xIsYO?75-`p&81xcS=DrblE!b2#%|SHAi# zef7UI+VA2F5jT@J@y$ofb67ARBx8p6;JIE#c{$~qDX&7a__l#5{y3Q%^1fm?4;7!s zfnU!%yk5L@l_f2Egp-&hY>@Sen?|#=UrDH6^M*c50?{R3jw@eSd#U`wDJlXAM;3&i z$|@N>jG~R@)!o=ND_Xo6E5gyLT)OoyQZ#MDGM0orC*>;2uuVw9%H+H}JUz=aLA*Sf z*7&%L4zJnmggN0gCQc*^*Hk84d2ks*EZ`4vE2+U^IAJmGkSH&LC118td@~uZ>f+6^ zEqsGqX}&GvnE1srfg?Juf$s{hR(=*06j29D_Zoqf!!kMz6UsMgwQShTMq?BGe5GLK zve+t-?;}M6*UCgiMo-S=Ve^wE!#CY*YF6_aI2jpVS^QxB!3B-S;*Pn=oQ+_zXEqmC z#(gF#c(ol^$Kq>)ZT@w2sb;tms>+xXC;KueXPdxgg2@);vsSI$5S{ofs!qK7dn7Bw z*tn#=6STjHvWc#HiX!AJG1F6^dKi@WPT(OK7dc<#yy&|RP`}Q;xXh)#L_B0W$#xP_ zTEGLnsr^uLbQtm81l~)Hy>eIJ{lNPN@Il~%1NboT;X%tMfKLEF5MNRc1IzY}&oDZX ze^BXVl{>i{}1s+pnWS(6W~`9Ri-nLG!LSgSLnISD9!v_S9W5-e{5G z5<3K}58(qAjY;2CZi;w8nACRdS}Vj+m=qaYSN>bZxQQy*nvT=#5^T-8*ccXC+kX_< zYN|6={~z=3h%t%3<(n^)ns+yd)gIC|+`bJrZo}={aQimgz74l;!|mH}`!?LZ4YzN@ z?b~qs_K@4R;r4B~J#;fluAtD#C|FI&^^!UXd-expq+D>M4vIH_8KcNwRuxZb<8Yr;h`#^1GuAvmv0uX zzT@-`!?AW<*oDID;YM-AO`di8CyoX)Gh=pRc51qg0fr?tM>ryiVE6e-EpTwZxnU!! z^d}}O_So!nc>2D1eCtGw3BH0gc#6s9*6+S`Z2#+Qyelu$^1*8RhMyrSQWXccX><-A zx~a8xYO^CdXx&*WietM{#CIL|c*x_(C%VCe1UJC&H!?hlVNTxuid#_6o12@PO%K+H z`+Wy|*n)++bxaBHXsMT6{a@xO;=FV8_-SM1lDeD0bcS*_-8~ef8(-3x-2k&2V0Ht{ zZh+YhFuMU}H^A%$nB4%g8(?+=%x-|$jUi??!0d*W<3s*+hStTNABtk(R|SwejDej< zZS@n_>L<96+xq}@$~0w@a+GqG@?y&4l<%T^fbwz5rzu~cNKCjvs}0^qn8=Wn1Ri=0 zP5|$q&JOBq01x?~z^NAjdOQSS3LkUG@e#T_#7S{091v|GhyjEGy-@A%-no0i z>y9+c00ZSxX5rSmPakW@AkKuzcs%?3xyEwcBQ*e-B61d1fX$T#kjXKyv#q6mJUKlb z_ntqJ-+j|YfLe*!C1!yiF1}##rN4W7f2osm4D;rTw;X=kVKf!5EPM&!#djts`rU(_ zgHK%f0Jjt#Ao|`o+VKymn~aJmU}6njhCC$btLepqUPLeRpcfB%@t_wEdhwta4|?&S z7Y};zpcfB%AqO?h(ej`dPt%J>N2fHSeK#%Wp*5t37WB}99$L^t3wmfl4=w1S1wFK& zhZgkEf*xAXLkoIn(Y(aNTdJ=`OgGIt=+dSHv^9-&X|qe4UE1u@W|ua*wArQ2E^T&c zvrC&@+U(M%gvF7pP_od}P*#ou9}@qsCJk}hijY}G_6VZ2)vwPWZ6dKQ+{lDhpcJt( z*4H!*;Ndfg+9h_eTy{n`H#SFb<|7tT2QCH|8dbH~Erv5|yH=+CAoeioY{MVq3_SGt zhf6!=rXtZkP}03!stp2QGR;T=c+24_x%XMGsu` zz(o&S^uR?AT=c+24_x%XMGsu`z{Rl7MeWtyo_4s-Ok$L!BEaeBc&m&?Ees^RNlSRa zfU!q+zq2%&?~}~s#`&<#thRi$hJIPCA-Oeok1MrMxNOF2WlIVCIG@9NkqH79??N@} zxZYSawrajX`upbZ*wMI$FTOEx4F-)jchD zWUOrkW#0=i(7bSRex=%6tR2MtV890NFu!U(#%uqtOX^AR@(Ie5^x}|jZKk-{WbAD+ z_BI)Nn~c3p#@;4lZ}@jkHW_=HjJ?g_*xO|6ZR)YN@JyO<_X%2m`Ijz} z;=ih1u1C(f6kF%O*0~|J&Vj9SVCx)Lp95Rxz}7jibq;Ku16$|7);S*g9N0Psw$AC1 zbB23}v^mE;?gbVf@XLW;2>ikUoT_^gk3%I(2MOOOTq*YW27jCx`Z@sg=o-*KI{GB` zo@#BvZ&L@Jp?!pf)_QXu`_9|HEm5o0QWNXa9YSYRn>8W6~uu#$GTpaBT`TjK}P!ou_Xf?CYiCggB zReWdMK@8y(-SS<=pXgLJocjuyq(c0w+41s8g`gQMK;kfxbLf|rOGsMF&Xv>jF0%r+ z22sU@VhF4C!m4MMYGp(^*MPcmwT{+qg=GVy6$hy8B&7mrhQ&&d>qYGYbvhRgkh3Kt zQD=n(`9yLwGL`j)>E@<#7S5oGoVKE_@smzKw8d(>W?Ul-8J`CtR16(vTsx&!Da#zOT-*(gaJ3pSLI+chlwJ>oU(;-F({#vTCQu?Cffz`4l$ht z=LWuvu6fveJJFv&5H9(}sP>~}9S0?cMer=zljPBW80~%&96Q=Uy5;TEPKp%}Jm3dg zSQBO6AfZdT4*y%=7UmdbnGBp3Ct((Ea8gXf!)cet5|}M|`DARx)kZGsc}d0a>xLO* zaour(Cue-co>{2ig177dQGVtBXw%=Q;8rMj<%vd?9K0|jm>L8qV)*sqLYQN2UX<)8 zF^0WNr4_~PI=Ly8N^CMvaWjCJC{w}3X4^s4%NO!-mITh6^v~VoVBCf;;6`Ix9m%j}pxihiq;I!tYOt<*WT) z*vjNFU@)5w$-Xiew6c=+uJByOw-{L!{MjHS0#n#u3@>6-uQGF9cB-14h}?29v5H}F zKK5dKhHlQsKS@|$_uPZO^nfIy8_iaxREbMbdA;TZff-gSVLc4$l>$zCNN#+#?=0TG zSl>~DkK}`7vas{zJ4cqs%IBy&cWx}kZ9G2R528F{EJpw~@)P_nX^x(xV`oPDouCsY zcx;MjRJD!7&jtSC&hsWB6j@?iB#L3+g%c3ucVE3~){HkXckBU~RWy;h zjNudLYoaft{6!pM;!sYx2;nF3-&>P}<~5hHBs8Qs4?VaBx6#=k^sDAllV!6g{;x(h zXm)#1adCMrVz5Ap4Dvv7n+UI$vc&D8b~aZCcuu=eDn5eJCXykHt?`*D9D6>(A;*h~ z?hmyZIeb}gZfAaF=1)d&Vx8+awAtFU{uj9wNfZ#W~9lmgrNs3B?W>|D4E9FC$A0Clicd(+gfQL`Rh$ke52W3}$ueOa9XWO@0kR}3uU2L zDvynhRdS8)SmpUo{&zeNQJY6(0z#N;MU~aL7WoS{;X;yqd`1*mKJ~JL#KwLUBM_gh zh%TWs7K~(`V&CiK`ZE> z6?D)FI%owQw1N&=8S0=FbkK^{K`XQtgW(tkCh*X|DX{o9=vkj_%)*s zUgi=+lesuzn3ur79uv`}rz7CW76cFVIz6H_VTdmXC6Po*&O$x|1D!E$lB5xNGb_u9 z4Hk*!1i0eR%0N=__LH|JqLqmzhS|{AweJ84tc{A}lNdp#i5Z4}n2dg;wH-C0(!Tv` z#`77Qah>(G?0V5~{en*-RCS?_a!12SA-1wng1SNc66MJ&*u|0r>@!5F+ywK37D-a`)mZ<+s^?CT@yZ!W2u=|jo>^{}^QQw@F=4Ssg0!Ox<> z&!WN4qQTFikj&!WN4qQTFi!Ov<9erOY3v(&i*m>7;%frnn6 zn}LTO=~>{3XLu5}Q*5VrGI0g}^ZA-qXmv$sA+@y&;^IZA)26n$3VKEGnad3R{%Vno zogEts8$>t(&99&oBq>9G)ndnNZi7z!7AWXaW}9Hbg@R9P#22-FXB!jcKK@ z1f$! zq6u^i<4wfC(Cdq{JLW6dDrSf!S+~>k)6V+s%S}=dj1abkkg+*8I=9jaYYzLxk&Gd0 zcQuyBisJ>tj7tUd;ZiAEsRkK;?1-Vz7RPR?MzIJ*$#Ar*dd`jAUb=PBB$A_5WQ2EZ zy6O1@PrafSl&TCjGJ)ZSeesyk`=v7Z3#46*mdP!YZiRpS*Qd}en(_$cHIz3~-beWu<&%`pQ3n32b@~d2%ZJr2fPp5rm;(s?bkGW zlP^KFP9_i%*8+@5RD`Ts`;CudVy9Mc3qBd&cF<}W&3XW3yb^gQ zxrvtflHY!bzS~QG_oasLt5;tAE#pb!7s1DU>LHmvB9r>G-){pxB@SfmquYS|H{eqn z@Tm>>)CPQN13t9@pW1*=ZNR5C;8Pp$sSWs)xS>SwmGJ zWB#Rs%s!F>Y2Sx)Xvf`hMURF_t@laJHOif+1Va9j{afnDV38p+Z+w?U=1!R3b9jH^ z1!6lOFLC1rwW`;j8FQks(H@EELC(uGJ1sZU>~_5!$TJgQSLNV{^$v zoHIlgb_DfCg`{|qy!T@BWy83hbrY{nNQubIbaDLF!~2`0%A+)fSufABxzIXHD(Eln zY=@DR&Brr4=BlVhUN&jx9fF!hZ?TOgZc65G=ylg*JbYM98oy?K0YUz|m+99sy?+_u zu~QRgnLf+Xe_8rZ;NcVzfrp;^qrgLdyTI*dWJayV;7%~ObBMv6U~nfGltm(Ta;KeO za3>ht2?lq9!JS}mCm7rb26uwNof?BXX>kV9m+jEN5qO!qEb~+XuK}+C%iV7V7MUkg zgl-4h8xrEn8`wAE?Gq=Eq;P5B(83%NDiG|Wq6?b$q{ioZ3NS5D`wTlQfc;x|*Tt*q z<9G zisoGZWY4V3PGV69?d_BF2+pthoZaE8hf%B&)y1p7WW3P)d2G0wBu*)dT?}}Nf+DGr@)QL{ zDkxGxk+K+sf+7_Zsh~&&MJgy#L6HiIR8XW$X(lqkTYL0?*d#+{EbxkCeC@ubdQ^0T zQn*Tga&axLA~zA>#|-Nb4u)k%MY5u1iTLf8<( zl00r+xmM3+E8>dA3q{3TIX3gfg7G`j1Lr?^e(bg}ZTN}ijxV{>>t*Fkg0PLyM>*Qr z+qvhH#yIW?qPuY+c8KH{>a$n>#@u0k4j)88d^1hW14Pjn0m~Z>$VBcx=iDRxR*B|@ zsk@yqB?Lhhip0poQJ@tK)Q8c@$oNy98msmCc|!W-nuibWO58k-)M#!6&p;`NJCUcw zPk(N@=W1s_e&4}$@gcZLkt{~z-*#g3QZGNiw?D;ezp@Mjn2a{*n7jU_qfhB3!48k{nJhG{$WMM^;_&ciK=PhD2VTuQ21 zBL1-4^y_ca$7QN#vddFFmh_l#D zXVE*(qIaA{?>LLzaTdMfEPBUT^p3OW9cPDn$654_vygOZf1hRaYTi2!rOyv3eI80@ znF7itdl+hV=?BaJ%E9S)B4g7Mu3d zB99v9L&lX^NWy@O--$nTV<>Qo3Q@%ja{F{E2Y$~Dd3UCEDX8T;;hSk)kvC7z7 zWo)i8Hdh&&tBlQ6#^x$xbCt2V%Gg|GY_2jkR~ehD!?C%_*j(jt(L}k!DtAo1SbCmW ziX#U{6M6}G{!ANS#B4~WFzSk!Xvl`tAay1PK7sj;c6)<<8Et}VYZAPV8ecbK=27~U zsD9fW2V-(GrMvUJmd+y~eq7B2L?J@A(P{g$Q`yXwpBH6>=*8;ZJq3q_pmpAWk7kpU z^JC+qk&k2YePowsi6Li8{`gYKECjflm_9Hvo`?d(=phXSt&_o1-FxfFr`KM*jz25z zcUWV9)lY3Q)dRb}XZLE7#gT#MB+#^msGuNgy0=IOo<59b(Q7swU~W z8Pa~7e7W4+Fn&cw-7Q{=6n@W6a193eZ11L#?A-i}Pp%{55)F0p!Y)1ZzTa4$TX|rG z5Wlu6kyh zrJYe)TAGVpyo6$~qY+O|PmoxP5sLB1$E;+Hx>pFxGo_Umt}=s~a7!%|TFPgO2sR6E zqnPVf#&+T|87Dhmv9mB%L~_DLvN>1Y|Fis}&lj=NAJLK8y;`WD`V00+r=u97JgZD) z(Es?}C4eN{4TDsq-|HJ9n-iZlJLOQ14xGL4Z@91^)!Lu#`6NvBoA;4)hslIF$Y z4Oe!qggFVkW&`6vKeQZzeUg!h)H3~6vw{&FiQI2nWn zJUDNB-uMhFKz>EEPF#}cvWq$?KXp2$ucGzZf7X1k%j9v@)S~9#efT{4TT!}Jlv^MJ2m!jhD*E_1%iWRkR{lh?{?%+HZg5DjRXNn<~* zyP1&~;z(`wx`9dbS*B2+okkLeW}yYssn~JoPVJb?RD*F5ORpU$pP0H5@zQ z+)1K*H@@jR4nlmU!R!vmk3l|vex7)fx#P@KfM8~xjgcvZ<>mFY+U#j?^<^76 zS+A4%Fk8`dJ=BKbV3{`r6OsfeQwP*VwCM~+nJB=k$p1(6q!c5Y&)XqxLK0B>33EVA zri+_Kz2V2c;ov|tVJ7H+@SL`0o=&S%C4|HbRZ^0(#=G?VlCTgbesQuK7Q$M+fLdWyZeZetb@gOtHo=(U?swq7ULUM$M*3>svPA2AOYKZSn4 z48wtyFPg+Z*%LC<0bod_6};kuY#>2CU81E~%C3YOm@FZYL~Y2VAxG&wIDDG4GKe1v zSvVC@-^Cbm;QM5hYj2cPoi`RVo!F}#2*Qs_IhkLJ&?cEUW%2F^^Xr0aC$POB&N45b zkhPa*k|t}Cg8|d5Fo^<1VlwmS}HExIh%Bn_C_~9Hrio|76cdO&C+JI%wn`<)=kNyP!hm0$x&;p zG^3(vm;GoY@xdi|APe7(ip$S)F#S7|WkNpda|I1qB>_dORGhhEf>>X9 zZhonb%pl8c7awu%$&%kpR8Fx}o6Oicw6)o#d!dmZu#Y#>;6Yyn`9D9Y=LvP*~ z(OD=XyNoJBLyt4wF&$axilPmr|0$nE=}Zq)mgze!=tLj+5JA&S(x_#<%FJ}8(iu(X z*IoHiD#OM}b4te)ukS`)nfXHG;T8J@gSl-8b`oQm@#;DjlSezZpLiZ#cHbYn`|PQa z1jlaMb-I(YW7T4(Rt~G}B8*S31%8S;69;0YWagNX6xRK506 z5kq<~B}_uOurl=UcdOX=Yx8k(@?T;^m()uU@-oHcrF7O%F?bnp4O_TK=gEAZ8vAA7 z;Z(Mvk5-N!OYP-j*vrR;_VO|8*7`55-{G3@1I*vrSTmycmD zAH!ZgrtRe(cj$39u>_V%`C=>rW@^=E<5iglh3bJ z+nep;Vj&%FyD&`W_2Q&IeY%T zX=DD}d~3Z?nU3;-gX`9JSzM_WR`wj&TMee?`i_&eS?a^#=LLftwz!szdfiTASyhaC z%pXA2e9=}Wj;yfv&*1SE|Nl@S6)MPqm)tc+x0yQo3dSIZT`Q7I%9GLX{wu%r0X^zI zV9X1hOa5OSI)Ax(fye;xv87OHSzxgMq_{z3@>LqP9Ms5&g)QzZH%<8y)-OnOT%!4D zP;-V0emr0aizI4zLDP##aV(Hu9q?l;A;_Ws-O7oRM}kZgA?Qf1SfXE7V#&^Rurc|? zme4H}V%zocg<&9N%#k~8-B*y&Uq5~RbPGhcTzkX^1H}a_13&bmPPY@G!})WI({^l? zCL2uuA0SVq?IakPsSZAa$TmM>3^IM%!3lxA>5L7B1W{>(fC(|zIDgRSde&r$|mVN zamjOXGChDZgBh-i5r*bGOSf%AI2OyRZ%<9CI;)rj)#)np_$w^qLzs(ofCAGm1ZLhM zCoC$2+w^SITHB0|Ja3OnZnSG=mv`?e`>ht?epwa<#n5uBLXR`qdm>iu^ZOWNELwGTf(3&d4Om!4nPQ9w~ll|Zp({WwIW^huYA@`cf) zXqO_Z03*%$&4QW7ALSwd`?Gx?!eh$2pFMi|P7(m{f`w6q5lJ8qVH}iM=7v~{$y)R; z#-914`K_!Xf0Jg5_sQhNq83(?ozj8cWh-9VB3tn#$yV$IIetP`^AhqF6K|da+Xu@O zl_bqYj*BB@R-~S``bDB^^=DwKNkWF3kg}{jDx(sjUrACtfuS{lEHLDP;y2tFr_;fiqEGcJ@AUom>f!sg%oH)sTfK5rnXif4p}ta;oY$X5cR<-QWTgj5 z@HP0gfRgbC=Ifc$S(HVR#rI9`q-*u+H|O!8N~{ebT5$?&b7uBu4VLGjKeVZp3UpkY znu-zmLbW7iW2WF`6XwC1wQtqW7nQh?WImLXgKoL$>)HvFXJn*5)zevS-!3 z`o05uYcif2yZ7vFR+p3Adz+TQS{6B6-f___PfyQQSu2j{xXCXZi(HqLdTTA_I|5#j`zR<_CFZ3}8Zb*Crr^I(j3H)jZ@zs)r@;Y*h zglZ3Q@Bjx7K&h_-ek1T3g~e+e%t#bdsFQ#6RB=o}ijqMhhs4h#i(8qbO~7u1`7n6< zoB=`le?$D*>nk`TQf>}2gJ%iXs_x4yTWGv`x)cTxNl5E@0w;0MzY|0eKr9n@2PX;3 zClU(EXG6!z@x!_BY&dng1~$Qj{?t@FcWkm$6zUIaJ zlD3SXEA~3w1iL7*a{O3LZu#DY+(ZN?Ci7k7-qC&t@h+lt33&?J_(;WiB@|O_I(nq_9QI*BwFoBwAzzswI|VPPomYHM5{fi zwOVQMEnlKHWuknGiSb=+rNE(B`HSA-Ukow4AQG5Q52S1;)j!hkwuLb-9SA?#qV=^2 zI$w;r^a!W*b-GdA>9R}8gft3vFn!-))`IS4%Nxlycdt$`*%F4CCLd(!oi zk+?R|X%J2#@?kkIEzL|#MD@vXv0&9}Wbe6FeZ1E#B`IHgi*liZcdFg|GR^ZZvn+;W zC2796AHKLBzPKO0xF5c_AHKLBzPKO0xF7o24`195U)&F0+z(&eKje%1;fwnr89jcq z92yAUluL;ak`d)^!B|HFc zV6nbu-@Yae!ED|l7i6PslHT3UcN)xL0L`9V5;vQRRhp^ym)fN%xTTH4yX)}H*yu)< zRW$HK#BL$yRtuOC3+I;$qb#Rr810S5$i{S2R{N{$-M!30tE7R)o&1iIGeOm1xeZ~4 zc)^J?u!aourr8qHfK6li>R%c!z}Bd;>dW%b^OjnO!w87j31X+pR-&xKc+$j{-H?>T zpm+Lf&OVb2n6(6-mQIslU`Q;aQXcrkNXcM2y^IM~HZ{sDKI_7}B?jcAM#hzQd*pB13cq{BU(5M44QEWwGL2#0*lYYz>SIPlz9FUN!-EsH z1d4>9=tc8;#4!7_XC=&hO$UU&W;z*kA3n@FvHmn2kBe&3TqYOhUiC8LzDw#+9#@v9 zd6aiL$2*+^9`@Nej)fcxIVP~+UiweqVHUW+r|D>v2#5_5rqTSrbiQz*@W5b6Mcz9!h z$Dg6lkide#$pO3sEUW!VJMut#fDZug1wO*|*1`5TTbVX3$4&yD9MpRd_`w1E2(Tr(9v`mV_ck zSz=I|5vdRw!W&MhEJ_+VkQjbPv~ch2CckmBt>M;Yd*B(%R_jOcY@uVbz#UonpS-JJ5rN=sg6<-02-ceRFru z8OEmsx-7u~@?_s;{sa71+w(pl*)uFu)hSE$PoS>^56jg!$0m=sp$?_`$m?&#o ziib9n)+_K$ba7EJAOmeIiJxR_NC8z*X2eTC+98qH)QTedAQBG~Gmoc0=FOlZ+G{_U zu0uxFalhO>oM6k_CRxknKqe3g|3$%VEmXaFjhS~XI84SS{n#mObn4S#KzfgrYmh}Q z5e#N1+xfWYN23KzEDOgzS}x`rI9!l2IN~i=~7{)kS7tLTN-oG-2iJ8BF7hJ9%^vS(OI5GXL%Z( zxpay7!l^)KJnwjpw>s-MdM@q3`(3^ z*}2557$(n>wp(y|U5~WREYv|9KJP`rmHjwlZI2|Rk*GBSI?Q66or)J%8xm8TAw@Hj zsf^XA!}3Lh$0EM?fMR!YZi<<{BsFCtNiWM>xjW%>z1{NsQ72!DqE4OAC6lWlCok(X zI^AqQGD$8h?MRsWTd0|47T0W4DilK&=u5a&T(0j5JCh6ioC`q#md0n+wahT_KV?I> zgqTJ{2pAK=mi`C9kd%)SD6w;`WFzh*OK~;L2SMZ+ zCpDWvfpvA7p~dnFVy#MECW|Z>=8wqm&-XAPS5_9u9RxF?ugY3iW@YdG-DR?b$;J@d zQWjd1G5Z#Nf$?ee=w*Ho@GzrQzu!gP?;`Jak@vgE`(5PyF7kdCdB2Oi-$mZtP5#b^2Np znvJB^DYqoC$f2h38=4tr*AE`i;V!bJ!a6B9#a1OAi7InD<{QLHbz-((O&U99XKI!C zN_lSe&|FX`l)^@XoFbPg?iCbnH;~-)82gm9#&c`C*72APMnx0wHmHLtdCM?Yszq40rM{32;MJhD_EBE4fJ~gb*gP z65Qv0_OGP2XJ)PY&tRYG^E)M}B-L;K_HRGF`@8GJIC4}yXI~JRQJoyrLd4G8u0{1wu8?ooWJsJ+-kou&!G}RiGr3E7cPX$U z*9^;5_(T)flnHKTeIu9+ z+Uw0=&Nbmgx5$h^o*JwSWhl99Ap`$I1^txD!lO?61!(uvey7msHZp1jnayseQ0KL&JE;OM zb;~(FfQyL~F^~$EK%g*-n8Z4ZK@ob1DDOq(R>esImR`AiU?GYms;Ouwmb}1jpPbfi z`voOCPwnq%AHyCdsVkPS6pX4`fC`puWn#(F#hm|VI1X?KhWZYUhdCbQc%0+MIiBYD zB**7C1T`&rjtSuGC}VOS++1#CG!E$+{8oXojgchsWk^5;WhP-XZs^8XOEt&oC>1zU zErghZPe_zxMSA*RG}_o;SO~?iBsn{RCA8cF3_}Wjde()U&|6&S!+MoTS>PCjVg)lG z-SIUHOuat0{2RnV(sLBG6MF^7hc#D;tb&s=j=%f3(VOWRDxX#Cck3DW>$B~_j9X|} zMkZtCW*@%zn)$p@jvTZ_P7kMBQV^w42y-huHLpcb|MD_`y%^6w!(GTCP4YW-F4bPr zVK3>hmvq=mI_xDK_L2^JNr%0p!(P&1FX^zCbl6Ke>?NJaUeaMN>8QQ3!xblpbQw?b z{W6~T%<`^-7bGIe-V=_ymNhv!31ozf(>y_-?lP8-DnShyPcA6Wp9C^wEX7>0|4HtA zAe#^21~TgWHTEi5Gs=^YUQXR*wPkF-X?yH59(s%FoptDuLl`kqL7-^|-=y6htL4qt zZ7N&+wVM+sk5*gi0`mM=FMLqDMQ`iBkNke{vP#8?2X~4OR(c^uImkGU!l-+_%QxTU zUhi_Rce&TQ-0NNL^)B~%mwUa-z24Qu z<%HjgUf^#&=YIf`_IvOV9Z>siJi9W%Fa?P9^b$qr#72|GT|xy$jw|?vf)WtH;Qj?* zfN?*dH|N46nW2lQWfa&dH&dmR6#zU4xq*`zIpGMkOsiI}S#G=Ca-nXzIKm_g|l{Rmj>5{0^n{zfFEr`*K=e@|&)B0@=N z!AYBv>=ytop=TWm>(uS}SRV--($uT)Hffg)G^x$5gQ_txOrhx^v+|Uv^Hy&ih-iVVRK3~A zY^>>BZZI5K75EUdCGlNwRxar`>si5-_`I1S0wbF!$(z`7WiAEbDh`C$N265&X`6T; z{4ZuOvntDV47U?QKXrW->$`!Vb?Rec&i)pyjWQ`VDovvLd7OY%n zuZsXM`?w}}a`{r;uq(Kqu3Z_ejVcY)MiVRAGCM~OAL%rY9zIZJo636HY(cVxf^h)g zV|loCtuo|LSi`&n>_!>b_Nku%JR-pfelp|(FfcNLw1n(BOOF|f+H6xdD)p)Xv6x@x zNit9Q#5eRG(EgHbd=@5&2{cGDhtq1pUJmY&@gzoDyP0O=70gjAOKU%+xD^ zwbsj4G@C`lx|S$`PC8!<0JYSo)F~qTDeC8Fj{Dtz_ZAR$z(~wG6{vn>Uh|g!8Z!gD zTPwWV4A>>|k6-!vzs8Y6zOrtcF3vUH->;~18HzZw1PJ(!A5YY^PwPJlj`B9mAtua6 z7Dn6K`KXgEFcBlyz6}=UIj*{ig&D*My8zoNnAlbUw>iK*2v8>hwpD;_6<}Kh*j53y zRe)_3U|R*)RsptEplqwjZ4S7y%k7k^ku+n$p-YYXCgZqnEFMon&@wF(yqt`$=lR!5 zhZ+IUUC(i=Xh;bI#~Ty>5{(fhxhPOdSq4|Pa~=?_*VH4)T16AqFA|(GhdWrxL8hyn zRoi;9-N<@$9752cWt*PLl*=K(LH?9YpAE;XHk$VQfi@NZYBo(WBgz##qB2k@`+mA! z%NO*IC@EODyNAcsKh+mUP^UK71)xLbJ7ZL8<&1htzTIh>d5S*BOw`sF*miWSuryjS zCCS_y4nL^r5#127A>xiK97tTJKcY7hcap7;UQuc8!8oQqUfZ(Bv1jmnm7lE~?^q{D z+C{0*oiukNQuys4iZSq_5YpZC@FDe~s*4K?WpCK;S-6;P1f>{6j*>DnVe|BQZs%w_ z=M-IY_RKVUJF2RH57t@Q98Kq%C$2v;Oy-j?0y(Q|i{{{lzSrwcX`e;~ep5*{faMS$ zkq&HmKL^P-{D3Zh7abL1&6e$y<4_b86%81v4Lxn;a>81l)5_CzU^~eijZg&UWEFz~ zRCXC2drE^;W&cC_JNj4jztoB}3O}QT&uQ?tYiBvGL7vT6o=xPLz65cFyoo%U$g|09 zHIZi%c{Y(}6L~g~XA^lgk!KTmHj!sj6>w}^ElJ}0ILUM`tnp__yn0Oq7ErlQiK_z>h{HV>3fwD?v z>ywbbBWQEEn*1ac04p8|@n$m9R^?OSyp1PS&8wJ<>^(>~DgmR6Qrp~KAVzIg$c zE(Ow6>?ziiOG4XDP9Je?J0G2_4o?sAVLnM;ljQW-MYRPl-#DM9m`18q>FQ9L3!MH` z*UH&Bt7pr{AjQ;Z(wGp{Lf=aQAcT-|=ArAaucpe)ZqbLj3E;0?@Euh)7d0uc1>CMefJB=3jF!{prIe{rvh#CVh%X;lp{lNN? z+noi&l&<6#ZlBHVTz|rqVr{BP!~7IaBtS+6JQ?n8>(uVqX(w%D_l!U_)}3(?$BuN#P~!mf+C$W<0p-y=nUU)G9!p zu-Nzv>CwEbBiIbFXThOh_<($|T-XjZOn2z1?SqF_lIb7=_KOG|7pEN5fhNkPdtvq9 z=3?PFDT+#A`~CHPNBb{uqAVpIm)gvXGHf!e`xNUw6=z{0v`&Q9iO@O`S|>v5M5vPp zUok@KL};A|trMYjBD794(K-=YCsJA`;)=29gB|6td5gg-C4Cc$9NEC*API31GWXKB zRarl3HI5xY55t$gX)`nSsbyg=Y5UwnHW6+}ZsXx~af24`Sdh&S5QqhbznpOvR~H=? z#ixO%|Ec!OpRxup=27)3Yns%)c;((NN-9MDQ|D-El?PTL_VMo~Tqg1heDg#MGY~zY zNb%z4Q^Fyjw1(srW8;@Bajb!G{TTdi?C%wzE0%ScDSC8-gv!u`U6b{n25=FTgEWO- z$s(+K@F5y`dh;@&$wrA6;49_z-w_v)9xP+lV25-x{ImeB1#(@@S4R=z8hZG{1=n$M z*39BOjm+}a>})q368Guli`7bv@AF&xhqd?XpMra`CAEhy1>YrBu*^j4h!--2LMK9n zGNUFEek_b1`F~AEd&Y^d?#pHL8Z^!$$dakUB?WFb%aDMorzEL9lJGMsD{xGhim5MYnw9H;SO|e=>D`$cyaqRF4K$fSidaD-{ z8g^U=C2ylyYg?;%CMP$$y6P3X`LHQ{)HKW|-J8OXp%AEa-Ra#z2Fp&RT~%jjP3vtR zI6P!Nx?7`B)5tijQ$5}X2&|_6Ald-6pQGa@9RH|7PeN|HWs>EmWm;_IJ0`bu_V;GBz#J(~16**IE zkce`UjMK(C&=DZMQk=Ij;ggd#DPt%4YRE=eH<&ZAr$9${NxC6u1jKVjtIn_7!;9;iA^ECVorHk@bBrSl4Z;KR{EGgBb^Zjovi zZ5Ci7*EGPQfhkO8$}=tCvKyxsA*EI7kJ80#`>t2LZj_`%G6_tf-kqM7V}+^P<*01={UE=#y_zv%-o+o^U($YC|6<}hL1hoQZ_?TGDEM{J^{d>_ zC2pwTwPbvdu`oVKz(G{}#KAzpqezfg^`q(-fmG;HYay`)F}=8jejD7>bClw``;I!=$K7!{Lh=SZ@I@uSptaL*H;$WKTgzmC;XVR4> zkrjIT)@p*fBt<1YieIUMX;0CLwnU*ntzpR(T6zdEwqtFejDAs;Q;SMaAn>&tZ@Ia} zq^2#y3(EyNPeGDio10y1c~J>MYY%FMl$j2b5{0BSY-6rM6EA--82H(G#WD=lVIIz& zRE~zu7&g`IC=FdB&dRqwjzgl>`n8EK>#tIgJ;`^;jp0WS43q*X19uX4lLxsQ%81oo zuL5s|VOi7jv&GKt?y(Nh7K|Gea6?Nuf(PgP9*U0h|F4R;`O`Gr0xW5S09?!@L~AO{ z=Fd~(aZ!L{-b6YTY6+80XQovFp=G8G8xHuCS!#VBAx~PRO-)Zxt!vTdvpqdG zXmUM0@!R`9LF{vv@3yLZv+EmWG?CL@t>-b>|i1V6N>eV#ob zU&@89Q7sXdAq^({h7e06xTw;DAraqoJ`jysx!-(t zao%y=jDe)M@$UH|vbz%w$g^O|rVbZTAolf@|4Zi+v6iHNLp@K!hT@gWNjnpXV#)ZJ z$m>~?$2ujK4t6;k{%s^hmWzf>LV6DWM7P^^%1k+Sg$0)n$Flqx{b1soScW1q@uu^? zZWpmip2$p-?}H)8M^~Z7dz7ra{wuEs4`QU3HWrdMJ^2T*gwX7P*swsObgun;;-|DP zYd;6c)E)4YKb&|Sf)p+ooQ^@5Ax_ zHNsg$Xr-hhQX(;kdIW*En*a}oyi6h|)Iz=>c?Fw>d$#p3k-p3UQ6Xa@OkWreEk z534q44$45NLZUxL%9nIGP2(}Bl4lM2r=im!<$zTgpG$~^*gulD2Q-b?5|(Uj2?D%u zNHa4W6#hnlD16U1JuOwL)X8kaKu}lgcA1hDl(;Na*4Y&CAOXaK(!pVYd#GL%P6ciq zC734N2za9(A}4OVmt94Og0%gc6E7r>Caz#F{Qu3}WUEK4xRV=GNFsOANX12t|D^q= zZ^-WTjVrAe;yIgaHL|y8i67G|P<20=Sir6k=~RI^lpN|#(do1L#3|lp$87 z<>7j1Z5VaeOM~@*Uz}UiekMi@+FYIVi@a&c&D2X=G|rKFFl&iO*<%OYY}s^dK};FXM%k?>vr_ zFh}f3vKjIH)y_Pj)BQ}6pdU4)Ys*f-0XfgkL8A_*>e&@*dZnKxu;6GwKQeS}rD-k7 zURWyi^M!Oap!uW5R@9*fEN%~E>&!RXq&?lC2ebh<4Z*~0p(0#0*hxj&VkLeXHqfO0 zTV&Iw`KIwM5C?talkyqIYkNFNN$rB#73^WZ#fO8R-0aOQeAr7DH99i~t3?GwNcZPw zbjgj`DWl$-BJTj>xIZ^+>r}c@X=%Ww5Gtrara#kCGW<9DH)s#+{}UN!iLQFcN*eto z)*v^HpRpks3$ixK5i7~&LQA6{2r_egSik5N*e~b_!CA0+DY{{nq1TH`VKE13u-Wdm z^Oh9FYKfn~7x)co4f@QG3Pdv(YLQ%(Mq_nHv=jD0@@cjI`SY}}fh;gnikF8T5lJG4 zLRh=s>$F<>o7IMxnHvU0tOHPoYF!W|K^s6?N*~`wTWo;e-~Siw6WZ?p>vZ_80^Q%> z*ot>cmMl2zNK%ec2_nKT#vO4MmbDl#aK;F(P2Ck9ARegXX8=R$pJYmfoKKlBjRL5n zqA_p4gyXHlhE!Ihp|w0VtPgsqEwb)6T?eyS*Exw5i=TP&n$) zQeITmqUy0Hju%@l5JRj9WfkMIqHx77M}}^v-_D%=gNaLtU)DZw86eyeX00Ioo>1nk zVDw^Wfbu||!2@{)59Ap_Bj59Ap< zkY|(!@(fp8e?i!JrJdeV;u(d1UgGR&&dTpe{eV34?J@592_n!>@NzyxjzNWEhT{Oo zDULfh9_DzI<8h83=XjdqlN_Jp5VXn@Tv}k3Yq9 z%J{>KKRg~k&G>1?ayNceVhGb*+*6LKpATubzYSUCZPeYQl$dIJlfbk+%&6JN}4Eu1)?u`&L;oqY#dk-I(eR~ zC%>z*RK}qpj+pH&Z`I|bAo~#2!zTlkoP@jsH3s`7`Bp%+;gVAhXm*pt7?UukG&0vv zF=;DRfO<(-&ND{g%69-uy6xw0BM3@JGh@^1yjm&vMbq&t^4qLoT|0S#dtf+%Po1JC zr_^{Jf*0|j!~>TBtO~DITugEg;!;Ia9+pb;!(?*hfy10wj#uQ3-KIoml@jG>7@mDc5~Sv4KJVwOL-~MZQQV1 zfA&`OR9G#jpfQE zqb=KL%Qo7wjkau~E!$|zHrld{wv@(&fb+h{;HwSMyiUS=A{8McI|oQaw#Fg_^L&lDdPWLWHjT!xYMR;9lL3mp@D|If+e+j+_Dva?NQ zIxY(sGO4js&P0z9K#{C}NfuAC$g;;#@D4@Vij2l?dn`jhJh%j286p(V@ZkD^#&&O{ zd)Lhnp_sXTirV=&R0i-P$jds(=Tr}Fn3M{%IRPiE`Yy`Cva;2c@_{#Qi|jo7Dy;^> z*Ux8XZ;nfhk|hF4Y5UqAIvGs?|IK7)qU+v!y@Zsm`GIRP1!2CV2S*A#a2AggoUeK4 z(L?aCk+;dwo?A4BN3-$R7D-Z>Dx0lgl;gSo-2P{^U&0nSka$WEFP2({9{1ef<{8Y3 zjB|{0ahOojUWSGDN#RTh&ShFygBq$I(aPNB%xa7N$l4au z!mVC^&Cwy;k?w%jA`#= zFBHL5byTq*BZ7(S63&pgEnDEre#q@&XbQ^#7A+EJEE4>n8k|${RTvn((3sU;0=Xdk zi^*>)|0m^}Rxxj849s~6gF(+`(2&&{TsJVIl1~f@ZPo6T+=b9>MBe(=sMtMz{CGE< znVvyC!W26_oGuNnzy5|k#J)*;edlmQ;4fUEFPNZam7T1Q?)=p|mDW7`=wY{2^OJ;v z$luu|#5oCYo0<~TUI9=-KI;MEmW`3kR5q>Q`NhFCz53ybKRq*BLOYVeA;dSf!ljQ2 zKn{os*z;Pe3-cAH=MGK`qUGhqkT=Jfj`b+RpiU=U1lGWl_-Ue4F+*qvT`2sp>8Kcnex3d{1+Z`>f_7vQ$x4ybQm5D;f@dJap#;l#sSBduNz$h%u?zGE&)fh0h zwYx2yx#M21q_Y<`4veO?iz;+jZCI2k5;ydnq8T0DJz52T4El;{6hX^DDUo)PIi}p| zO?C3&T&dWy3NCJy#6k>@7@af+bf?S73SHclzhO7+a>=bt$vV&z*YE$U-qbHqpYnL( z^U{H1p4+F;+w*9V`H2>pM~lp(Mdn!|^JtNIw8%VKWS*rm&r9dgBJ*gGd9=tplQOTg z$dG06gxIp*jgkoAqL;OG7kileK9snD-&CmbBx(7OX59#0^ALZZ;qQrUdxpO!P^Fin zh-G|$*GMU~#7ECFmiDf4y>~Hw*VSDGdx4o%I|^$^(0OV(#cr(1n#7i+OC2wZBS3p**tS?_s zeYQrYkS#c)deEv>i((~%LC9+=#YMwcOij#PO3p~Rvrfg)V}lHaUL%44Cr4g|ZY1h- z(xT;O38Ilq?Pxc3jx3|-+_&!Ej-~u2B;fTzTy%CKX=jnNvlB@>i=>@J(#|4jXOXnC zNZMH>?JSaZ7D+pcq@6|5&LU}Nk+ic)(#|sJ6((J1HDo-^c$)Dd<9mcpbz)w`N_0cn z5K8ZkB*HYF)L~Dl2zDpY$>W$mj&*4R`7#Jds0o3 z4!HSfD{An1S?ZBrUZ+f2@FB{@Hucs{WA=u5=jibr2X|du5MUjIn&MZZy=C9*UDq4j zI#|4SkyomD&=cRi|7PuP(V6$KB0nY`@@;A%-p0K;!Jc2{?-Odz?{OD<+{F_-GGGi3 zitwE7v6lDHvwPT_d)Sb_?x&7DutjT^clR- zc%EO<+cJx2cIK5mS8`+&i^jpuO`aNu+bB$~Yd@@}g^opTAg-d2<`T;Q@mnUvs9Vxe zz<`v*#urOtwo8aB-6%Lz%+xGmzY0>4)M%DBPQP-3Do85T=6_n#elMPydN$>@T&Lcs zJ6HlR+vW-AH|r!W+^pT9sY)GZFsY(qmX*%6@F2DJDmnBAEK|SsN8%O-_y5lQgA-G1 zt=a1P@mbSx-0Cg+_d%`k6N%SpL>`8~ZO7WY%NpxW)>xM{)@6-#Sz}$+SeG@{WsP-N zV_nu*mo?U9jdfXLUDjBa2^6ZDZepn9;@j8F-eg`)=D5WiTa2yoc!v#OmcM8DTa2w; z#-Qia_%6os{QLNQ-}v0?#X}YGmYwCKvf?PX;z<(|S;iBAyP5GBUM!pmGJcrx!{hO5 zs6}D75TQ^KHW(rsT`Vww;~S#yQT3?ziDfHd_L55?R^8Z^ySgI`hM9n#kn+-4-hk85 z=V?<3;}473duDbjgIEcda?h?7NL*#9b+6jqfd=+Y?4f{S%cdw34lJc*gvr>X?ud{9 zb>b<#cTG<;fA3@uu_G`rmOUS(z+c(v8>X<9Q=v9}W@hHhj9&I=?^Ff41-Ubh$>Lp0 zVm~k5xhNJE)(Lo0G>&dLVn}Q}yx}y9;+Mu5@3h|3+=X0av8Gl^b*^mpZQ_}lUP8w| zsr@5dg72ZENOBGFjhx&pv??|inp5IF$~B9g`;9 zNyXGb*p5mO2F(=Lk3U|V;XVUhozrQchcH!7)S;p!hy=y4mnXeXQ9&JZL)2>dk=^gWx?)uVj+%0DIEemB3g_TKCq3cLs5EVd2uQ70`33Q3)DDF4SiZXy6sZds2nN`<`$r+<}*}HKW$$5 zAr`=3g&a`bp@bx9818gXYf(m@Eo<*h;w%C_0L=`b(wQ3en}Pgg_xk--^x^|}4VE=;tXuR#Z52J* zLxB&){_Z)&dND@{FL8Y-kucdNSTt!s>*NCIeOI9?rymsjVbI&F+il0|5Bpww`PJEE z)Cr0+(_NT^()pFe=FY+OfbUuMoT;DA<-ArzRydi?b!QiXGlvT8$gp$0e#fXS^s?^T z(t6Z$Y2?1VaiE?usq-*#`%2xpAeuUwWk%8zY5AV+M}cnG&6(L@A)59BI~_E8+Wkql z?rLSq6UzV*v}D*G_@(7ip%KtZmiVAXOc36IWIyp^{Gs%h2%X3zbhro>KWn1fVy&m7 zRLY^m+7gY&PcV|FO;!us<4OaF`813RHkC?J%eNEY@ zHgQS~XBhR4t#wmwFtY*!cZcF?HgWp3<13{L*saJRUVZIw=6&RQ-5S6CIJf+zrSjn{z zyrr8Q@t=Yuk@JyR9R|(C(a}|Rd3l<}MIy4CSB{(w6)M?f))Cnm<;_u~R|gZBVQ&Z# zC}n5=MdAkS{n{hs%9t~msWE0R)?6FdzS_IpMvbWOpaT-BkxiG|J$eH}mo_zBmeiSc zCe1>!?M7!1fw%BG^-4ZjvfXL8*d%!-_Iz^xqx)ai{|Mf^`^9_I=;GpI1d2=Nv#A!@ zRHe6(jE9Wn_Z+|H;uzHhG_ru|Rkq~<8uKW&NmP^}bda+`To_FjiXK{RdAfO|4~J<&=Gh--iNB;kyT zGjq$VgbB)2Z1Bt;&G9z4CTnuM!osnk_ZyG{XJac}S&Q{jf*UGhF6GTci2gOOJ zQ9IV9LG-lWI@p7%o*wR*)vXmuYj|M+&~2$URS6asmngK>_1`q~AHj_zn@HkbIW{T% z(3=jXa4;e8cLbUNvqCO)QWvK%yY7|F#Xq~4)IBX~G>r1@wWr$tY*1dFo1%_eAo)(Vx}kk7_ECYCKCQh{e-|>6 zKm)~hU)|LWRmCTI=oWM=T+5|wrC_xKRS1x+d75Wf+8?W8I12HC%>x@=9E_Y^n5KM= z%h5#cIqiP%rFB(HDrRp9mxlatJa5g3!zng{z6R+Wpe7<@zWl_P5I!5BQP{Uh(yCySiWWX+4X2=B=Ra2M`&OJ?~6t5NoI>RIV(cM6-6c0dBEEo4d?>ocNj z^u$NCpU_?X9YErj6at_qcg~10jOq(0%#eKU{>12%uZ793j7{z1Ih*zpfAf|NS zIwH4@4qQhEuA>9j(Shsez;$%sIy!J29k`ATTt^44qXVT4*=3q%jjtzu`D6IykKva; zhQ@mg9rzf2`C}-{$MDM^!!Lgfzx*-$^2hMYAHy$yj7z9o&|~=JkMTi7b-pw4m{M); zKs?`y7q*NFdtAJ$2Y8BT&Br(qt6FAY;?juiDN+7dcp@Qg;zzNk%P9z(2)9bUI4Lf; zEfTL%!}42BkQ*>EBy#W=cwti(02Zri>MB?|!GR6A&iL&XHSIOAF%V(lQ9jI0o}nR$ zQJu5d)02g^4VD2WSPLdD+?=?vAQdwyw(s_02*)73np~krA5@8Gq1}>zbcl83uFR@k zef>MvR0m}U$78A|FiX9?u1=YW0#z6E#j<|}zbtg%tE z`<+U%+;(Q%(p|G3VH02&gE(gB!2?jPlALpl(^v%7D?QLtnuwS%#HNA2@N8 zB}(ORI+zbw0+L){>4R%oTK_z5GheASU9;P*C_^gQSy(O29MT?D{+tz3 zO-p(J9@uWD?M0(193{10Ay))+qIfvSc{4c~I{SGY*Iiv7d6gcN>+Qc4AZMXbhYZH4 zG*HQ;97>B*UdGvBF>3HF%|k`=9(3SKcz(&ZNLEF9f5C2~ZbI?}7Cs$;icYRhxHHq4 zUyT%sso3w)PAE?msq2N>1zhHQtJBIGkl9$}Es82*2vci%j-Do2)3jR6aw4_=g@mQw zq5T01`1@FK9|Ao}0HK7LtnMx=L+-9hKd=TS#hTix3s01JLGKXpW4$Z9Dlv zKNW>pp8&TGn?XL+C>7=bgBT(8B|JJl()whmbvjyPV6qCN>)VirW zZH0WZ)9+h>?{}~>(xu2xQY^=R!ufbOQPsU)u zi{siFoB}6Zoh=u-1PD{rjRqcIn1c;~B?@NPtZ!B!?uD<8bd!KrL~G&9yZ7s0c}svW0v;(>o2fd5|v~3+LvH zTC)sOA|O!s8*;WYcW%Kbm4Z}q>SSNjT8ElSL($Zye^Psaxo1`j<)EOKLK@nZEte7+ zRWpE2d+{%IIJpE4o2c%;W&f?ov&kt!jmH!J2brUP51&UuD`|a*kB)2Kpm{$qO|vO#rMZ|Q2WUj)Sc9xnP%xRA@rM)MmdsLRi@J_Q}K4D;_YfG#%HwwXa6f7?v?!h zM;`r0KEOx$@EYed-e|#KBasDeVOs{`1}@QL9$}zQBXlH z21Tc|rl`nxPeiNYnPSF><%c3=Go!$TXNo1SccoVcHY4UB|HyL<*;Lx)HS9vs(uSkwE{^BKgZg?+sUcGRPIFauleg4$`G>EVM(!2Tp z`)YX|H7u&*vs5a{&6RhEbEhvoMa`3XW8M{pRqPR-rKVDS=d}TW>X&~5;CU~9l>JT~ z(#A4B_Iy88e0TJ2Hz9n-cyU9@bWZKMd^HK9ff!#uqJF;3X5An5?CS)f{mLbZIg zQS91oy#NbaxmL|>W(ow%?ouwR*QSF36~Yu?kuW1m(q333MnLF*7y`KuO?Mi^Z7IDe zl7%QzdgIodp!4e3=9f~+T!jV_a83%qPwI{`M8a{(!+JS#aXh#LoyQ~7UYP4i0lVo2 zwOkP3M8hDbVbW%EewOo4sKPBkD{C*Q_0>*Up6^5y__9muex)gmk)t$mm3h-8$?RRZ@^EfA$o(T%SY zYIEuhYwK0HOl|EyE8q~}Uw9T_LXtGH{x$WKXi-5Wqs1@Bm@IYWkHyujpr$}Q#ww0Y1sx2EfNzmygX$QJU z72r{79=y^O(5%&HHl4Yds!z&2+nb)@4ilz_5aM|imq_81nZ&=d6kL_^R>h`Z3oN_v z{*i436yXjirobk$nibOR(YO_mODUr1HXUGGm-gk* zIz8jgQ9ue<-tb6e(I=+E8%QcIIdk(+()daaby{BWmW@A+K^uie3~R;)On&PJ2}2OU z#@3U-MlMHxtAde_^UErZrYBz=zibj$OTSvOeD%%vBK55wQO&DJk7OxEN&yVU8PL-R zYYZUZ*BEGUMuA<8@8JfPdizZjRDkLl9%uglfL*+|V$IQL@k^3QUMPFIl> z5hR$Da1jkCB$Az%KcS^w)@a4B5<>dfD~h90$ZnD+j4LMDaPX$%yxY~J zactW|TOF%(wk+k2YTAv=CHXbdMcE*Qj>tG;G$bG{THaTsR1It-YKGQCcCA^=RkHRU zvv2_+V2^A5AP82x^@kKa`P!@2N}C~g^?a=s>hGnQ6#uavGF}tE8nYNY&MED0^qW-I zo5!V>t(?S4mRQpNHe(e9`0Uflb(I39$!;rKVeGYvQ!94@X_#05vg3#yfWJei0@&7u z)cx^12`zCt{^@mP|L29UUB_g3n}e$lGT^Qnz2%Qk)B>YXM4lvFqO~4+I_;rI^QQ2o z<$2q5$`S;Vq;~W|v4{&)Y;=b@@6zhK=&h6~ zk;#RDvrR|j@>U28k7hP5`aM-JpbF1^NYg$_jZAfZW~S`4i!_c~T3Pn&Qo-)$A*w*x zrlHx$m#83A(F>FlAB#F!dXcvB#>1nfCWoyY?&-af>YFtu#K47 zow4>Q80Gb~QB<3YNDW9l+tR!?v8n9*O+$%8&=XjtI|!}lo3Gg})^aZVX8AlV2S_y* z!%h(j&IbOs8D?^Y#*h@PMjWiY*CT;UoyXsiTEQTKsfL1*yv*yI{9a^!FHYw7BJ+Du&F@9# zag%x66jp~NnM~povNGd;#|egbMr9tEzws=M*K2GBkDF6V^;$epGOtOB+L$*k$4mH$ z;R|9}Vu-6WGqVY7^P8rr1B_{`h55OL$~c6*bX1}(TTpDyNhZ@6RslX&o%P#V#z0{H zZcvcuJ@`or)dxpG&m-7p1my~`qL1o9HY}y;Ri_UGpj@Vq2c410xK19yC>PyDB8@&o zZ-jOccvaF`pZm7ROE*X^&%thH%#=70icV?uGM<=7Sezre9ZxtXbrPB-+)byD_ z-lyPW*e}e`#?t^Jl>x+&f~;$)l8?rr|Jp{ibM)zWiK}i^;Ch3!`aA9E%lFJjP0*lX z`MFJh<2yH|PMo-QS}FJWn@*peg%N|^B(m^Rpa#;jb9fT8CZm5WSus2epgg!Cctx=t zbvNc;%Eo3{f@|vE>Yt}(cp+vlPcv=bo}D^QgcEL1U6CZV)nhEUPZw5rW;5;Bya!e(=Dn8w zTx^&HL8%a(xb|3}fDW~5Pt*T82!iC>#C$vd%Q1V;9ls=T{h#08(f+&sZ|Gf(^>!1t zWE|ORV7)aa)>{J+Z(zMOu-+P2Zw;)s1}mt6_13_8Yhb-Ku-+P2Zw;)shO*vn;+y_k ztT&7Zac&p2F5)H%3ON?hRIL$W`Rz&OM5OhqvWqp>_}OvZQQ0=?wjlBH_&88ZmW80f zI8H(BS`=SXtq^L+9~5~MrU+xL(a1&BI`B}dSc8lV88Jh+d~@(F1`AW{30AIpVsFC~ z7)P~OXgF3ipha1CX4b+9E?C@W^dF>FWtSGiE4$Y=v$(s-4CuO?1*Ibe(RO)rKFZ`O zPCYh~VZftA*lkowrknMbhu)O-AtkbqZPc&ZawE5x&o?|u7;|A1nfDIBvU^z^(4k!Qta)y_I6B$@J zN*>$GwZU)|)tXifb{`xuU_o$hvHC(#02Kf+5Ju0?L zAZn-sJy}j;7$^6y?0-}LRsCl%d>%^tM9iObZX$!{kil~k89av!ojjyd(iGR?1n~qop6pjEZ=l3Fldu5!bKZCV|NIz zBGq61QrPX6!@#6~f>?u5JbCWCeiK4OR0i0UrZ?tC6?ZADZ8aO$U3aWxdl=0aYJ8;f z?B3Sg$%XLXfn_UI)za^ABbJ{Y3+OAdw2>E zz`?}Z1SPe`w8n_27$v2A&ov}xZ6Y~qNX{CPvxelXAvtSE&Ki=lhUBavIcrGH8j`by zrV%RKu;HGaU%Eb=jm0vto;$F zkF%`vSTNIKUxGhWyU|NBjdB&P5PonP$DSopJwd;zMM9GvVTLf_x5p^xE>}}QP>jP< zbQI0IozSe1AM@#a>gC+27gT~Y+wJ2^q8}QaddxEzmCXR(ygBG;f2i!iWR);aHya*m zr-N!O1_t1)6LbofJlqD8@+=_NR=7xZj?8Abv9{zCY6T>|+eA}BZ0{8+H@1S6(VEh4 zLEco}LR>8b(yGjr)O!)}bC`!;mgkSi`rg$#zcB5;LrM3J{D7_-{X zCmI7&YZi?|EPhzagcgNl%XhByt~+_GW`P#RZBZL~D(QI6aAw*){_ee8IrL5wdC-2< zCGIJd<4($HS_3a4EFoc?%KV^X3)Y8VYLRAFBwN$_--LVVH|d$Qn0N*H^>X63q{H4C zMa5#UK1tiXvE{Rd^}2>vvxZl*hF7zOSF?s!vxZl*hF7zOSF?s!vxZl*hF2qtgr)XH z24Ce+VIG4Eh8zQq4UQ8Ww{u+Jc!c9!9Pj7&D90x_KFcw_%9C8>Nv`r-;z{n|{mjb! z*i5fx{19Vluqfw0s0s>_>#_@}O#aJYcq)p48X^*oj!iOvE2K%iBD#1}$e?kr7RBsU z_Hu0brhO56IDZd~l`;iPLbI2o5?qT5=o0uWt z8)lZugh3&HO7$1#%-(Hx+y=#h=XaYxtqYJoXB+)t(P_Dhw=6E)`zoQf)xDX)wYSaQ zLN2)5Z-;t7k$cLig;vWhciMyI(oO)?I*95<)%%a}8e>H`bdE1&DwUud**=`FwJt<7 zz&~>C!WoEa(fo}YW}PN=38;FK=TSwr5(=Pb@yGtvmfUGfPrL<0JXo0~}kZJo%Xu34h{Bm6-rS3to6i4Ku3Lr_0vGe z6JS8`#3Ts0L!qZy)XEY?9isWwrjMb7Scs$zjE|`JKk=*e-Qx#m02Jo)b8DMnPxmH7;0r=^)oMugKM+LX!6Wh zBa8+{3`UD)%k7;uh_Z1pkXEa&KeQ$yK&ZD`Q%j3Shc^zLnhl6e6zkI6OTE3Gw(*87 zd0uO$1u+WkR`t;X+TF49O6r23gLd@$cg4dx_KssoZBo=((2^fkSNVBC#?kv**S@7* z1O}*}NkN4YH~wNNA^r;c2xpRZz4nLt$B0=(SR3L%4mfIn2;;lVCWE3=k|_J~*jDAs z66}rrEvd8|D?Xmqh0a417j8D`bGln)PiQ8 zhFNf(ftu2BbZn~rN|C`@{VDB)c3J;9klw;UHISJ%2xJ~nidfZ)#SmU)TFD#|z2Xb0 zDOS21O&u>Y$!x1L{F52uh-4p-pX763&*&}%>jCj-&Fs(4)N}cK*S8yFHw&HGu%9c} z#x@2S53&XJRJRV>Vy)`{zAd0bJFs>_SVpy|?hivFPkBIID>$}(Emjtl4}ys-!bz5P z%1sZy(4e>1;#|i-tL1PQg{p*Tro=UMJFr`|017;aY;uIrFtAzATs&J$OWQ*_Fc26Q zU8V)vSG6D1pOl`5*k876Jxrfe*l#F@B3T+~gvY=JCkYMcPL&okV$tU+VUZBL3X&2* zB^JCe+k?Oyx(uV%X%pMj636$C=mYH+@QD8XbBQ+~R&V5Z1B=jM5yJR?wYikTxrY(C zGUughwnV>xRj97nGHx)Iu1jxZe3IwQ$NdMs4b|>aVz|TAceuKYcNt5~qKvO$d=2Ay z#uK#>iSURN?4)QvsRTl$$!VqAOh7wmCtce%C22s>XPsz0Vv7q6g`5F8#U$^gS3&WQrc39 zB)Ls>)3i@Kf@-J$);3Df$zKE+|F;xY8iUtb-@ESQq2SHIv@2T0nkzdgck{?KhgJ&t zTFwh<3p3rlPNroesC3rJf(9?7%S$9j9P+f*%)%@vakpeqMcqrefow*E!htx4&W+RX-fd$IFp3Jt4C+fYy_^{0U z3mmZ>y^Zg+J@LJ^v9-6^jkejCw(-5T@x8Y3y|(eaw(-5T@x8Y3y|(eaw(-5TmG31R zLL48DH;1EK{b*b-eHsh%G#~3U7UpRz%+pwyr?D_kV_}}g!aR+Ic^V7zG#2J*EX>mr z3-dG<=4oYNp62S4^3~fI-^|sePFlX#n(iu~B}K`Y>Ck zizezzZD84Cb2M6OHV!qbqZ|FCO^7 zl`nljJ>$)P_2#5iY6Zb^)IT$27A@<;dJ39$l7&PF@_7CtqyNmpevS6?MB8D})eK^% zlCs1*4KTjfG0HczyNk0eQ0CcAr>td`czIeoMCPZThl@ckw!>UV&qvfI*Gtm>YF7Ky z{)@0N&SNe`S8c|ZS2Gc)Rl5!oxH_v73)?g{)}^He8hLFej*Ou#^zLRivytg(zWP4I zu{Eem^j(<3Dg*5J5_) z3TobeN_&g;JJ<>pA{RudokU;mKsxbf4E}~=j4|l*gg!T^kFM#XYx?M#KDwrluIZy| z`skWIx~7k=>7#4_x6oC(*jn=WAcrqeZ|je*MKgmiVHN?Ff`MFXBT_Of5cdPt>< zbNw=OJmivT?Ew8qF-xe_YLNfW)Vc!)^G>f4oXj{g3kzP*^s4JBQ&T?NaA~J>V0+!8 zZ6U$(yrUWugrm*vrW5*JAy22XoD%fXRwarmgMNK|WeHsPHT(ape}r7bBEj1?fcN(< zC*G2Hqf*6UVZ0UZA4D4^;w(N{e~RFq>OQ#-FwtyWjkL<-A*5*qiksZM@ol6n#F+3t zo?`y(6X*?Bh}SBYezdvBO=a}|m zvi$x*t=NAM{dgKa!w=AtZI*ha?@HW%S&>wabME5+1?s*X1^B}tC zL3Gc9=$;4BJrAOL9z^#%IMF>1qI(`>$zBF3^Kjxp6;*u=+U5g7(B`QnFV{gi=X`f~AUI(4$QArM_uQq^&)Q+her)L#MG+uWZ)M<308`*~|DYdqJi=+o(?WdVxvR6?8OM^3p7rh&-JsVTKPXD+|-EQ=>VU)iBBayllZjoQ9i3ylkiX`(DI4cVtW=X`s_rDK8qH8 z7A^WLT2$IQKZ_Q9mYI4ME&424^jWm%vuM$0(W1|yMW0n#^jWSrF^^;%r@v#yOW9B4 z9i?)4$V|)Q&oO?Ev7G-svAOOYv&CJD$18@Xu*co2gyUYGau-j(i(N>~DAo~sKNsQk8_D}`%Y2V;a`urNRCPEGGre967#0O;EF(7|I& zeabfk)B>K2s4f;$4sg57fcnPRC?s_!)lt{Zw%^)8(+DT{?8 z)%Cp!+5WeME3k8V4ymG)=jOkkGFv5ErTGXuF`t81KfAa(Z`T)vhD%C0<84~g7W5F| zjVK{B{B}7{O@GSj4rhZ>xe&8;LjGD=?3I!Vkpt@>R+xwNNYSvC4!)+0N{uE#wFA|u z!(Bq%z=5P>RN7o+v~b!Fr_1eY+SA7e#csQq$FLX!x1e0fmALB%o2mZ<{G)rUT@Zr( z6lk^2^CrrEc$S{pf31Cr2;QEGHf$qF=|P-5X0n+lrdR|@#gvsYNt3?YkyA-bYgG=b z@}Jr-s{A{Qd|1uga<5W1%ZCpvnrTN%&5Tyz!)ZE)@4V@zHI>w8?CzboX0Pd2Ev?864Yc30Ts9k0 zZ`=@aV`2~6`!DJ@Q%7}k;xjS(|;9@*RxtW_-6; zi;8t#ZOjuhMHwsPk76SR)?(E}nT5v9kG1|}eMxgm!l%Ul4yrglYZR|3UZ3&5YPo4O zP{J@ALgGNf`fM&^xEZhPI!%&Mv3t{@1wob;G&_$T*4*J#-CzUA_Lo+Ie68%`{1`MW zqm2q3HyrTmPy~0vqi;RR%D`_Zmg)FvrD%9bfqEesLigS;fi5ER7Fxxg>okh9=jW!5 zpExzGmdJrutV-!CNtbA0Wv!0V9~?V$sO_yE+zOz{4QEP*;YY5Ev!B+kynT3PN@o#} zrklNWnt){974Fi7b0V+%FYbR{Kb@?=`1&YysFxGx8OaR1TCx0HhM)0F;=Iz0=eg&% zaL;ey{>wPllkqrCoUo~Kx5lBu*aQ;L=sNMhtFa{6JSBA*msN^CMR0pOQ3IjfiQ^$K zM`x7&WH!1O{3AR8h7xR*X~6)MeEF?*CC7a(blt3#OP8~DyGbKDTPy0}prj0?Vj!qI z35M2=?reEhm?m``SJmk?NJdZ?xpe0K-?^W%HqW(eq8X4=r=Z%AC8z5!!!mK+;>vO< zH#Ixs6ml=DJ}}~r6L)QF)tqi2TwGqM7BOwCg}H9b?x;h@PFXBv2YPz#zE`|*YwF0L z(3xI{Q)j*1E?78g9$qr~J8TLO>f}E_7j7*-JazKqpm+4}p-yF!IZBaNdr==H+f>%w z51#CjAQwDb$gy7%vHqmt9Bx{UL4{+6;{eAgjypIW=6ICjagHD7c$(vr9G~Nm_2)62 z?~?U*mTg<|7h0^bBwMQzvGGEZrNAiGVpm;-5_2LyEGb$+N-}IhoEpzmJf%tUl$%^F z99KEVQnC@p7qyyFb^Znz*%V;(nNAoltK_h@aK}P}I@}g&J86YYAKwD{f+9J87LQ~g z!PexO!?-u#$YXj_Z1 zlvKTfe!o(cgX7a)e=y}vUw^~RaYW(pg%JS_5dX9xDVxsv#;giAr_!BWT=1dG)|M&5 z4_H5OY{Sy8JPTiHjy8*YJeV5`iYutGUc)E7=G@)dW%vlvM7pVkffB1w3Ef)}rukFZ zn7PZVwn&$z;J7`Jtg-^%nD`)>)ThXf$jZD<%?)Y4@f5`2nTd@+(LU8UC_@E$LKWKL zwnzuNVOJInI#9J`;WTJl){hDg32wKG6B5d0cos{Ge+QdOST-u;kBOmltE8I7>3Q`G zTlae_YE`}-zC8*ppamO4?eq|%HRZM&X*a61yF}?Vb9%nwJDHAIU$Q|wWe5l%^mc{% zYyN9&cY}V=Kl#euQj7S#t`AQ3Ylj-dhAQ03R0hf&3yRs|REv()D@+^#aw9AbHbUUu zg_1i)gG0wOT`E-rw_MD9QbI?%{{N6lXxYJVI0UIpq@aiT3(cE;`m{YeHz>g^Vw&~6 z)3?rhrQ-4%HV~3(T{LS-YaeUUCIO@_#TuUWgPmLMe#J7G(}rZPk;Yg`fW*{AmkaU|6d!U z_`iMFKvBgk)$zJy4mZ~}N+alLB0|(^n=DD^2{q#iyU%Px)27$jLMpsftso>@P&y7SIM zdF#QjT{!T>q1NHHzqm3gXKM9I+W!b>Xd~&^HA6%v$n@3tIdVsS~U9UweWtLlcH7bZ# z!Y6~lV*cK~-)VPz+J()TSH6I?OS(jMaZP{=+0voiBNe-5^>&-#P`j8it$OAE>+Zed z?W%WKw&Wrt8W+~B9*h0q2L-;2Cm^`ox+Dip%`2cdXD|;VA z_CDB?y$>RLA4K*(i0pk3+4~@}_d#UugUH?o)&CDMzLUqtd3>IS$leE$y*+DI<{pU2 z12G+7ZpR|*`39cf(0zV0bAd3IYkF#!y!HW}e?Tbp7@iT);+oo``niqRr%>+GxTvSY zZDW2tju5(^L2^@*%_@d#6|$rs7!)K=+W)4~Q)$WMwgrnVz@cC)UGc(pV_QOKwogn% zhzc;sE0mYZ{sY}Xnk`6mvMFpvZb)`HIrF+suRp9ahqF2|J=O+*wYIJ54@fu1Xd|}j z=tOR^6dpPv1K2%Nb63 zPmkxWef!>l>s#cv;#s4yJfV$fz?-0U4v26Ll;1rn_5B5|T>3Q)$4 z`>Z(&KQpB2@Wmo3LTaXnh5Nw(_eG5LJKwWcszRJ2`$rtLp$>ld#gz@ld2&In*YIAA z0AtamxOpgUzDIHMP~1EeHxI?lLviy^+&mOF55>(xU-M{t^HAJ86gLmW%`1uv6H7Q#SY?I7sjlq3;`BUWbDEaqjSFcYTAC1v%5++=^$mw{N&$oFR)5h$>Jzv{-NsahZq zNT#xzui4uofiyBPTGqd-&_rEUy(~6-erC_a^c{zGPz&e6RUGwtgFaW-4N;KNn9dVY zcQx0Hlw4BHk!wwqxvy_z-R`~D)vd)`X{15}DatPEgB{pBcI~c}e>KjaTQB4Oy_+>T zK?>$|{6$VrU0I=*wMy42ozym~Q*<2**gLW^?>V5vLhS`KWIp_u-TQNr`3!UE>?7Ad zojFzhDoy_|j^?zAalozN+qS@!18GYNW;Pq|Mm&VKt0)wQ57+Sm7;$E;7ft3|nYC_4 zu+qr8M-tg$7lU(zZCmSz?Q0oGIZ~1dg5`;_ucLaSN}Erd*Aa6b)!_7ek-<@veYe4 z)%Et4q5kXo-3eEu9O=KdUu-8yT!;$IUI4$yRFfoWP*Ve3tnv zbGfz`K9=YAa;@C=0)M~2-(`M3^ZUD$^#bNE;Dp=MMNCmqm(WkL%iSG3WyjYbF(n1M z3ch3(qwlY_LynScEa#uHE)R7)at9T%a^uU?vEFT519TKYVF!Pp2eHtlSO+FZ$~>?3 zBR8H4HIe zqqBc_==wn_9-`FM##e9Hyfj9RAt@^U&gylGGqjMW-vJ%kG<=yFr<=7M%3HLTzx1eeAM*pe;sDervY&s-_LNE;8jrSY z8kBgioi>9zPKltNrrdlg1ev0%C=8KTh8^(1A6SMgMMRmUA2FEyIWRIQJAnIK*A6H(LqNzNbXt!IfY_LIclOE zmqN36Kgl*Eu0mQ8fu=vRTc18PjnlmwlNN^f3HxvH4Ed@wsB}AX#SHPX(<|RMp6*EE z5jw41&}*XVNfwQY)i>c}P4)j2<3=9W^Ek@mE*=l?cny!Y^Y{pl&+_PUvL>9Y2`3W> z*1cL&ZKMdQEL+^m;FQwB0-ITo=b860m!G}Wa; zVq;32mUvF&RlMjWioelokrt0TUb{ocX!~on5o$$2lwY3wcge%2Gy!6mq6{(-$W1Gp zkBQM>BDC`jJJstIkT;SV53*n3&vW%VmR~+DJvM z73iP>*;SCc6{xiWwN{|k3e;MGS}Ra%1!}E8tre)X(xcW2)LMaBKc+x_OKg2fY#*`T zg`N^xNxhv58t7?gCFVVTCi4`8EkE;**@=d7t&J9JYiB~-eGs}Z&>n%y+@`%=z7EW6 zBF^?-k)?{5peI!D^s$prA`nN9XzRLr+i7*=dm3r+}JsH+jqg=)-pZw-4MRFPi>OA=`Y(WK8Uh&uUKnXO1a6z`t`@TYr^?)Jr}SZK=a@bXbn{%47|JWN8K+GI90nST0@=_Bzg3CPEei`l;;HHIYD`@&2xhCoS-}>D9;JX zv(x$B3CeSV^6CW1A?O9#^30noZj((Nfo9sYgQe<>n4B5)tc>;z zx*@#pD8UP+abY4)yT~ZOKfoASeqRPGepXXZH{3B**~UT#4bZEbDau;#LgBg1h7tVI zJCJt1RK$2daD252LD1}wj!48$!RLv110gyixy<@A)D42EL`Xbh&P2XyP)UO@rs|Zo zkMLp}AxC!Bc={)9k){G6UtCJY119|d!Edx30xmLkaVr6EFCJ`k0uCe>dHOqT*O`Af z<1n7Df)G^t61=DWl6X15JAoVk&Q5P^wcSuCf)@_=SE5!VH4$E?{lUu5^shMl#0R9e z`|n>ykS?mDSY;>eqlBUII8T0;M>kTmi0@z#19uVM!6LqcMP9s!?_d$%!6LqcMSKT~ z_zo8F9W3HIScGUe?ZceDF&@&Q*XFb~cZ@?Yah{jcpJbktYnV%W$ris$GRA6t?`JN} zVdQV%%W2@tsn={~zFG7``!uuHa7crrTx)_HmkK*Q_){mykix6fJ+3Wfim2cI^h1r&GSUn!R8f?>Gl_>67-VH!LAUEb5rFg2Y8>K zmRxqTlzk+$ioXF`(bI#^fjF`xLM2Ud=zaS8-E<14qSl|z8K>+c@1U<2O{)>`ZUS22H+Qumo`T_bjiiA#K0m;v-vOEMP4ZtgtZV z`A0#!C;^f?ZA1*9gVe7FKXuUW%CyZ0MhmJHp=l33u2Oq6AM->_Go45crK80t)anV4 zejQV~K_E|eWnq65WS2J*8+M9pqzw*BdoyUL|8ZHnsEY9} zVqfZiM!4%n-srNr?vT3o7WnA`vDzaB|MX(ZxZN<0sB) z6cc{u+^ggUP9(ac9rl(mDP{AvBHzQdteIGGyez3uQ`CW#GusW73vL;G>0kmLbIzcs zLR#b|d!_l+W&#C>^cU%8D(8PePx7hwe0&JyiZ$HyedX}eSPoB^!$CW1a_F33JvTNt z)n9UBW24Fz1mfEp4wKgGOXjlGk^vl9ERn=&qdEe7UBc-UtaGc}n7SO7DtZF}%}5~~ zii1$^OZ%!#!e0JRC?3J|#FdNdl>h}NG)S*7VGV=VKj@NF>tr#U9qR8-dr672^XdI= zZ#-2_R)*_^o>>?GQ`0wnY^t@Z6)a{G4ljpTIbi*?=ul#g*SezNR5BZH?cA}g0hlEg zORiK)4(u5ixrK;2A6~tpYoe?=y$Ux&aOgj2d3X&KY?2nUx zmmSHGy685>#++2ab?azd#z*7PP+(xdD%Wx@KW#JNA(E&XOa!7?P$S|)Nit=~%ZnSg zI!toe9@K8XjPMa4V8tKy!5{X)ANIi?_Hiip!5{X)ANIi?_Q4Kx=G1SD#p4&CN0>sP!a&WW zjd8VFr8GH~lJ@Lb-24H5x{(iL3#Axg0X_kkUXx2?HHLGU6sY6WsCkpg$YaG?AyXY| zK{?@KczpYyKdi^oNryR*4&_1-jH#&Ej+Yu~GVMqvqKibp6;EZ9KO#s>f3stn4z{;Z z)pHq2xS5TY@Y>Cq!A`M1HbTGBJ(U{Jamunvy8*l7uxta}2N>*VyDk=vVk8DwHnJb~ zHpq)*OC9=Vqp)Fdfyt9Fh=>h*fW4{5ui=`g-;+ytYm=Tn8T!DbZDS~ut^#`AIDw5MhhnW;i; zVRp9cFI#y*t1Z_1lEwKd>4%wMu-2&1w+e$~cvsBr?(DCt#Ma`DC*KTehTAc@dAv&X zt(ShM`Mj?%F)?GM2h8}?SjBJ@TAd_dhOTU>$XYsAe!lW$`fyu#d=C@+c%fijRFnfi zSsF{ot)-saT0(9uA-9&0TT4i#C1l|ea%%~>wZsuzLT)V~x0aAwOUSJyCAY*S(5t?z zFn>^T_JxfbDwDcP^)S>PE`w@OuDJ4*vt{Qjv0FW+t+KQ2y#c71okNSl9%bXE>`XMt zc2P1SEG*svSH>p*j_rcGK#Nci@B`J=vum2U(S%unqv$dJ$eJy+`Q_bnINTfnhM222 z>}VEOjWztdj-X_Y!rowd-PWxImq}+tPr)j&((qm4+%LtLbi{IG-iv)2O2-3_aAuPL zK7pD*tD>kGH@`zVnL7<0^59m>1KtX)x`UonnuI8C&NP=cZ!XN1p~N$%}u9q zNSpnM%BsNvnQ@uEQhugT-BfLFYeWjcbUEmafY%XnWtz1{CSFTWyQ})AybyEJY+C7V z$J$sXKP`D`>0HXG@GND9ooTN8(74$V!P9eyj*Vm?TG}?@oMKyUW5>7kc6=KcEyjUC^{j&Ebfx2YYs*yWc=7UG;(wPYaz#p+bf964Ab zI%Q*pW1^&s_~eK=`jKqGndWlnS*2pcS1jdd?ZD;(6*@3JQ}E?W1%LmH396Ril)?~6s;>`Ej5IiDVg?2SM%Wo} z1d8pcdaOU?AXy3{V0e5YZTJRf=BN8S)sYnK>Bvio7y1hQM>?@J8|EWYtl@OUK)a+L z76j#u_74u!QiNNhs1gWTPjGT>I+7ejWaevWVh%xLXIg+Ci>%kgFZ!Y6rR6>B-d& za=C<}|ZYwmm6`I=$&25F|#2K;`n%fG^ZH4BxLUUW8xvkLL zR%mXkqB#j1Y!LGhvkoS3wNBU-%8r`K*LO@ys*4iWC5TKi9}vzHA|Hh1+sr;OrQ8lW zJPH~UuNW?eFrnSeFRXoM0<1|g3*&S3Jk_-5j%q; zlFDak4;G6@U9s5>TNZ~wz6K-R0R_=>ZPPV3(4h?2s6fK+j+-$PBm><623=I@{qNGA zi8lE&+(m-5Ak~~OZE5vP9-7Uwr-X~!jz4+AfeXW(@zbt%;JDf7#7@!!Rwm}ho*T0)oP)%-5-$ z#%&e)7Wbx4bQ_vVhA6iLC3PxYUAHi028)^SlCKn_wzIF@pDL_f zyO1uo((E2^kWJeCNoV3hEIzerA||!jopvh|xA1|JN9&GWGGxKw3c@_Ku9Y=|rjFZ~)FOzcH?n$jS9HiajAZ<8E8xGQjgS6owZ8%694$_8$ zwAu7F9Hb2gX~RL$xS`DFna_9Ur^I`%sKh3Lo=j6` zf&G=A0{J(oiXlYR6k`#K((DqHvK9>7OG?!g;=^OET7W5g(s8Xya>MSTJ)|#5!Du8I ztL)mfIqwJU4tnqsX(rW76nQK_B12?uh`NokuHUxyq{3iLn6xexV>U{mBYU_& zKid|2xK7)zJuayPc8_^+5BB7a%a%1RWQ_}1<3iTBkTou3jSE@hf;YL4H7;b03t8hr z*0_*0uAZ!MA!}&MhOD`nyY?Z$GPaz_KqZ+Tm1Llj3{;YVN-|JM1}e!wB^jtB1C?Z; zk_=Rmfl4w^Nk&nLxI1VNqfq80Qkmf$D*UYQTpx2g-U4OV+g&o!iVoz+tK%;{_#~BI zVk5uASCqmFS0MN-+b;+XU1e6(8qz52;@-q?hYpUxTrf8iFO)%m!S3cihdUT?)4dkR zu7+hUo2`x9*dM4y6f@$ zbqDr0a1Vwu!knl8cX*4N%LAuwKU6kb(nkQiT&nP@tyXw&SLd2H98x=sx)CWCh&2m9 zGp!cl;W!E)`sTWo9~e=`82fh=&oCCowD#+)#&59hZT3JCt)`jZB`33c+=yp&xvwyC zVeq|;AZcDCSz1s_pW^SLsdf*f>K(4KD%BP$7qBub5N<>)9P8AM#L(RYh!veo+Bqbt zB`f6vzMMNx2MLM8he9}l1j3XaTTV`)H(t($Y9X_gFZ7qq5TPcdBIU#qLUP5Qqa=5z zK|wgFQ{MX9FeFIC#+AbkCyX<)SH<~Kycw5P)`8A}VR`~vK2IcHaFdE%zxmkF0ZPXV z`b!g9b~vq}$&r??degq$`H(+k)_wk1dm7H|tF>FTSC)q=SUE!7e8Zo$1E!wln6n7Z_PCk;8^3M9O# zEJ%;3P`a;g05uPHL97@kBtWu{ISZap3TxA!Y&--IU(1@>j_Z1+f&2ijVO&je767quX|f7Q{3Vlb^AMgs$xe;2 zYZAPCN+z>&il@r1sBQb@(=LbiDHTrXX)sxKR&iYR=t`B1$}rGxS3zVd&*FJ_tv8Cs zPRo?2L6I_8WJNHOfq&LR@u(97v~WA-FHj)S&5w2Ig_@Zh0O{<%Y$2P9s_OrE*tlLr zg^8(Mfx3;DF$5lwTqOgK3-*v3QPAVd_6Mcw(;B*7qWh@c=nlH)yZyoy}j*nIr{-HMgDq(zODp02O(VWR4}I ztDUif{N}1Dc1C{oLVEJb1yZBC{MfECu&pn#5#YSa zn}aRusY_<+Q|fd$s5i^g<{?WOJ`B`ZpIOY**4G?#X~8fHMR5EO*QeEpZe(zP2LrmZ z?M@m?YjdONC?#qHfKwym;~Da&bmN?yfYMyqg(~f&sY`$=luW2H1Q;gP3yD(%>U^eT z{sr3r)SHF$;xpG!xDpPP=bkrreol`OLH0(_(hJcDCzsR$h=TRvOgyskZT-KE%h37> z@wg1A(5d2f3vj!I9=BV7+bzKD7T|UZaJvP#-2&Wh0dBVdw_AYQEx_#-;C2geJ82e3 z0TZiyyLenC@qsFvMkJK2f_5dIZ4#@<$Ead!oDw+`S6_uqqt+LPic|)4t~xPPGRaOE zsRXf6_cxG7G2(*M2?d?Fpk4k%B0rvsR*DIrZQ@zPzsq4(0^swz8*BEhRs?G;lrpUV z;31A&#TTSg3o*cK({x1rS*uTaRkKH~6bnWIJGb?`gG3sK2O-qF=DKU!t4>cxis48( z2ll!i@(xT+#^T_L3bch09!lre6c=~&qX4TMD%6uw8UTW^jZNu_OMgsvES9jW#DEnH z0$J_P1t@qzB}2tR&YyOf&6ISJsy8hFeB7ZtCGc)Xyb>hKrkwT^ zpG{j9M>ItqpxfgGS!%2j@;J?GA)IXKe~smxnHy4fj~3G8eQFGJ_m)*LE&>y_#6~I2Zhf;;d4;<927nWh0j6Zb5Qu4qVPE= zeE2atZAIp5n6H8VM42nOE#6;tLY&A3DN8AvuXG)PPn`t^86~})qC5J;REwstJv#4I zT&Np09kNrh!&A0P`El|15xrQoX{%MX=o3e3$Ve_WIMg2r6PfXPb2(s({6piNAe(_# zWpZXBj%U#L8CIIZ*B)$9Dn}^;p*%L%?HQRKCq2YvJl7@#v)qXI0F3eZ^SPKlB2GPg zLmkr<3a#0;JsYmotD#KBBjNKvpd3jzifNxa;qeyobPP*W!}Pz)C4Het^nP=MRQ5!M z3i_DW;|mio@F#o$5T4!sO1-IXQri}v81E;75F+YU?QaW@a%k@Z_t|B<79_hvG$JRC zT~LV~ic1|}4-fSA@Bn*wfIU3G9v)y153q*^*uw+tp;Xl!U=I(lhX>fh1MJ}ewTA`v z>iH65u85<~cGq{k{+L2NrX*5Dp& zRM=8`{9&yK;?ynZUz<3mS}$snVy)Fex~Upe9jjT!D?1=%Wy0KWtS3Y=h|Y^y;J1*0kMd-A6S36X>hZiYXO3sm z<5{ZcK>06MYoT=Y-SiD35aTyz#%o5%s@7%zv(Kj}WKBkbPO}&`XID>12+b1%xs)Vo znp_mB(ZZNM#K8d<+aj};!%D@V2e+&zHXKU~4-XJM_vZShtV}Z=FGb>J1m_#pS7!3b zpZjJvEFg4(wf@mO*@%Yzbq*7z-zS!lb*0wkEYyi z)9r#8bOu{wcRTdI!2uw&uWH7^p26*=*PXQDAwMAffn1CAi$xlqT=PXyKkh_&u^+)Q>W-Q(5t9TLDWGkdvlch|5(*h8V{#`CI7W_p|#7J5Ztl;2d zzQM_9@+ZjwavGqb#<%vzD&QI6PzYjh=zrv+cZJKWMZK$ZoWFnE93Ja_m`cXo z0Y|F6kpm|wSVYi`PykSlY%vyTgZ<{Onz2SaKcbKE@o=moDROkpq&t1M8a5MdQdfN* z&vnsM2HYjTS0{8pz|IlRC_XZ~@`Q1Q{s^~WwY^Sz7oD(GZ!BeTT*At`gq3#*E^`Sh z?-IJyB{bhloQ+Fde+et^5?0cnTSIFyL$g?lx3YkC1{6P^s%DpBUt}+xCx>mm0bm*eW z!ILx~VTMow*U14?&L5bb&;3JAlL7bzApS%K0*PuQ1d?1{ zkR6<<9LSK81D~q^XB^kV;hM>(<_LQLh%JpwlSiITfQs!k&3J`^?_f3*s6Y9w=wLon zDQDeDU%6WL1+uv;kq`o16ixwrNE)v{o1-)}nlKV{0`kEGbnS0fuA?XG>&f(xxRi8M z0eP?IDrJMJE!j5CIX1nW#4$0gj`9_0rv5HUfoKF*mzOQ9`bx2?1;p7<5)kQaySJrN4PU8aW|Fx#o38x6{X0TFQF79)jhHLh7G7)m zL(_JG_RaAp_!{NaBNc~{uGa8QbI*8_))sm+TL=`kU3-m{P8z9XVq~a}8lmg=RytG_ zha#1}6wcMikFiT){RJ;Lb3_2WIsbs-Rj>JQqSEKV%gV@_cwr10Za-Rr zvmUm~U6wI7(rLkDJ zP>`-dHHvS4o3nvr7yB zgAS@V>SFk#U1?5ovhi8`%jRgOZkqzGLahc3y-`aW8E9wsEOV)8micyBM|acHr7N3hvXW{smA75|3QE4Jm6XLK9wt~vs(qMHn&PhZdaCm) zJXr3hYOIudl|SlFqo1hXs?*l7-B(7tgc~~Ble1|u%#z-8BM>p^8Rm-Sv)5j~H74~P z9^eb(eXr6(*hKXzBO2TuL9cw9HefUjNw*SgpJs5WFaiF5EfYoi!6ji7Q!M6VUdNf$U<0TA!U&X zUf6BoH=0*G;xfCeY4b|#%8uF&bemf!VVPPGtw}kKdamxClSvq9&yHqel>}u+Crove zl<}3Im_xCaDm6!xRkFEU+0pf5wRKfQ-0pF6ph^2k)eyKoF<+>R^-(Y9rN04P$UUiW zVqxQkoIf9TkU{7tQ9agp6|Aqme(f5Iy2ywKyGYFZ5^h^`Qau!lW_-T)IWpc1+H5G` z|2{FAfOmLD!0AoVXG#QCajZ%!v_gHjjHAU74EgnJCsoLUU*yVFDj}edh>3YzYXEn{ z{!3-C79vqUfJpvectF?SyRIB1=cz&gb1>ko6oTPEnKd*tuvGOgf;BTqq%(k|l4>`} zqCgjAStQ4hHKNF^NhN+aO?gW6)TXMM603^KxA9ea;uH2kztT}zs%`qPyvpqwODr+O1#(u> zN`eGII;$)q{zfxpFJF(8RBo$EI7o}yDK&g}x6G@F%J!3}8^}FM(wj(bqD=a*;|J3KpA5+jhO&yvqKa?1gCnBLmnY`_-^P)(8@ zZdZc1jD2RP)XJxbJEJtJJuvjbZyB0%F;`q0WZ^}jN%5j2aUo(qi|4Z5gFA6 z6~pw~l^%ZX>F?ds&prLz)6YHq+|$oJ{oK>fJ^kF%&prLz)6YHq+|#ePviLMZkMV#s zWS(a(IR`Q?F)uM6WL{$~O@3tFi*Ndw4-=E=k2u?YW>`E%gs#ivZpqGO^$-xK1M&!LM z)VayjG;mQ9tGO!z0U87a85$J29-I1{qBXOXsI_Pw4{OVf=G0RFkl5r$lt+407$nS5 zY%k>Jk9U!3Vs(MyXW>7V0IqDJB8>CqjTo!+Sv)1|o* zv@VoLK4u(Hb|CK40bn1jc?(P(F7H)EAQ{vLf&xK#Fs5{RzK0trJx$Dkx7K4c$^c`^ z55v;EnT!|SqWI^-8XVU6JeKjj+RDeYXR;6X@pvXnZ(F-S7}}%AJll)HpJ2X|D|T|lp6(UM4Y5WPq^Roe+as5rE}{HoP?`{% zGQ@@O?0-;F@1IbM@;yQ`Kw=6Ku-Gs1kDm6pdLS(Oif@a$+c6uvYCzlJeR|nLTPv9NF7ELk!f5EdV*x}(q%OeC5w|TnUH3@_~d~||M0L_?s&DapxohD zYBXIRZ{`AE|2q@uv^Ui+vgtB?JPqScV)D0X-@c4-C`RFBpcPaOom8JMKxYfk*#dO7 z0G%yBXA98T0$!U1=xhNxTY%0MptA+&OhS(;HopL!NdQy0p{6ac^GZMcHRa@0pw~9E zV`o+oO=i9tI$90YiBMd}Tx#D+%um|bw+H!ZLRHvr@EMp2bYcJNMnP58jq(F=iLkP2 z4HN;PC%43o6ssZw%XSHhWF!QkZUBRWsHCn3JLEIuN&&F%MM0%cOCuI?`2uzF+-QzQ z&IY1PP&LsgA`wrTdiH#d;$Ol>>S<#{A`xb^Hq!1Z2+Sh9O|m`oP?A*GB3bDYkkg-q ze>EJSU33`eb+D7T8*V(BHk7QOwNx3p(T>3l4W@Qpw>hdBOFN=icg~#;+ejn(KJYDZ zh*$k7Bbn2qz|=wagbmB2jgZNSiJ}_iIEeS~k&R1WrEMa^hmI);_Oxqh{2C(EB2o@w zAjIyNY8gzonHjdV}|5^g`R0h(HnRH_kXGS^$Sja}g-{*~lqs>@xv}Qg| z_wpB6?@1)B#~tm^cSRCgMF)HdxiLZX@*xDz-9!zh zx;ZAw86kuw{s>ohWtxItF+DZ0Mu!)Og(?h0R!O;sgc_AGJFS9V&ffYdOBU~A*!gla z5`dxdxg9%}Bnb~30@RLRJX;yao0Vv`S;~NKr%(e11@n|B3keBkG8=Uzk||_LoC>o@ z2*ioSUDp-7p+OX9`n2^A4@KivftYU)9Rhqbz|Ls1Sgchue!b;Sr%kU}_PE_3zXpIv z&KGjN=+ylDfEn!q}P|Z+%iy9)|l%4!2n!j1{J*S63?Iu|R5I(rmONM%GWx zoBO_Sdte|I%@=EFf70uSM*Ys@_Mu#7us=mZ48H(M$LldO#P*s*?@857+YTgpM`AA} zQVHUih!P`Qz~}QDE8pV-?E=4jjB?iP+81oJx1C719q>>W($2-)!%sn%-N|z%5>iaX zs;w_p;Tl!AMis76g=b3fHJAeX(bZn%tGj zAE^uLVAn_i4*?z@lPnME7rTnb79Kb8IL_l99uM+(h{rp5e4NMUd4%9a4K|W(mZQX( zqA`@CnLvyRzn3S3Pr=f0*Gu({G7r+?DViP^!+oV9@6$OWY#Kw8AnLa!6Zn9X2QtMt>4;q`0JY{ zk|86RO*@AU&E{st+DWJWUQenu5;xq%xmi9%)SGLM=4wl;XWofDfMZop6q@9Wr3y4X zakz6ilQWRhK4c6V8F;vKm>);0t+O@K1U{f}_$8c`gsIymoSjGqvI>h^e2m8x&xtS^ zxY2?!ZR^2`?(Ks!%@ProL`Dh%C`-g8VSQMc9;KOLV{5%QJ3CtxtyWDMTN=exA9sSJ z?Uj@fABH%|A@ql#-&BaAp{Ra?ZQg{DRT4AqwdA9A0Cm&hh`bMb9+klB1NsIG{Lqu1 zHWEJ2$&6S61DYJq|1?hMe+`WZCb5Pz;bS4vJH`Yao%Dk2Xxdh~?L;&AX6!f=5S9jM z{3;rig07_PlIu#&l!P2EDjnO`$k44CY_fpW>`V4-E$X3q!=iZ@`7=JN*^Z`Yo|Ye( zUo)4^CCzeEdO}AsqbajoEJO=ya;g4mQXh1t%}6p+$t5RqFro3Lg4YJl*(`>oeo+X>iLNQ(gH)_M6CJKfTui94o56fZ?)s){?_>D*3_zE zyjp9RQ7fKzRz#ylbbm+-=-)FQfg6H8YiB+3Rqc*b)6$r6QpFT#>X?#(DK|Tf(g`pD zJWi}*;g2@Q>z0G`{C*#@^+UGC6Uo#kYJn6M0HvvhU$FPV;-w>)z`YfT6~jy*^sv7? z+AJglz2i1j_>t?lmGbEt)IT9wAmN+BrnTeo>>#av%-WV3-fpbtDEMMNZ*h8hrqtZk zz+y^w(zpiwVa`t0C{4_*N{k=*FRAV*EZN8gr788@-@o#({vXDR$b-1~>hJE5orZ&t znF6FYuCSz35JlokfHA08+|;D#<6Nb4~@(vl8f@;*HI z^6hcVih2wlDgTjKpnK`ED~4R8HP}h}qHdqS+W8}UC3s&NoX8jIQFq#fXmzHjs4g|A z)zv>NYqI;1?cs7E?JVsaT732zIxSJ6C;v z|8=dfGctJ$4bp6GvFR}Znt_`hr^)Ep^kgDCIyQP*amommwjM0fy^Xv#>LNq2is&%! zqbA9Lk8nM4mi^lP-tMSehF`<3TPQrLkUimn{s z6euI842+iEoK^=1L6G89y-zJO5%l&%6^)pDX94WbhrLm35#_X|XOT}CHnFhN%Tk-^ zv_GAXN2n`sk~ZYj2Ytaz0o;FIru+>fp2+~&%ay^D{#jY_&dvL8YA4-|Ijg)_%yn{c zQvXLsBgugz2`@qEHXvqAd=eHJ#=HRl#TU)QfldSbd0@|7p;FY7q3w&`)d;8Ek*rTp zf3{sAg#yiPx;M_{3l_~$R=Nmd4~o{*fXvk0hqI^9(!5EO~~9HC4-8)!C* z^r-QAX;WDX<(s*vBsSMj;i>EKevrQeY3mge=bkFqA%w)D`SjPK_Xj-QxM%dxNHh^A zwXJ`+KY+fS>11U&bK_}uI2!e2C(`Z|nPsKLxhc~Z0xdw=`BC6ae6TY;S8{|_Z&;sl z<;sO4{J~!fdC4#YGScmYpN07dVH7s)X)8}Ra>geqg+8XeLYn`qQ_99}PPCuX?dNpM zyysJvd5;^&yvj9Il$Cy7w_Ew`1lUa=tk?0^Ue>M5dvzBwU*uJb-8*mO+6K>U5`QZD#i?TMLWZD&I~!`;FR+SZB0L_UNw5yTpRr<4bvHSm;s z+Mp9gZD+AMZpM;^nF%%fhm!snl~u<3)pF;ChK6#PVem*wNq@7H-`h@2j?~Gu@}&n; z^^Fb1V9a_0E3Xf%X;;d?<7W^CaZVf^uWzj7hdaYhJ{tBrhxZRhDDCtO=Tfa^UoKLJ z0~8Pis{Sp% zeN3+8_bVH#qYq28jYHC_VX}2fxs!*oM8%1W=IaG1GfKNz53VV)h^4)=kKS0cu@43d z)RZfO$upP^Ss)*fw-Lm|^*L!iPWw4X~2CyiJ-sXwGJHN&-5JHbIolLCVuUk~NUfU)ZFM6=zG7mb*0|CU;!FCDR> zo_Z`;sanD2bUkh(8M#^`K?`043ZS>@J-}_E^;-EIa^f(GH-C-wV{PdHxZJnC9-&$&P0l}6Y<@P9M7F;ohDHGEg(8PPAs-XDK7aoK!P^50TF zNIxsHkoijX(cByJ&nu+DGbJ>tARbYCP6_d&_Kn zuYIoljlO&PU)TSGf%^t$2ERUZuJfYK&qn}I9333}+_*V$&EzMh`lp{Y{iB(OS8ZPP z^Vv_%esi^d_0;NDtp4&`Ztm^#nT68AdzLaw?^+vQd*9lxtkc$2*WI;#Vf_;u)^2#w zhWBrDZ`{A}m78Wao!s=X&8f{3n_s;7(Jk&R>$kjT+r8U&?%2NLiJgz{y7!v*?>=|! zq3a&G?rVEreEpH@FWqR|ICA6B8y~%?x^Mr!e|cJce|Y~N9{jgM&p3R?k*6S zAAaNwgKzlE8(;LMqi_1^o1gxc{zvY5>-*mJ$=|y7?SpTB{I{R`j{WcW>N^j;^BeCv z_3pWM|Mz`c-sf2k5;W9Y*W!+sbm#P4biAQEcW8CTySsCz zW;wppox8M>e3Tgy3n_wj1|PVp4V{r%3bI(M%-eaAg#jvu@AoYg+uXKg=t?>*MW z)2Cb3HD^vAIe+-v@zbZy4q9U)BaEuaEU3%6!vwU{>%w5YzI^7qXI(O~zvGXSn zp4qr-=br6LYsW`s_w3nl<2Adk-SewgT)%wgEO)g=M#efLBO|-dA3uCTuGx6{)Vcrl z?YA%OyUCLKTHCj*+pzPx4I%%Pds>GNp0ZA#I(d(EXxTb{cKL{P{?w7>GuF9Vm#w3x zPo6w|_wiH5tiz{I9XYPP$}DxO{?R^bkNW$mbJp$W&z`&T+T*9JgVwQww=WM`%g4FJ z8SBtJ+*NL2-;fuaJI$B3-(&e1=d9CbEc;bw4&HI=@x$_qTq-x|g#2TD)=j6++i!B} z^f~M7GD~>R>GNmQ1$@FY)*WX~A3c7~I)2n*aZl{HoUAO!ZA33)C zzi(5E@7dc+K4tF{chr}?>eaU|^EG7MShDWdyqj;^`{)M`pF4l>r2PSppW_oBz49f` z$u~ZF{N%EA4b*-brg z`>x}sPac%Lu}&YgP98tJeCq77b@14k#Wg zPu=yb`fZtOmwEOs#v@$$%kOZCJ6_9Qj&b*sy!RR2cbB#k<#s!FT#IXHgj(1={J#MK ze+_@TR{ibjPx(LZalLxSv)#{XsZTk^d&{RCLEAgeUk;-#^gfGxSGh~?_y6Z_FQ0B7 zK0LY7{=BkwTUgr-eERDcL&Wxe`F`>a7VmqI_p;PGo>VJ+h)-+rnPi=gsM#rg%9>fc z;#T$7qg*fRdm0tzIIlm(-wvyL9O3t;c4bz*ue|rD+Rr^#z21KR+toYCC;8R)mHS$J zI*Yp>#JE^id%UdfFP}m_&mr}R<+Jua#nqqCeur~>E}?^E?)TL9Sk|7QzW-@;pR3>N z4DWUapHuckI_Ao!=-svVN$`jAoyOF6x{3Rr=bER!$tj+ZZzL;dQ{g@88u`S%J4hJF ze(yW@1gH5;)=l2;s2XK%?}5;5@BQU9@~!OmAOF93|AUH}cpNCijJ4nX?Thb z{{Oo6Xk&)00IqzP!}h=Z_Z<{NN{Y~~1Td(dT<1ZegdMWyM_@T)Fzg8g!W4idb*({6 zrKQc_!JEa)KZjMe9>%zlc=={n5~kUxd^KBs*_`;zuW?a#DFweLWjf1y35{kir#5af@5WB#i46(AmN)&5oc zKEb2gAlnm==t++Jn<3>pIWA`)_wx|=T^zRWax6utKNDc{`-ru?1*qfuwP#Te_C4(f z+GSVg)cKPqog2=dIqf-r>iEdW(un)^gNM(YJ{7)W`ONXtN6=T!EuUFFV$*|zRX12? zePsnI5IaF!$T~alpWYSz=2>}?J@KymLiUC+p!petY7A)s=3ydwIIOi8N3=F0!j^GN>tFddPJoOP+5qFEHpn=o4Xyl?6VYLu(S{jUsc}{t zVZK@$UHJ*8V~lZL8)sb5CK%T+{usKQWLyGG=EtZ*(~Rr18OHUDKjJj4V%(_BGH%jV zGj7)AR({ConrGaq#%x*l~XF?er-GB0c{84&Du`JTj((OUC!Dyj0e?t zNZZZ)Fdm!lK;_plE^B)jkE-#QwwL*>+Vv~{0zKcrc$;=3;|c91#*>Wy42|z&Jca-6 zpP}>pjCW`U81H2KCusg=#qT&sF2|w392}n`zDB!`@wM6o#!K3>7$0K%JE{nu&G>rle#VEj=P z#*b*PVf?7}T1H9>SH4P+`ys~5+Upp9PmQ0@UeEmZwTD;!5+3^o#!qQ)Wc;-DCdNNt z{0cny&5VDfy@l~J;DdYx4*pig&ocf69Q19BpVNMe@$=f-8NZd>hSH6V2 z_z>gc+V3*{Es?4(Aw52_@+cBS#;KF;_L+U1o$L!!v|E$#Oh|55t{ z;i3kYInz z_#^GJj6c@?gz+cZ=NNy=_<1DD=NbQ9`vT(=+MhE1hxWyl&uRau{Tbtbsqw$HN16Xj a`x4{NwZ~TeMEiyI=ZsHkUuIm9@&5wKjBWw| literal 0 HcmV?d00001 diff --git a/samples/ParticleSystem/App.cs b/samples/ParticleSystem/App.cs deleted file mode 100644 index 22e8fe3b..00000000 --- a/samples/ParticleSystem/App.cs +++ /dev/null @@ -1,164 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Threading; -using SDL2Sharp; - -namespace ParticleSystem -{ - internal sealed class App : Application - { - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private Window _window = null!; - - private Thread _renderingThread = null!; - - private volatile bool _rendererInvalidated = false; - - private volatile bool _rendering = false; - - private volatile int _mouseX; - - private volatile int _mouseY; - - protected override void OnInitialized() - { - _window = new Window("Particle System", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); - _window.KeyDown += OnWindowKeyDown; - _window.MouseMotion += OnWindowMouseMotion; - _window.SizeChanged += OnWindowSizeChanged; - _window.MouseMotion += OnWindowMouseMotion; - _renderingThread = new Thread(Render); - _rendererInvalidated = true; - _rendering = true; - _renderingThread.Start(); - } - - protected override void OnQuiting() - { - _rendererInvalidated = false; - _rendering = false; - _renderingThread?.Join(); - _window?.Dispose(); - } - - private void Render() - { - Renderer renderer = null!; - var lastFrameTime = DateTime.UtcNow; - var lastFrameRateUpdateTime = DateTime.UtcNow; - var frameRateUpdateInterval = TimeSpan.FromMilliseconds(500d); - var frameRate = 0d; - var frameRateText = $"FPS: {frameRate:0.00}"; - var frameCounter = 0; - var particleEmitterColor = new Color(255, 0, 0, 255); - var particleEmmiterPosition = new Point(_window.Width / 2, _window.Height / 2); - var particleEmitter = new ParticleEmitter(particleEmitterColor, particleEmmiterPosition, 15); - - try - { - if (Cursor.Shown) - { - Cursor.Hide(); - } - - while (_rendering) - { - if (_rendererInvalidated) - { - renderer?.Dispose(); - renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _rendererInvalidated = false; - } - - var currentFrameTime = DateTime.UtcNow; - var elapsedTime = currentFrameTime - lastFrameTime; - particleEmitter.MoveTo(_mouseX, _mouseY); - particleEmitter.Update(currentFrameTime, elapsedTime); - - renderer.DrawColor = _backgroundColor; - renderer.BlendMode = BlendMode.None; - renderer.Clear(); - - particleEmitter.Render(renderer); - - var elapsedFrameRateTime = currentFrameTime - lastFrameRateUpdateTime; - if (elapsedFrameRateTime > frameRateUpdateInterval) - { - frameRate = frameCounter / elapsedFrameRateTime.TotalSeconds; - frameRateText = $"FPS: {frameRate:0.00}"; - lastFrameRateUpdateTime = currentFrameTime; - frameCounter = 0; - } - - renderer.DrawColor = _frameRateColor; - renderer.DrawTextBlended(8, 8, _frameRateFont, frameRateText); - renderer.Present(); - frameCounter++; - lastFrameTime = currentFrameTime; - } - } - finally - { - renderer?.Dispose(); - - if (Cursor.Hidden) - { - Cursor.Show(); - } - } - } - - private void OnWindowKeyDown(object? sender, KeyEventArgs e) - { - if (sender is Window window) - { - if (e.KeyCode == KeyCode.F11 || (e.KeyCode == KeyCode.Return && e.Alt)) - { - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - } - } - } - - private void OnWindowMouseMotion(object? sender, MouseMotionEventArgs e) - { - _mouseX = e.X; - _mouseY = e.Y; - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _rendererInvalidated = true; - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/ParticleSystem/Particle.cs b/samples/ParticleSystem/Particle.cs index ee4f0e5a..b25d77d8 100644 --- a/samples/ParticleSystem/Particle.cs +++ b/samples/ParticleSystem/Particle.cs @@ -19,62 +19,59 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp; +using SDL2Sharp.Video; using static System.Math; -namespace ParticleSystem +internal sealed class Particle { - internal sealed class Particle + public Particle() { - public Particle() - { - Lifespan = TimeSpan.Zero; - Age = TimeSpan.Zero; - Color = new Color(0, 0, 0, 0); - Position = new Point(0, 0); - Radius = 0; - } + Lifespan = TimeSpan.Zero; + Age = TimeSpan.Zero; + Color = new Color(0, 0, 0, 0); + Position = new Point(0, 0); + Radius = 0; + } - public void Respawn(TimeSpan lifespan, Color color, Point position, double radius) - { - Lifespan = lifespan; - Age = TimeSpan.Zero; - Color = color; - Position = position; - Radius = radius; - } + public void Respawn(TimeSpan lifespan, Color color, Point position, double radius) + { + Lifespan = lifespan; + Age = TimeSpan.Zero; + Color = color; + Position = position; + Radius = radius; + } - public TimeSpan Lifespan { get; private set; } + public TimeSpan Lifespan { get; private set; } - public TimeSpan Age { get; private set; } + public TimeSpan Age { get; private set; } - public bool IsDead => Age >= Lifespan; + public bool IsDead => Age >= Lifespan; - public Color Color { get; private set; } + public Color Color { get; private set; } - public Point Position { get; private set; } + public Point Position { get; private set; } - public double Radius { get; private set; } + public double Radius { get; private set; } - public void Update(DateTime realTime, TimeSpan elapsedTime) - { - var lifetime = Lifespan - Age; - var ratio = Clamp(1.0 - elapsedTime / lifetime, 0.0, 1.0); - Age += elapsedTime; - Radius = ratio * Radius; - Color = new Color(Color.R, Color.G, Color.B, (byte)System.Math.Ceiling(ratio * Color.A)); - } + public void Update(TimeSpan elapsedTime) + { + var lifetime = Lifespan - Age; + var ratio = Clamp(1.0 - elapsedTime / lifetime, 0.0, 1.0); + Age += elapsedTime; + Radius = ratio * Radius; + Color = new Color(Color.R, Color.G, Color.B, (byte)Ceiling(ratio * Color.A)); + } - public void Render(Renderer renderer) + public void Render(Renderer renderer) + { + if (renderer is null) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } - - renderer.DrawColor = Color; - renderer.BlendMode = BlendMode.Blend; - renderer.FillCircle(Position.X, Position.Y, (int)System.Math.Ceiling(Radius)); + throw new ArgumentNullException(nameof(renderer)); } + + renderer.DrawColor = Color; + renderer.BlendMode = BlendMode.Blend; + renderer.FillCircle(Position.X, Position.Y, (int)Ceiling(Radius)); } } diff --git a/samples/ParticleSystem/ParticleEmitter.cs b/samples/ParticleSystem/ParticleEmitter.cs index cdd20cf3..60b75bb8 100644 --- a/samples/ParticleSystem/ParticleEmitter.cs +++ b/samples/ParticleSystem/ParticleEmitter.cs @@ -20,89 +20,86 @@ using System; using System.Collections.Generic; -using SDL2Sharp; +using SDL2Sharp.Video; using static System.Math; -namespace ParticleSystem +internal sealed class ParticleEmitter { - internal sealed class ParticleEmitter + public ParticleEmitter(Color color, Point position, int radius) { - public ParticleEmitter(Color color, Point position, int radius) - { - Color = color; - Position = position; - Radius = radius; - Particles = new List(GenerateParticles(250)); - } + Color = color; + Position = position; + Radius = radius; + Particles = new List(GenerateParticles(250)); + } - public Color Color { get; } + public Color Color { get; } - public Point Position { get; private set; } + public Point Position { get; private set; } - public int Radius { get; } + public int Radius { get; } - private List Particles { get; } + private List Particles { get; } - public void MoveTo(int mouseX, int mouseY) - { - Position = new Point(mouseX, mouseY); - } + public void MoveTo(int mouseX, int mouseY) + { + Position = new Point(mouseX, mouseY); + } - public void Update(DateTime realTime, TimeSpan elapsedTime) + public void Update(TimeSpan elapsedTime) + { + foreach (var particle in Particles) { - foreach (var particle in Particles) + if (particle.IsDead) { - if (particle.IsDead) - { - var angle = _randomizer.NextDouble() * System.Math.PI * 2; - var x = Position.X + Cos(angle) * Radius * 2; - var y = Position.Y + Sin(angle) * Radius * 2; - var position = new Point((int)x, (int)y); - - var r = (byte)(_randomizer.NextDouble() * byte.MaxValue); - var g = (byte)(_randomizer.NextDouble() * byte.MaxValue); - var b = (byte)(_randomizer.NextDouble() * byte.MaxValue); - var color = new Color(r, g, b, byte.MaxValue); + var angle = _randomizer.NextDouble() * PI * 2; + var x = Position.X + Cos(angle) * Radius * 2; + var y = Position.Y + Sin(angle) * Radius * 2; + var position = new Point((int)x, (int)y); - var lifespan = TimeSpan.FromSeconds(_randomizer.NextDouble()); + var r = (byte)(_randomizer.NextDouble() * byte.MaxValue); + var g = (byte)(_randomizer.NextDouble() * byte.MaxValue); + var b = (byte)(_randomizer.NextDouble() * byte.MaxValue); + var color = new Color(r, g, b, byte.MaxValue); - particle.Respawn(lifespan, color, position, 7); - } + var lifespan = TimeSpan.FromSeconds(_randomizer.NextDouble()); - particle.Update(realTime, elapsedTime); + particle.Respawn(lifespan, color, position, 7); } + + particle.Update(elapsedTime); } + } - public void Render(Renderer renderer) + public void Render(Renderer renderer) + { + if (renderer is null) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } - - foreach (var particle in Particles) - { - particle.Render(renderer); - } - - renderer.DrawColor = Color; - renderer.BlendMode = BlendMode.Blend; - renderer.FillCircle(Position.X, Position.Y, Radius); + throw new ArgumentNullException(nameof(renderer)); } - private static readonly Random _randomizer = new(); - - private static Particle GenerateParticle() + foreach (var particle in Particles) { - return new Particle(); + particle.Render(renderer); } - private static IEnumerable GenerateParticles(int max) + renderer.DrawColor = Color; + renderer.BlendMode = BlendMode.Blend; + renderer.FillCircle(Position.X, Position.Y, Radius); + } + + private static readonly Random _randomizer = new(); + + private static Particle GenerateParticle() + { + return new Particle(); + } + + private static IEnumerable GenerateParticles(int max) + { + for (var i = 0; i < max; ++i) { - for (var i = 0; i < max; ++i) - { - yield return GenerateParticle(); - } + yield return GenerateParticle(); } } } diff --git a/samples/ParticleSystem/Program.cs b/samples/ParticleSystem/Program.cs new file mode 100644 index 00000000..5bab2066 --- /dev/null +++ b/samples/ParticleSystem/Program.cs @@ -0,0 +1,107 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubsystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubsystem.CreateWindow("Particle System", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var particleEmitterColor = new Color(255, 0, 0, 255); + var particleEmmiterPosition = new Point(window.Width / 2, window.Height / 2); + var particleEmitter = new ParticleEmitter(particleEmitterColor, particleEmmiterPosition, 15); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + + case MouseMotionEvent motionEvent: + particleEmitter.MoveTo(motionEvent.X, motionEvent.Y); + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + renderer.DrawColor = Color.Black; + renderer.BlendMode = BlendMode.None; + renderer.Clear(); + particleEmitter.Update(elapsedFrameTime); + particleEmitter.Render(renderer); + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } +} diff --git a/samples/PlasmaFractal/App.cs b/samples/PlasmaFractal/App.cs deleted file mode 100644 index ae8629ed..00000000 --- a/samples/PlasmaFractal/App.cs +++ /dev/null @@ -1,345 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Diagnostics; -using SDL2Sharp; -using SDL2Sharp.Colors; -using static System.Math; -using static SDL2Sharp.Math; - -namespace PlasmaFractal -{ - internal sealed class App : Application - { - private static readonly TimeSpan HideCursorDelay = TimeSpan.FromSeconds(1); - - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private Window _window = null!; - - private Renderer _renderer = null!; - - private PackedTexture _screenImage = null!; - - private MemoryImage _sourceImage = null!; - - private Palette _palette = null!; - - private Stopwatch _realTime = null!; - - private Stopwatch _frameTime = null!; - - private int _frameCount; - - private double _frameRate; - - private volatile bool _reversePaletteRotation = false; - - private DateTime _cursorLastActive = DateTime.UtcNow; - - protected override void OnInitialized() - { - _window = new Window("Plasma Fractal", 512, 512, WindowFlags.Shown | WindowFlags.Resizable); - _window.KeyDown += OnWindowKeyDown; - _window.SizeChanged += OnWindowSizeChanged; - _window.MouseMotion += OnWindowMouseMotion; - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _screenImage = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _sourceImage = GenerateDiamondSquareImage(_renderer.OutputSize); - _palette = GeneratePalette(); - _realTime = new Stopwatch(); - _frameTime = new Stopwatch(); - _frameCount = 0; - _frameRate = double.NaN; - _realTime.Start(); - } - - protected override void OnQuiting() - { - _realTime.Stop(); - _renderer?.Dispose(); - _window?.Dispose(); - } - - protected override void OnIdle() - { - if (Cursor.Shown) - { - var cursorInactivity = DateTime.UtcNow - _cursorLastActive; - if (cursorInactivity >= HideCursorDelay) - { - Cursor.Hide(); - } - } - - Render(_realTime.Elapsed); - } - - private void Render(TimeSpan realTime) - { - _frameTime.Start(); - - _screenImage.WithLock(screenImage => - { - for (var y = 0; y < screenImage.Height; ++y) - { - for (var x = 0; x < screenImage.Width; ++x) - { - screenImage[y, x] = _palette[_sourceImage[y, x]]; - } - } - }); - - _renderer.BlendMode = BlendMode.None; - _renderer.DrawColor = _backgroundColor; - _renderer.Clear(); - _renderer.Copy(_screenImage); - _renderer.DrawColor = _frameRateColor; - _renderer.DrawTextBlended(8, 8, _frameRateFont, $"FPS: {_frameRate:0.0}"); - _renderer.Present(); - - if (_reversePaletteRotation) - { - _palette.RotateRight(); - } - else - { - _palette.RotateLeft(); - } - - _frameTime.Stop(); - - if (_frameTime.ElapsedMilliseconds >= 1000d) - { - _frameRate = _frameCount * 1000d / _frameTime.ElapsedMilliseconds; - _frameCount = 0; - _frameTime.Reset(); - } - else - { - ++_frameCount; - } - } - - private void OnWindowKeyDown(object? sender, KeyEventArgs e) - { - if (sender is Window window) - { - if (e.KeyCode == KeyCode.F11 || (e.KeyCode == KeyCode.Return && e.Alt)) - { - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - } - - if (e.KeyCode == KeyCode.R) - { - _reversePaletteRotation = !_reversePaletteRotation; - } - } - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _screenImage?.Dispose(); - _renderer?.Dispose(); - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _screenImage = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _sourceImage = GenerateDiamondSquareImage(_renderer.OutputSize); - } - - private void OnWindowMouseMotion(object? sender, MouseMotionEventArgs e) - { - if (Cursor.Hidden) - { - Cursor.Show(); - } - - _cursorLastActive = DateTime.UtcNow; - } - - private static readonly Random _random = new(); - - private static Palette GeneratePalette() - { - var palette = new Palette(256); - for (var i = 0; i < 32; ++i) - { - var lo = (byte)(i * 255 / 31); - var hi = (byte)(255 - lo); - palette[i] = new Argb8888(0xFF, lo, 0, 0); - palette[i + 32] = new Argb8888(0xFF, hi, 0, 0); - palette[i + 64] = new Argb8888(0xFF, 0, lo, 0); - palette[i + 96] = new Argb8888(0xFF, 0, hi, 0); - palette[i + 128] = new Argb8888(0xFF, 0, 0, lo); - palette[i + 160] = new Argb8888(0xFF, 0, 0, hi); - palette[i + 192] = new Argb8888(0xFF, lo, 0, lo); - palette[i + 224] = new Argb8888(0xFF, hi, 0, hi); - } - return palette; - } - - private static MemoryImage GenerateDiamondSquareImage(Size size) - { - return GenerateDiamondSquareImage(size.Width, size.Height); - } - - private static MemoryImage GenerateDiamondSquareImage(int width, int height) - { - var size = NextPowerOfTwo(Max(width, height)) + 1; - var image = GenerateDiamondSquareImage(size); - return image.Crop(0, 0, height, width); - } - - private static MemoryImage GenerateDiamondSquareImage(int size) - { - var image = new MemoryImage(size, size); - - var randomness = 256; - - image[0, 0] = (byte)_random.Next(0, randomness); - image[0, size - 1] = (byte)_random.Next(0, randomness); - image[size - 1, 0] = (byte)_random.Next(0, randomness); - image[size - 1, size - 1] = (byte)_random.Next(0, randomness); - - randomness /= 2; - - for (var stepSize = size - 1; stepSize > 1; stepSize /= 2) - { - var halfStepSize = stepSize / 2; - - for (var y = halfStepSize; y < image.Height; y += stepSize) - { - for (var x = halfStepSize; x < image.Width; x += stepSize) - { - Diamond(image, x, y, halfStepSize, randomness); - } - } - - for (var y = 0; y < image.Height; y += halfStepSize) - { - for (var x = (y % stepSize) == 0 ? halfStepSize : 0; x < image.Width; x += stepSize) - { - Square(image, x, y, halfStepSize, randomness); - } - } - - randomness /= 2; - } - return image; - } - - private static void Diamond(MemoryImage map, int centerX, int centerY, int distance, int randomness) - { - var sum = 0; - var count = 0; - var top = centerY - distance; - if (top >= 0 && top < map.Height) - { - var left = centerX - distance; - if (left >= 0 && left < map.Width) - { - sum += map[top, left]; - count++; - } - - var right = centerX + distance; - if (right >= 0 && right < map.Height) - { - sum += map[top, right]; - count++; - } - } - - var bottom = centerY + distance; - if (bottom >= 0 && bottom < map.Height) - { - var left = centerX - distance; - if (left >= 0 && left < map.Width) - { - sum += map[bottom, left]; - count++; - } - - var right = centerX + distance; - if (right >= 0 && right < map.Height) - { - sum += map[bottom, right]; - count++; - } - } - - var average = sum / count; - var random = _random.Next(-randomness, randomness); - var value = Clamp(average + random, 0, 255); - - map[centerY, centerX] = (byte)value; - } - - private static void Square(MemoryImage map, int centerX, int centerY, int distance, int randomness) - { - var sum = 0; - var count = 0; - var top = centerY - distance; - if (top >= 0 && top < map.Height) - { - sum += map[top, centerX]; - count++; - } - - var left = centerX - distance; - if (left >= 0 && left < map.Width) - { - sum += map[centerY, left]; - count++; - } - - var bottom = centerY + distance; - if (bottom >= 0 && bottom < map.Height) - { - sum += map[bottom, centerX]; - count++; - } - - var right = centerX + distance; - if (right >= 0 && right < map.Height) - { - sum += map[centerY, right]; - count++; - } - - var average = sum / count; - var random = _random.Next(-randomness, randomness); - var value = Clamp(average + random, 0, 255); - - map[centerY, centerX] = (byte)value; - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs new file mode 100644 index 00000000..6acc7cec --- /dev/null +++ b/samples/PlasmaFractal/Program.cs @@ -0,0 +1,287 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; +using static System.Math; +using static SDL2Sharp.Math; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubystem.CreateWindow("Plasma Fractal", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var sourceImage = GenerateDiamondSquareImage(renderer.OutputSize); + var palette = GeneratePalette(); + var reversePaletteRotation = false; + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + + case KeyCode.R: + reversePaletteRotation = !reversePaletteRotation; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + screenTexture.WithLock(screenImage => + { + for (var y = 0; y < screenImage.Height; ++y) + { + for (var x = 0; x < screenImage.Width; ++x) + { + screenImage[y, x] = palette[sourceImage[y, x]]; + } + } + }); + + renderer.BlendMode = BlendMode.None; + renderer.DrawColor = Color.Black; + renderer.Clear(); + renderer.Copy(screenTexture); + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (reversePaletteRotation) + { + palette.RotateRight(); + } + else + { + palette.RotateLeft(); + } + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } + + private static readonly Random _random = new(); + + private static Palette GeneratePalette() + { + var palette = new Palette(256); + for (var i = 0; i < 32; ++i) + { + var lo = (byte)(i * 255 / 31); + var hi = (byte)(255 - lo); + palette[i] = new Argb8888(0xFF, lo, 0, 0); + palette[i + 32] = new Argb8888(0xFF, hi, 0, 0); + palette[i + 64] = new Argb8888(0xFF, 0, lo, 0); + palette[i + 96] = new Argb8888(0xFF, 0, hi, 0); + palette[i + 128] = new Argb8888(0xFF, 0, 0, lo); + palette[i + 160] = new Argb8888(0xFF, 0, 0, hi); + palette[i + 192] = new Argb8888(0xFF, lo, 0, lo); + palette[i + 224] = new Argb8888(0xFF, hi, 0, hi); + } + return palette; + } + + private static MemoryImage GenerateDiamondSquareImage(Size size) + { + return GenerateDiamondSquareImage(size.Width, size.Height); + } + + private static MemoryImage GenerateDiamondSquareImage(int width, int height) + { + var size = NextPowerOfTwo(Max(width, height)) + 1; + var image = GenerateDiamondSquareImage(size); + return image.Crop(0, 0, height, width); + } + + private static MemoryImage GenerateDiamondSquareImage(int size) + { + var image = new MemoryImage(size, size); + + var randomness = 256; + + image[0, 0] = (byte)_random.Next(0, randomness); + image[0, size - 1] = (byte)_random.Next(0, randomness); + image[size - 1, 0] = (byte)_random.Next(0, randomness); + image[size - 1, size - 1] = (byte)_random.Next(0, randomness); + + randomness /= 2; + + for (var stepSize = size - 1; stepSize > 1; stepSize /= 2) + { + var halfStepSize = stepSize / 2; + + for (var y = halfStepSize; y < image.Height; y += stepSize) + { + for (var x = halfStepSize; x < image.Width; x += stepSize) + { + Diamond(image, x, y, halfStepSize, randomness); + } + } + + for (var y = 0; y < image.Height; y += halfStepSize) + { + for (var x = (y % stepSize) == 0 ? halfStepSize : 0; x < image.Width; x += stepSize) + { + Square(image, x, y, halfStepSize, randomness); + } + } + + randomness /= 2; + } + return image; + } + + private static void Diamond(MemoryImage map, int centerX, int centerY, int distance, int randomness) + { + var sum = 0; + var count = 0; + var top = centerY - distance; + if (top >= 0 && top < map.Height) + { + var left = centerX - distance; + if (left >= 0 && left < map.Width) + { + sum += map[top, left]; + count++; + } + + var right = centerX + distance; + if (right >= 0 && right < map.Height) + { + sum += map[top, right]; + count++; + } + } + + var bottom = centerY + distance; + if (bottom >= 0 && bottom < map.Height) + { + var left = centerX - distance; + if (left >= 0 && left < map.Width) + { + sum += map[bottom, left]; + count++; + } + + var right = centerX + distance; + if (right >= 0 && right < map.Height) + { + sum += map[bottom, right]; + count++; + } + } + + var average = sum / count; + var random = _random.Next(-randomness, randomness); + var value = Clamp(average + random, 0, 255); + + map[centerY, centerX] = (byte)value; + } + + private static void Square(MemoryImage map, int centerX, int centerY, int distance, int randomness) + { + var sum = 0; + var count = 0; + var top = centerY - distance; + if (top >= 0 && top < map.Height) + { + sum += map[top, centerX]; + count++; + } + + var left = centerX - distance; + if (left >= 0 && left < map.Width) + { + sum += map[centerY, left]; + count++; + } + + var bottom = centerY + distance; + if (bottom >= 0 && bottom < map.Height) + { + sum += map[bottom, centerX]; + count++; + } + + var right = centerX + distance; + if (right >= 0 && right < map.Height) + { + sum += map[centerY, right]; + count++; + } + + var average = sum / count; + var random = _random.Next(-randomness, randomness); + var value = Clamp(average + random, 0, 255); + + map[centerY, centerX] = (byte)value; + } +} diff --git a/samples/RayTracer/App.cs b/samples/RayTracer/App.cs deleted file mode 100644 index 0be5cd7d..00000000 --- a/samples/RayTracer/App.cs +++ /dev/null @@ -1,304 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Diagnostics; -using System.Numerics; -using SDL2Sharp; -using SDL2Sharp.Colors; - -namespace RayTracer -{ - internal sealed class App : Application - { - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateTextColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private Window _window = null!; - - private Renderer _renderer = null!; - - private PackedTexture _screenTexture = null!; - - private MemoryImage _screenImage = null!; - - private Stopwatch _frameTime = null!; - - private int _framesCounted = 0; - - private double _framesPerSecond = double.NaN; - - private World _world = null!; - - private Camera _camera = null!; - - protected override void OnInitialized() - { - _window = new Window("Ray Tracer", 640, 480, WindowFlags.Resizable); - _window.KeyDown += OnWindowKeyDown; - _window.SizeChanged += OnWindowSizeChanged; - _window.MouseWheel += OnMouseWheel; - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _screenTexture = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _screenImage = new MemoryImage(_renderer.OutputSize); - _frameTime = new Stopwatch(); - _world = new World - { - Ambient = new Rgb32f(0.55f, 0.44f, 0.47f), - Objects = - { - // Backdrop Plane - new Plane - { - Position = new Vector3(0f, 0f, 0f), - Normal = new Vector3(0f, 1f, 0f), - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(1f, 1f, 1f), - } - }, - // Large center orange Sphere - new Sphere - { - Position = new Vector3(0f, 5.25f, 0f), - Radius = 10.5f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) - } - }, - // Small center yellow Sphere - new Sphere - { - Position = new Vector3(-3.5f, 1.6f, -6.7f), - Radius = 3.2f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) - } - }, - //// Large back right pink Sphere - //new Sphere - //{ - // Position = new Vector3(14f, 7f, 6.5f), - // Radius = 14f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - // } - //}, - //// Small front right orange Sphere - //new Sphere - //{ - // Position = new Vector3(8.2f, 3.5f, -6.5f), - // Radius = 7f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) - // } - //}, - //// Large back left pink Sphere - //new Sphere - //{ - // Position = new Vector3(-16.6f, 6.5f, 0f), - // Radius = 13f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - // } - //}, - //// Medium front back left pink Sphere - //new Sphere - //{ - // Position = new Vector3(-9.5f, 3f, -6f), - // Radius = 6f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - // } - //}, - //// Back left yellow Sphere - //new Sphere - //{ - // Position = new Vector3(-15f, 3f, 12f), - // Radius = 6f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) - // } - //}, - //// Far Back right blue Sphere - //new Sphere - //{ - // Position = new Vector3(40f, 10f, 175f), - // Radius = 20f / 2f, - // Surface = new MatteSurface - // { - // DiffuseColor = new Rgb32f(0.18f, 0.31f, 0.68f) - // } - //}, - }, - Lights = - { - new PointLight - { - Position = new Vector3(-300f, 350f, 10f), - Color = new Rgb32f(0.70f, 0.689f, 0.6885f) - }, - }, - }; - - _camera = new Camera(); - _camera.Rotate( - -6f * MathF.PI / 180f, - 180f * MathF.PI / 180f, - 0f - ); - _camera.Move(0f, 8.5f, -26f); - } - - protected override void OnQuiting() - { - _window?.Dispose(); - } - - protected override void OnIdle() - { - _frameTime.Start(); - Render(); - _frameTime.Stop(); - _framesCounted++; - - if (_frameTime.ElapsedMilliseconds >= 1000) - { - _framesPerSecond = _framesCounted / _frameTime.Elapsed.TotalMilliseconds * 1000; - _framesCounted = 0; - _frameTime.Reset(); - } - } - - private void Render() - { - _camera.Shoot(_world, _screenImage); - _screenTexture.Update(_screenImage); - _renderer.BlendMode = BlendMode.None; - _renderer.DrawColor = _backgroundColor; - _renderer.Clear(); - _renderer.Copy(_screenTexture); - _renderer.DrawColor = _frameRateTextColor; - _renderer.DrawTextBlended(8, 8, _frameRateFont, $"FPS: {_framesPerSecond:0.0}"); - _renderer.Present(); - } - - private void OnWindowKeyDown(object? sender, KeyEventArgs e) - { - if (sender is not Window window) - { - return; - } - - switch (e.KeyCode) - { - case KeyCode.F11: - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - break; - - case KeyCode.Return: - if (e.Alt) - { - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - } - break; - - case KeyCode.W: - { - _camera.Move(0, 0, 1); - break; - } - - case KeyCode.S: - { - _camera.Move(0, 0, -1); - break; - } - - case KeyCode.A: - { - _camera.Move(-1, 0, 0); - break; - } - - case KeyCode.D: - { - _camera.Move(1, 0, 0); - break; - } - - case KeyCode.Up: - { - _camera.RotateX(1f * MathF.PI / 180f); - break; - } - - case KeyCode.Down: - { - _camera.RotateX(-1f * MathF.PI / 180f); - break; - } - - case KeyCode.Left: - { - _camera.RotateY(1f * MathF.PI / 180f); - break; - } - - case KeyCode.Right: - { - _camera.RotateY(-1f * MathF.PI / 180f); - break; - } - } - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _screenTexture?.Dispose(); - _renderer?.Dispose(); - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _screenTexture = _renderer.CreateTexture(TextureAccess.Streaming, _renderer.OutputSize); - _screenImage = new MemoryImage(_renderer.OutputSize); - } - - private void OnMouseWheel(object? sender, MouseWheelEventArgs e) - { - _camera.FieldOfView -= e.Y; - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index 0b260c7c..c4c32d1b 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -19,159 +19,184 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Linq; using System.Numerics; -using SDL2Sharp; -using SDL2Sharp.Colors; +using System.Threading.Tasks; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; -namespace RayTracer +internal sealed class Camera { - internal sealed class Camera - { - private Matrix4x4 _viewMatrix = Matrix4x4.Identity; + private Vector3 _position = Vector3.Zero; - private float _fieldOfView; + private Quaternion _orientation = Quaternion.Identity; - public Vector3 Position => _viewMatrix.Translation; + public Resolution Resolution { get; } - public Quaternion Orientation => Quaternion.CreateFromRotationMatrix(_viewMatrix); + public float PixelAspectRatio { get; } - public Resolution Resolution { get; } + public Frustum Frustum { get; } - public float PixelAspectRatio { get; } + public float FieldOfView { get; } - public Frustum Frustum { get; } + public float FocalLength { get; private set; } - public float FieldOfView - { - get - { - return _fieldOfView; - } - set - { - _fieldOfView = value; - FocalLength = (float)(Resolution.Width / Resolution.Height / MathF.Tan(FieldOfView * MathF.PI / 180f / 2f)); - } - } + public MemoryImage Snapshot { get; } - public float FocalLength { get; private set; } + public Camera() + { + Resolution = new Resolution(640, 480); + PixelAspectRatio = 1f; + Frustum = new Frustum(-4f / 3f, 4f / 3f, -1f, +1f, float.Epsilon, float.PositiveInfinity); + FieldOfView = 90f; + FocalLength = (float)(Resolution.Width / Resolution.Height / MathF.Tan(FieldOfView * MathF.PI / 180f / 2f)); + Snapshot = new MemoryImage(Resolution.Width, Resolution.Height); + } - public Camera() - { - Resolution = new Resolution(640, 480); - PixelAspectRatio = 1f; - Frustum = new Frustum(-4f / 3f, 4f / 3f, -1f, +1f, float.Epsilon, float.PositiveInfinity); - FieldOfView = 90f; - FocalLength = (float)(Resolution.Width / Resolution.Height / MathF.Tan(FieldOfView * MathF.PI / 180f / 2f)); - } + public void LookAt(Vector3 position, Vector3 target, Vector3 up) + { + var lookAtMatrix = Matrix4x4.CreateLookAt(position, target, up); + _position = lookAtMatrix.Translation; + _orientation = Quaternion.CreateFromRotationMatrix(lookAtMatrix); + } - public void LookAt(Vector3 position, Vector3 target, Vector3 up) - { - _viewMatrix = Matrix4x4.CreateLookAt(position, target, up); - } + public void MoveForward(float distance) + { + var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); + var translation = forwardVector * -distance; + _position += translation; + } - public void Move(Vector3 distance) - { - _viewMatrix *= Matrix4x4.CreateTranslation(distance); - } + public void MoveBackward(float distance) + { + var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); + var translation = forwardVector * distance; + _position += translation; + } - public void Move(float x, float y, float z) - { - _viewMatrix *= Matrix4x4.CreateTranslation(x, y, z); - } + public void MoveLeft(float distance) + { + var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); + var translation = rightVector * -distance; + _position += translation; + } - public void RotateX(float radians) - { - _viewMatrix *= Matrix4x4.CreateRotationX(radians); - } + public void MoveRight(float distance) + { + var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); + var translation = rightVector * distance; + _position += translation; + } - public void RotateY(float radians) - { - _viewMatrix *= Matrix4x4.CreateRotationY(radians); - } + public void MoveUp(float distance) + { + var upVector = Vector3.Transform(Vector3.UnitY, _orientation); + var translation = upVector * distance; + _position += translation; + } - public void RotateZ(float radians) - { - _viewMatrix *= Matrix4x4.CreateRotationZ(radians); - } + public void MoveDown(float distance) + { + var upVector = Vector3.Transform(Vector3.UnitY, _orientation); + var translation = upVector * -distance; + _position += translation; + } - public void Rotate(float yaw, float pitch, float roll) + public void Yaw(float radians) + { + var upVector = Vector3.Transform(Vector3.UnitY, _orientation); + var rotation = Quaternion.CreateFromAxisAngle(upVector, radians); + _orientation = rotation * _orientation; + } + + public void Pitch(float radians) + { + var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); + var rotation = Quaternion.CreateFromAxisAngle(rightVector, radians); + _orientation = rotation * _orientation; + } + + public void Roll(float radians) + { + var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); + var rotation = Quaternion.CreateFromAxisAngle(forwardVector, radians); + _orientation = rotation * _orientation; + } + + public MemoryImage TakeSnapshot(World world) + { + if (world is null) { - _viewMatrix *= Matrix4x4.CreateFromYawPitchRoll(yaw, pitch, roll); + throw new ArgumentNullException(nameof(world)); } - public void Shoot(World world, MemoryImage image) + var rotationMatrix = Matrix4x4.CreateFromQuaternion(_orientation); + var translationMatrix = Matrix4x4.CreateTranslation(_position); + var viewMatrix = rotationMatrix * translationMatrix; + Parallel.For(0, Snapshot.Height, y => { - if (world is null) + for (var x = 0; x < Snapshot.Width; ++x) { - throw new ArgumentNullException(nameof(world)); + var rayDirection = Vector3.Normalize( + new Vector3( + Frustum.Left + x * Frustum.Width / Snapshot.Width, + Frustum.Bottom + y * Frustum.Height / Snapshot.Height, + -FocalLength + ) + ); + + var ray = new Ray(Vector3.Zero, Vector3.Normalize(rayDirection)); + var rayWorld = Ray.Transform(ray, viewMatrix); + var color = Trace(world, rayWorld, 0, 1f); + Snapshot[y, x] = color.ToArgb8888(); } + }); - for (var imageY = 0; imageY < image.Height; ++imageY) - { - for (var imageX = 0; imageX < image.Width; ++imageX) - { - var rayDirection = Vector3.Normalize( - new Vector3( - Frustum.Left + imageX * Frustum.Width / image.Width, - Frustum.Bottom + imageY * Frustum.Height / image.Height, - -FocalLength - ) - ); - - var ray = new Ray(Vector3.Zero, Vector3.Normalize(rayDirection)); - var rayWorld = Ray.Transform(ray, _viewMatrix); - var color = Trace(world, rayWorld, 0, 1f); - image[imageY, imageX] = color.ToArgb8888(); - } - } - } + return Snapshot; + } - private static Rgb32f Trace(World world, Ray ray, int level, float weight) + private static Rgb32f Trace(World world, Ray ray, int level, float weight) + { + var intersection = ray.Intersect(world.Objects).Min; + if (intersection is not null) { - var intersection = ray.Intersect(world.Objects).MinBy(e => e.Distance); - if (intersection != null) - { - return Shade(world, intersection, level, weight); - } - return Rgb32f.Black; + return Shade(world, intersection, level, weight); } + return Rgb32f.Black; + } - private static Rgb32f Shade(World world, Intersection intersection, int level, float weight) - { - var shade = Rgb32f.Black; - var n = intersection.Normal; - var p = intersection.Point; + private static Rgb32f Shade(World world, Intersection intersection, int level, float weight) + { + var shade = Rgb32f.Black; + var n = intersection.Normal; + var p = intersection.Point; - foreach (var light in world.Lights) + foreach (var light in world.Lights) + { + var l = Vector3.Normalize(light.Position - p); + var illumination = Vector3.Dot(n, l); + if (illumination > 0f) { - var l = Vector3.Normalize(light.Position - p); - //var illumination = Vector3.Dot(n, l); - //if (illumination > 0f) - //{ - // var shadowRay = new Ray(p, -l); - // if (Shadow(world, shadowRay, Vector3.Distance(p, light.Position)) > 0f) - // { - // shade += illumination * light.Color; - // } - //} - var i = intersection.Object.Surface.Shade(world.Ambient, n, l, light.Color); - shade += i; + var shadowRay = new Ray(p, -l); + if (Shadow(world, shadowRay, Vector3.Distance(p, light.Position)) > 0f) + { + shade += illumination * light.Color; + } } - return shade; + var i = intersection.Object.Surface.Shade(world.Ambient, n, l, light.Color); + shade += i; } + return shade; + } - private const float RoundOffErrorTolerance = 1e-7f; + private const float RoundOffErrorTolerance = 1e-7f; - private static float Shadow(World world, Ray ray, float tmax) + private static float Shadow(World world, Ray ray, float tmax) + { + var nearestIntersection = ray.Intersect(world.Objects).Min; + if (nearestIntersection is null || nearestIntersection.Distance > tmax - RoundOffErrorTolerance) { - var intersection = ray.Intersect(world.Objects).MinBy(e => e.Distance); - if (intersection == null || intersection.Distance > tmax - RoundOffErrorTolerance) - { - return 1f; - } - return 0f; + return 1f; } + return 0f; } } diff --git a/samples/RayTracer/Frustum.cs b/samples/RayTracer/Frustum.cs index b8870df5..2ff599e8 100644 --- a/samples/RayTracer/Frustum.cs +++ b/samples/RayTracer/Frustum.cs @@ -18,34 +18,31 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace RayTracer +internal sealed class Frustum { - internal sealed class Frustum + public Frustum(float left, float right, float bottom, float top, float near, float far) { - public Frustum(float left, float right, float bottom, float top, float near, float far) - { - Left = left; - Right = right; - Bottom = bottom; - Top = top; - Near = near; - Far = far; - } + Left = left; + Right = right; + Bottom = bottom; + Top = top; + Near = near; + Far = far; + } - public float Left { get; } + public float Left { get; } - public float Right { get; } + public float Right { get; } - public float Bottom { get; } + public float Bottom { get; } - public float Top { get; } + public float Top { get; } - public float Near { get; } + public float Near { get; } - public float Far { get; } + public float Far { get; } - public float Width => Right - Left; + public float Width => Right - Left; - public float Height => Top - Bottom; - } + public float Height => Top - Bottom; } diff --git a/samples/RayTracer/IObject.cs b/samples/RayTracer/IObject.cs index 020536a1..ff6e89a0 100644 --- a/samples/RayTracer/IObject.cs +++ b/samples/RayTracer/IObject.cs @@ -20,14 +20,11 @@ using System.Numerics; -namespace RayTracer +internal interface IObject { - internal interface IObject - { - ISurface Surface { get; } + ISurface Surface { get; } - Intersection? Intersect(Ray ray); + Intersection? Intersect(Ray ray); - Vector3 NormalAt(Vector3 surfacePoint); - } + Vector3 NormalAt(Vector3 surfacePoint); } diff --git a/samples/RayTracer/ISurface.cs b/samples/RayTracer/ISurface.cs index b42783cf..a4ccb0f3 100644 --- a/samples/RayTracer/ISurface.cs +++ b/samples/RayTracer/ISurface.cs @@ -19,12 +19,9 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Colors; +using SDL2Sharp.Video.Colors; -namespace RayTracer +internal interface ISurface { - internal interface ISurface - { - Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor); - } + Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor); } diff --git a/samples/RayTracer/Intersection.cs b/samples/RayTracer/Intersection.cs index 7d459029..17c6e14c 100644 --- a/samples/RayTracer/Intersection.cs +++ b/samples/RayTracer/Intersection.cs @@ -20,38 +20,35 @@ using System.Numerics; -namespace RayTracer +internal sealed class Intersection { - internal sealed class Intersection + public Intersection(IObject @object, Ray ray, float distance) { - public Intersection(IObject @object, Ray ray, float distance) - { - Object = @object; - Ray = ray; - Distance = distance; - } + Object = @object; + Ray = ray; + Distance = distance; + } - public IObject Object { get; } + public IObject Object { get; } - public Ray Ray { get; } + public Ray Ray { get; } - public float Distance { get; } + public float Distance { get; } - public Vector3 Point => Ray.Origin + Ray.Direction * Distance; + public Vector3 Point => Ray.Origin + Ray.Direction * Distance; - public Vector3 Normal + public Vector3 Normal + { + get { - get - { - var normal = Object.NormalAt(Point); - - if (Vector3.Dot(Ray.Direction, normal) > 0f) - { - normal = Vector3.Negate(normal); - } + var normal = Object.NormalAt(Point); - return normal; + if (Vector3.Dot(Ray.Direction, normal) > 0f) + { + normal = Vector3.Negate(normal); } + + return normal; } } } diff --git a/samples/RayTracer/MatteSurface.cs b/samples/RayTracer/MatteSurface.cs index dad529be..04470edb 100644 --- a/samples/RayTracer/MatteSurface.cs +++ b/samples/RayTracer/MatteSurface.cs @@ -19,21 +19,18 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Colors; +using SDL2Sharp.Video.Colors; -namespace RayTracer +internal sealed class MatteSurface : ISurface { - internal sealed class MatteSurface : ISurface - { - public float AmbientCoefficient { get; set; } = 1f; + public float AmbientCoefficient { get; set; } = 1f; - public float DiffuseCoefficient { get; set; } = 1f; + public float DiffuseCoefficient { get; set; } = 1f; - public Rgb32f DiffuseColor { get; set; } + public Rgb32f DiffuseColor { get; set; } - public Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor) - { - return ambient * AmbientCoefficient + lightColor * DiffuseCoefficient * DiffuseColor * Vector3.Dot(surfaceNormal, lightVector); - } + public Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor) + { + return ambient * AmbientCoefficient + lightColor * DiffuseCoefficient * DiffuseColor * Vector3.Dot(surfaceNormal, lightVector); } } diff --git a/samples/RayTracer/Plane.cs b/samples/RayTracer/Plane.cs index 77d39936..e02ff12d 100644 --- a/samples/RayTracer/Plane.cs +++ b/samples/RayTracer/Plane.cs @@ -20,37 +20,34 @@ using System.Numerics; -namespace RayTracer +internal sealed class Plane : IObject { - internal sealed class Plane : IObject - { - public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); + public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); + + public Vector3 Normal { get; set; } = new Vector3(0f, 1f, 0f); - public Vector3 Normal { get; set; } = new Vector3(0f, 1f, 0f); + public ISurface Surface { get; set; } = new MatteSurface(); - public ISurface Surface { get; set; } = new MatteSurface(); + public Vector3 NormalAt(Vector3 point) + { + return Normal; + } - public Vector3 NormalAt(Vector3 point) + public Intersection? Intersect(Ray ray) + { + var denominator = Vector3.Dot(Normal, ray.Direction); + if (denominator == 0f) { - return Normal; + return null; } - public Intersection? Intersect(Ray ray) + var numerator = -Vector3.Dot(Normal, ray.Origin + Position); + var t = numerator / denominator; + if (t < 0) { - var denominator = Vector3.Dot(Normal, ray.Direction); - if (denominator == 0f) - { - return null; - } - - var numerator = -Vector3.Dot(Normal, ray.Origin + Position); - var t = numerator / denominator; - if (t < 0) - { - return null; - } - - return new Intersection(this, ray, t); + return null; } + + return new Intersection(this, ray, t); } } diff --git a/samples/RayTracer/PointLight.cs b/samples/RayTracer/PointLight.cs index 6d04a603..40ad0eba 100644 --- a/samples/RayTracer/PointLight.cs +++ b/samples/RayTracer/PointLight.cs @@ -19,14 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Colors; +using SDL2Sharp.Video.Colors; -namespace RayTracer +internal sealed class PointLight { - internal sealed class PointLight - { - public Vector3 Position { get; set; } + public Vector3 Position { get; set; } - public Rgb32f Color { get; set; } - } + public Rgb32f Color { get; set; } } diff --git a/samples/RayTracer/Program.cs b/samples/RayTracer/Program.cs new file mode 100644 index 00000000..ede4c3b0 --- /dev/null +++ b/samples/RayTracer/Program.cs @@ -0,0 +1,267 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using System.Numerics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubystem.CreateWindow("Ray Tracer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var world = new World + { + Ambient = new Rgb32f(0.55f, 0.44f, 0.47f), + Objects = + { + // Backdrop Plane + new Plane + { + Position = new Vector3(0f, 0f, 0f), + Normal = new Vector3(0f, 1f, 0f), + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(1f, 1f, 1f), + } + }, + // Large center orange Sphere + new Sphere + { + Position = new Vector3(0f, 5.25f, 0f), + Radius = 10.5f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) + } + }, + // Small center yellow Sphere + new Sphere + { + Position = new Vector3(-3.5f, 1.6f, -6.7f), + Radius = 3.2f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) + } + }, + // Large back right pink Sphere + new Sphere + { + Position = new Vector3(14f, 7f, 6.5f), + Radius = 14f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + } + }, + // Small front right orange Sphere + new Sphere + { + Position = new Vector3(8.2f, 3.5f, -6.5f), + Radius = 7f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) + } + }, + // Large back left pink Sphere + new Sphere + { + Position = new Vector3(-16.6f, 6.5f, 0f), + Radius = 13f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + } + }, + // Medium front back left pink Sphere + new Sphere + { + Position = new Vector3(-9.5f, 3f, -6f), + Radius = 6f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + } + }, + // Back left yellow Sphere + new Sphere + { + Position = new Vector3(-15f, 3f, 12f), + Radius = 6f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) + } + }, + // Far Back right blue Sphere + new Sphere + { + Position = new Vector3(40f, 10f, 175f), + Radius = 20f / 2f, + Surface = new MatteSurface + { + DiffuseColor = new Rgb32f(0.18f, 0.31f, 0.68f) + } + }, + }, + Lights = + { + new PointLight + { + Position = new Vector3(-300f, 350f, 10f), + Color = new Rgb32f(0.70f, 0.689f, 0.6885f) + }, + }, + }; + + var camera = new Camera(); + camera.Roll(180f * MathF.PI / 180f); + camera.Pitch(-6f * MathF.PI / 180f); + camera.Yaw(180f * MathF.PI / 180f); + camera.MoveUp(-8.5f); + camera.MoveBackward(26f); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + var keyboardState = Keyboard.State; + if (keyboardState.IsPressed(Scancode.Up) || keyboardState.IsPressed(Scancode.Keypad8)) + { + camera.Pitch(1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.Down) || keyboardState.IsPressed(Scancode.Keypad2)) + { + camera.Pitch(-1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.Left) || keyboardState.IsPressed(Scancode.Keypad4)) + { + camera.Yaw(1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.Right) || keyboardState.IsPressed(Scancode.Keypad6)) + { + camera.Yaw(-1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.Keypad7)) + { + camera.Roll(1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.Keypad9)) + { + camera.Roll(-1f * MathF.PI / 180f); + } + + if (keyboardState.IsPressed(Scancode.W)) + { + camera.MoveForward(1); + } + + if (keyboardState.IsPressed(Scancode.S)) + { + camera.MoveBackward(1); + } + + if (keyboardState.IsPressed(Scancode.A)) + { + camera.MoveLeft(1); + } + + if (keyboardState.IsPressed(Scancode.D)) + { + camera.MoveRight(1); + } + + screenTexture.Update(camera.TakeSnapshot(world)); + + renderer.BlendMode = BlendMode.None; + renderer.DrawColor = Color.Black; + renderer.Clear(); + renderer.Copy(screenTexture); + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } +} diff --git a/samples/RayTracer/Ray.cs b/samples/RayTracer/Ray.cs index 86038627..de46307a 100644 --- a/samples/RayTracer/Ray.cs +++ b/samples/RayTracer/Ray.cs @@ -20,27 +20,24 @@ using System.Numerics; -namespace RayTracer +internal readonly struct Ray { - internal readonly struct Ray - { - public Vector3 Origin { get; } + public Vector3 Origin { get; } - public Vector3 Direction { get; } + public Vector3 Direction { get; } - public Ray(Vector3 origin, Vector3 direction) - { - Origin = origin; - Direction = direction; - } + public Ray(Vector3 origin, Vector3 direction) + { + Origin = origin; + Direction = direction; + } - public static Ray Transform(Ray ray, Matrix4x4 matrix) - { - var origin = Vector3.Transform(ray.Origin, matrix); - var direction = Vector3.Normalize( - Vector3.TransformNormal(ray.Direction, matrix) - ); - return new Ray(origin, direction); - } + public static Ray Transform(Ray ray, Matrix4x4 matrix) + { + var origin = Vector3.Transform(ray.Origin, matrix); + var direction = Vector3.Normalize( + Vector3.TransformNormal(ray.Direction, matrix) + ); + return new Ray(origin, direction); } } diff --git a/samples/RayTracer/RayExtensions.cs b/samples/RayTracer/RayExtensions.cs index 80b75325..7bfe807b 100644 --- a/samples/RayTracer/RayExtensions.cs +++ b/samples/RayTracer/RayExtensions.cs @@ -20,20 +20,23 @@ using System.Collections.Generic; -namespace RayTracer +internal static class RayExtensions { - internal static class RayExtensions + private static readonly Comparer _distanceComparer = + Comparer.Create( + (a, b) => a.Distance.CompareTo(b.Distance)); + + public static SortedSet Intersect(this Ray ray, IEnumerable objects) { - public static IEnumerable Intersect(this Ray ray, IEnumerable objects) + var intersections = new SortedSet(_distanceComparer); + foreach (var @object in objects) { - foreach (var @object in objects) + var intersection = @object.Intersect(ray); + if (intersection != null) { - var intersection = @object.Intersect(ray); - if (intersection != null) - { - yield return intersection; - } + intersections.Add(intersection); } } + return intersections; } } diff --git a/samples/RayTracer/Resolution.cs b/samples/RayTracer/Resolution.cs index 2887862f..719ab5c5 100644 --- a/samples/RayTracer/Resolution.cs +++ b/samples/RayTracer/Resolution.cs @@ -20,56 +20,53 @@ using System; -namespace RayTracer +internal struct Resolution { - internal struct Resolution + private int _width; + + private int _height; + + public Resolution(int width, int height) { - private int _width; + if (width <= 0) + throw new ArgumentOutOfRangeException( + nameof(width), "Width must be greater than zero"); - private int _height; + if (height <= 0) + throw new ArgumentOutOfRangeException( + nameof(height), "Height must be greater than zero"); - public Resolution(int width, int height) - { - if (width <= 0) - throw new ArgumentOutOfRangeException( - nameof(width), "Width must be greater than zero"); + _width = width; + _height = height; + } - if (height <= 0) + public int Width + { + get + { + return _width; + } + set + { + if (_width <= 0) throw new ArgumentOutOfRangeException( - nameof(height), "Height must be greater than zero"); - - _width = width; - _height = height; + nameof(value), "Width must be greater than zero"); + _width = value; } + } - public int Width + public int Height + { + get { - get - { - return _width; - } - set - { - if (_width <= 0) - throw new ArgumentOutOfRangeException( - nameof(value), "Width must be greater than zero"); - _width = value; - } + return _height; } - - public int Height + set { - get - { - return _height; - } - set - { - if (_height <= 0) - throw new ArgumentOutOfRangeException( - nameof(value), "Height must be greater than zero"); - _height = value; - } + if (_height <= 0) + throw new ArgumentOutOfRangeException( + nameof(value), "Height must be greater than zero"); + _height = value; } } } diff --git a/samples/RayTracer/Sphere.cs b/samples/RayTracer/Sphere.cs index 5c35ab27..0c2042d8 100644 --- a/samples/RayTracer/Sphere.cs +++ b/samples/RayTracer/Sphere.cs @@ -21,44 +21,41 @@ using System; using System.Numerics; -namespace RayTracer +internal sealed class Sphere : IObject { - internal sealed class Sphere : IObject - { - public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); + public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); - public float Radius { get; set; } = 1f; + public float Radius { get; set; } = 1f; - public ISurface Surface { get; set; } = new MatteSurface(); + public ISurface Surface { get; set; } = new MatteSurface(); - public Vector3 NormalAt(Vector3 point) + public Vector3 NormalAt(Vector3 point) + { + return Vector3.Normalize((point - Position) / Radius); + } + + public Intersection? Intersect(Ray ray) + { + var v = ray.Origin - Position; + var b = Vector3.Dot(v, ray.Direction); + var c = Vector3.Dot(v, v) - Radius * Radius; + if (c > 0f && b > 0f) { - return Vector3.Normalize((point - Position) / Radius); + return null; } - public Intersection? Intersect(Ray ray) + var discriminant = b * b - c; + if (discriminant < 0f) { - var v = ray.Origin - Position; - var b = Vector3.Dot(v, ray.Direction); - var c = Vector3.Dot(v, v) - Radius * Radius; - if (c > 0f && b > 0f) - { - return null; - } - - var discriminant = b * b - c; - if (discriminant < 0f) - { - return null; - } - - var t = -b - MathF.Sqrt(discriminant); - if (t < 0f) - { - t = 0f; - } + return null; + } - return new Intersection(this, ray, t); + var t = -b - MathF.Sqrt(discriminant); + if (t < 0f) + { + t = 0f; } + + return new Intersection(this, ray, t); } } diff --git a/samples/RayTracer/VectorExtensions.cs b/samples/RayTracer/VectorExtensions.cs index e1e87554..c5de8855 100644 --- a/samples/RayTracer/VectorExtensions.cs +++ b/samples/RayTracer/VectorExtensions.cs @@ -21,17 +21,14 @@ using System; using System.Numerics; -namespace RayTracer +internal static class VectorExtensions { - internal static class VectorExtensions + public static Vector3 RotateX(this Vector3 vector, float radians) { - public static Vector3 RotateX(this Vector3 vector, float radians) - { - return new Vector3( - vector.X, - vector.Y * MathF.Cos(radians) - vector.Z * MathF.Sin(radians), - vector.Y * MathF.Sin(radians) + vector.Z * MathF.Cos(radians) - ); - } + return new Vector3( + vector.X, + vector.Y * MathF.Cos(radians) - vector.Z * MathF.Sin(radians), + vector.Y * MathF.Sin(radians) + vector.Z * MathF.Cos(radians) + ); } } diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index 1197d677..f971e8ae 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -19,16 +19,13 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Collections.Generic; -using SDL2Sharp.Colors; +using SDL2Sharp.Video.Colors; -namespace RayTracer +internal sealed class World { - internal sealed class World - { - public Rgb32f Ambient { get; set; } + public Rgb32f Ambient { get; set; } - public ICollection Objects { get; } = new List(); + public ICollection Objects { get; } = new List(); - public ICollection Lights { get; } = new List(); - } + public ICollection Lights { get; } = new List(); } diff --git a/samples/SwirlStars/App.cs b/samples/SwirlStars/App.cs deleted file mode 100644 index 81a6d097..00000000 --- a/samples/SwirlStars/App.cs +++ /dev/null @@ -1,204 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Diagnostics; -using System.Numerics; -using System.Collections.Generic; -using SDL2Sharp; -using SDL2Sharp.Colors; - -namespace SwirlStars -{ - internal sealed class App : Application - { - private static readonly TimeSpan HideCursorDelay = TimeSpan.FromSeconds(1); - - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private static readonly Random _randomizer = new(); - - private Window _window = null!; - - private Renderer _renderer = null!; - - private Stopwatch _realTime = null!; - - private Stopwatch _frameTime = null!; - - private int _frameCount; - - private double _frameRate; - - private DateTime _cursorLastActive = DateTime.UtcNow; - - private List _stars = null!; - - protected override void OnInitialized() - { - _window = new Window("Swirl Stars", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); - _window.KeyDown += OnWindowKeyDown; - _window.SizeChanged += OnWindowSizeChanged; - _window.MouseMotion += OnWindowMouseMotion; - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - _realTime = new Stopwatch(); - _frameTime = new Stopwatch(); - _frameCount = 0; - _frameRate = double.NaN; - _realTime.Start(); - _stars = new List(GenerateStars(256)); - } - - private static IEnumerable GenerateStars(int count) - { - for (var i = 0; i < count; ++i) - { - var star = new Star(); - ResetStar(star); - yield return star; - } - } - - private static void ResetStar(Star star) - { - star.Position = new Vector3( - x: -500f + 1000f * _randomizer.NextSingle(), - y: -500f + 1000f * _randomizer.NextSingle(), - z: 100f + 900f * _randomizer.NextSingle()); - star.Velocity = new Vector3( - x: 0f, - y: 0f, - z: -(.5f + 4.5f * _randomizer.NextSingle())); - star.Color = new Rgb32f( - r: _randomizer.NextSingle(), - g: _randomizer.NextSingle(), - b: _randomizer.NextSingle() - ); - } - - protected override void OnQuiting() - { - _realTime.Stop(); - _renderer?.Dispose(); - _window?.Dispose(); - } - - protected override void OnIdle() - { - if (Cursor.Shown) - { - var cursorInactivity = DateTime.UtcNow - _cursorLastActive; - if (cursorInactivity >= HideCursorDelay) - { - Cursor.Hide(); - } - } - - _frameTime.Start(); - Render(_realTime.Elapsed); - _frameTime.Stop(); - _frameCount++; - - if (_frameTime.ElapsedMilliseconds >= 1000d) - { - _frameRate = _frameCount * 1000d / _frameTime.ElapsedMilliseconds; - _frameCount = 0; - _frameTime.Reset(); - } - } - - private void Render(TimeSpan realTime) - { - _renderer.BlendMode = BlendMode.None; - _renderer.DrawColor = _backgroundColor; - _renderer.Clear(); - - var screenSize = _renderer.OutputSize; - var screenCenterX = screenSize.Width / 2f; - var screenCenterY = screenSize.Height / 2f; - const int maxSubFrameCount = 20; - for (var subFrame = 0; subFrame < maxSubFrameCount; subFrame++) - { - foreach (var star in _stars) - { - star.Position += star.Velocity / maxSubFrameCount; - - var screenX = star.Position.X / star.Position.Z * 100f + screenCenterX; - var screenY = star.Position.Y / star.Position.Z * 100f + screenCenterY; - if (screenX < 0f || screenX >= screenSize.Width || - screenY < 0f || screenY >= screenSize.Height || - star.Position.Z < 0f || star.Position.Z > 1000f) - { - ResetStar(star); - } - - var starBrightness = 1f - Vector3.Distance(Vector3.Zero, star.Position) / 1000f; - var starDimmedColor = star.Color * starBrightness; - var starDrawColor = starDimmedColor.ToColor(); - _renderer.DrawColor = starDrawColor; - _renderer.DrawPoint(screenX, screenY); - } - } - - _renderer.DrawColor = _frameRateColor; - _renderer.DrawTextBlended(8, 8, _frameRateFont, $"FPS: {_frameRate:0.0}"); - _renderer.Present(); - } - - private void OnWindowKeyDown(object? sender, KeyEventArgs e) - { - if (sender is Window window) - { - if (e.KeyCode == KeyCode.F11 || (e.KeyCode == KeyCode.Return && e.Alt)) - { - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - } - } - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _renderer?.Dispose(); - - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - } - - private void OnWindowMouseMotion(object? sender, MouseMotionEventArgs e) - { - if (Cursor.Hidden) - { - Cursor.Show(); - } - - _cursorLastActive = DateTime.UtcNow; - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/SwirlStars/Program.cs b/samples/SwirlStars/Program.cs new file mode 100644 index 00000000..b9c2624b --- /dev/null +++ b/samples/SwirlStars/Program.cs @@ -0,0 +1,159 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using System.Numerics; +using System.Collections.Generic; +using SDL2Sharp; +using SDL2Sharp.Video; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video.Colors; +using SDL2Sharp.Input; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubsystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubsystem.CreateWindow("Swirl Stars", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var stars = new List(GenerateStars(256)); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + renderer.DrawColor = Color.Black; + renderer.BlendMode = BlendMode.None; + renderer.Clear(); + + var screenSize = renderer.OutputSize; + var screenCenterX = screenSize.Width / 2f; + var screenCenterY = screenSize.Height / 2f; + const int maxSubFrameCount = 20; + for (var subFrame = 0; subFrame < maxSubFrameCount; subFrame++) + { + foreach (var star in stars) + { + star.Position += star.Velocity / maxSubFrameCount; + + var screenX = star.Position.X / star.Position.Z * 100f + screenCenterX; + var screenY = star.Position.Y / star.Position.Z * 100f + screenCenterY; + if (screenX < 0f || screenX >= screenSize.Width || + screenY < 0f || screenY >= screenSize.Height || + star.Position.Z < 0f || star.Position.Z > 1000f) + { + ResetStar(star); + } + + var starBrightness = 1f - Vector3.Distance(Vector3.Zero, star.Position) / 1000f; + var starDimmedColor = star.Color * starBrightness; + var starDrawColor = starDimmedColor.ToColor(); + renderer.DrawColor = starDrawColor; + renderer.DrawPoint(screenX, screenY); + } + } + + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } + + private static readonly Random _randomizer = new(); + + private static IEnumerable GenerateStars(int count) + { + for (var i = 0; i < count; ++i) + { + var star = new Star(); + ResetStar(star); + yield return star; + } + } + + private static void ResetStar(Star star) + { + star.Position = new Vector3( + x: -500f + 1000f * _randomizer.NextSingle(), + y: -500f + 1000f * _randomizer.NextSingle(), + z: 100f + 900f * _randomizer.NextSingle()); + star.Velocity = new Vector3( + x: 0f, + y: 0f, + z: -(.5f + 4.5f * _randomizer.NextSingle())); + star.Color = new Rgb32f( + r: _randomizer.NextSingle(), + g: _randomizer.NextSingle(), + b: _randomizer.NextSingle() + ); + } +} diff --git a/samples/SwirlStars/Star.cs b/samples/SwirlStars/Star.cs index c8a19b57..4542149a 100644 --- a/samples/SwirlStars/Star.cs +++ b/samples/SwirlStars/Star.cs @@ -19,16 +19,13 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Colors; +using SDL2Sharp.Video.Colors; -namespace SwirlStars +internal sealed class Star { - internal sealed class Star - { - public Vector3 Position { get; set; } = Vector3.Zero; + public Vector3 Position { get; set; } = Vector3.Zero; - public Vector3 Velocity { get; set; } = Vector3.Zero; + public Vector3 Velocity { get; set; } = Vector3.Zero; - public Rgb32f Color { get; set; } = Rgb32f.Black; - } + public Rgb32f Color { get; set; } = Rgb32f.Black; } diff --git a/samples/TunnelEffect/App.cs b/samples/TunnelEffect/App.cs deleted file mode 100644 index 9a370f0c..00000000 --- a/samples/TunnelEffect/App.cs +++ /dev/null @@ -1,230 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Diagnostics; -using Microsoft.Toolkit.HighPerformance; -using SDL2Sharp; -using SDL2Sharp.Colors; -using static System.Math; -using static SDL2Sharp.Math; - -namespace TunnelEffect -{ - internal sealed class App : Application - { - private readonly struct Transform - { - public Transform(int angle, int distance) - { - Angle = angle; - Distance = distance; - } - - public int Angle { get; } - - public int Distance { get; } - } - - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private Window _window = null!; - - private Renderer _renderer = null!; - - private PackedTexture _screenTexture = null!; - - private MemoryImage _sourceImage = null!; - - private MemoryImage _transformTable = null!; - - private Stopwatch _realTime = null!; - - private Stopwatch _frameTime = null!; - - private int _frameCount; - - private double _frameRate; - - protected override void OnInitialized() - { - _window = new Window("Tunnel Effect", 640, 480, WindowFlags.Resizable); - _window.KeyDown += OnWindowKeyDown; - _window.SizeChanged += OnWindowSizeChanged; - _realTime = new Stopwatch(); - _frameTime = new Stopwatch(); - _frameCount = 0; - _frameRate = double.NaN; - - OnWindowSizeChanged(null, new WindowSizeChangedEventArgs(_window.Width, _window.Height)); - - _realTime.Start(); - } - - protected override void OnQuiting() - { - _realTime.Stop(); - _renderer?.Dispose(); - _window?.Dispose(); - } - - protected override void OnIdle() - { - _frameTime.Start(); - Render(_realTime.Elapsed); - _frameTime.Stop(); - _frameCount++; - - if (_frameTime.ElapsedMilliseconds >= 1000d) - { - _frameRate = _frameCount * 1000d / _frameTime.ElapsedMilliseconds; - _frameCount = 0; - _frameTime.Reset(); - } - } - - private void Render(TimeSpan realTime) - { - _screenTexture.WithLock(screenImage => - { - var screenWidth = screenImage.Width; - var screenHeight = screenImage.Height; - - var sourceWidth = _sourceImage.Width; - var sourceHeight = _sourceImage.Height; - var sourceWidthMask = sourceWidth - 1; - var sourceHeightMask = sourceHeight - 1; - - var shiftX = (int)(screenWidth * 1.0 * realTime.TotalSeconds); - var shiftY = (int)(screenHeight * 0.25 * realTime.TotalSeconds); - var lookX = (sourceWidth - screenWidth) / 2; - var lookY = (sourceHeight - screenHeight) / 2; - var shiftLookX = shiftX + lookX; - var shiftLookY = shiftY + lookY; - - for (var screenY = 0; screenY < screenHeight; ++screenY) - { - var transformY = screenY + lookY; - for (var screenX = 0; screenX < screenWidth; ++screenX) - { - var transformX = screenX + lookX; - var transform = transformTable[transformY, transformX]; - var sourceX = (transform.Distance + shiftLookX) & sourceWidthMask; - var sourceY = (transform.Angle + shiftLookY) & sourceHeightMask; - screenImage[screenY, screenX] = sourceImage[sourceY, sourceX]; - } - } - }); - - _renderer.BlendMode = BlendMode.None; - _renderer.DrawColor = _backgroundColor; - _renderer.Clear(); - _renderer.Copy(_screenTexture); - _renderer.DrawColor = _frameRateColor; - _renderer.DrawTextBlended(8, 8, _frameRateFont, $"FPS: {_frameRate:0.0}"); - _renderer.Present(); - } - - private static MemoryImage GenerateXorImage(int size) - { - return GenerateXorImage(size, size); - } - - private static MemoryImage GenerateXorImage(int width, int height) - { - var image = new MemoryImage(width, height); - for (var y = 0; y < height; y++) - { - for (var x = 0; x < width; x++) - { - image[y, x] = new Argb8888( - a: 0xFF, - r: 0x00, - g: 0x00, - b: (byte)((x * 256 / width) ^ (y * 256 / height)) - ); - } - } - return image; - } - - private static MemoryImage GenerateTransformTable(int size) - { - return GenerateTransformTable(size, size); - } - - private static MemoryImage GenerateTransformTable(int width, int height) - { - const double ratio = 32d; - var transformTable = new MemoryImage(width, height); - for (var y = 0; y < height; y++) - { - for (var x = 0; x < width; x++) - { - unchecked - { - var angle = (int)(0.5 * width * Atan2(y - height / 2.0, x - width / 2.0) / PI); - var distance = (int)(ratio * height / Sqrt((x - width / 2d) * (x - width / 2d) + (y - height / 2d) * (y - height / 2d))) % height; - transformTable[y, x] = new Transform(angle, distance); - } - } - } - return transformTable; - } - - private void OnWindowKeyDown(object? sender, KeyEventArgs e) - { - if (sender is Window window) - { - if (e.KeyCode == KeyCode.F11 || (e.KeyCode == KeyCode.Return && e.Alt)) - { - window.IsFullScreenDesktop = !window.IsFullScreenDesktop; - } - } - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _screenTexture?.Dispose(); - - _renderer?.Dispose(); - - _renderer = _window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - var screenSize = _renderer.OutputSize; - _screenTexture = _renderer.CreateTexture(TextureAccess.Streaming, screenSize); - var sourceImageSize = NextPowerOfTwo(Max(screenSize.Width, screenSize.Height)); - _sourceImage = GenerateXorImage(sourceImageSize); - _transformTable = GenerateTransformTable(sourceImageSize); - - _renderer.Present(); - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs new file mode 100644 index 00000000..a21f83c8 --- /dev/null +++ b/samples/TunnelEffect/Program.cs @@ -0,0 +1,185 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; +using static System.Math; +using static SDL2Sharp.Math; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubystem = new VideoSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubystem.CreateWindow("Tunnel Effect", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + + var screenSize = renderer.OutputSize; + var sourceImageSize = NextPowerOfTwo(Max(screenSize.Width, screenSize.Height)); + var sourceImage = GenerateXorImage(sourceImageSize); + var transformTable = GenerateTransformTable(sourceImageSize); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + screenTexture.WithLock(screenImage => + { + var screenWidth = screenImage.Width; + var screenHeight = screenImage.Height; + + var sourceWidth = sourceImage.Width; + var sourceHeight = sourceImage.Height; + var sourceWidthMask = sourceWidth - 1; + var sourceHeightMask = sourceHeight - 1; + + var shiftX = (int)(screenWidth * 1.0 * currentFrameTime.TotalSeconds); + var shiftY = (int)(screenHeight * 0.25 * currentFrameTime.TotalSeconds); + var lookX = (sourceWidth - screenWidth) / 2; + var lookY = (sourceHeight - screenHeight) / 2; + var shiftLookX = shiftX + lookX; + var shiftLookY = shiftY + lookY; + + for (var screenY = 0; screenY < screenHeight; ++screenY) + { + var transformY = screenY + lookY; + for (var screenX = 0; screenX < screenWidth; ++screenX) + { + var transformX = screenX + lookX; + var transform = transformTable[transformY, transformX]; + var sourceX = (transform.Distance + shiftLookX) & sourceWidthMask; + var sourceY = (transform.Angle + shiftLookY) & sourceHeightMask; + screenImage[screenY, screenX] = sourceImage[sourceY, sourceX]; + } + } + }); + + renderer.BlendMode = BlendMode.None; + renderer.DrawColor = Color.Black; + renderer.Clear(); + renderer.Copy(screenTexture); + renderer.DrawColor = Color.White; + renderer.DrawTextBlended(8, 8, lazyFont, $"FPS: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + } + + private static MemoryImage GenerateXorImage(int size) + { + return GenerateXorImage(size, size); + } + + private static MemoryImage GenerateXorImage(int width, int height) + { + var image = new MemoryImage(width, height); + for (var y = 0; y < height; y++) + { + for (var x = 0; x < width; x++) + { + image[y, x] = new Argb8888( + a: 0xFF, + r: 0x00, + g: 0x00, + b: (byte)((x * 256 / width) ^ (y * 256 / height)) + ); + } + } + return image; + } + + private static MemoryImage GenerateTransformTable(int size) + { + return GenerateTransformTable(size, size); + } + + private static MemoryImage GenerateTransformTable(int width, int height) + { + const double ratio = 32d; + var transformTable = new MemoryImage(width, height); + for (var y = 0; y < height; y++) + { + for (var x = 0; x < width; x++) + { + unchecked + { + var angle = (int)(0.5 * width * Atan2(y - height / 2.0, x - width / 2.0) / PI); + var distance = (int)(ratio * height / Sqrt((x - width / 2d) * (x - width / 2d) + (y - height / 2d) * (y - height / 2d))) % height; + transformTable[y, x] = new Transform(angle, distance); + } + } + } + return transformTable; + } +} diff --git a/sources/SDL2Sharp/WindowMovedEventArgs.cs b/samples/TunnelEffect/Transform.cs similarity index 77% rename from sources/SDL2Sharp/WindowMovedEventArgs.cs rename to samples/TunnelEffect/Transform.cs index f533e1ad..e5879fe1 100644 --- a/sources/SDL2Sharp/WindowMovedEventArgs.cs +++ b/samples/TunnelEffect/Transform.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,20 +18,15 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - -namespace SDL2Sharp +internal readonly struct Transform { - public sealed class WindowMovedEventArgs : EventArgs + public Transform(int angle, int distance) { - public int X { get; } + Angle = angle; + Distance = distance; + } - public int Y { get; } + public int Angle { get; } - public WindowMovedEventArgs(int x, int y) - { - X = x; - Y = y; - } - } + public int Distance { get; } } diff --git a/samples/WavePlayer/App.cs b/samples/WavePlayer/App.cs deleted file mode 100644 index cb177391..00000000 --- a/samples/WavePlayer/App.cs +++ /dev/null @@ -1,219 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Threading; -using System.Runtime.InteropServices; -using SDL2Sharp; -using SDL2Sharp.Interop; -using static System.Math; -using static System.Runtime.InteropServices.RuntimeInformation; - -namespace WavePlayer -{ - internal sealed class App : Application - { - private static readonly Font _frameRateFont = new("lazy.ttf", 28); - - private static readonly Color _frameRateColor = new(255, 255, 255, 255); - - private static readonly Color _backgroundColor = new(0, 0, 0, 255); - - private static readonly Color _waveColor = new(255, 255, 0, 255); - - private static readonly Color _channelSeparatorColor = new(0, 0, 255, 255); - - private Window _window = null!; - - private Thread _renderingThread = null!; - - private volatile bool _rendererInvalidated = false; - - private volatile bool _rendering = false; - - private WaveFile _waveFile = null!; - - private AudioDevice _audioDevice = null!; - - private int _wavePosition = 0; - - protected override void OnInitializing() - { - if (IsOSPlatform(OSPlatform.Windows)) - { - Environment.SetEnvironmentVariable("SDL_AUDIODRIVER", "directsound"); - } - } - - protected override void OnInitialized() - { - try - { - _window = new Window("Wave Player", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); - _window.SizeChanged += OnWindowSizeChanged; - _renderingThread = new Thread(Render); - _rendererInvalidated = true; - _rendering = true; - _waveFile = new WaveFile(Environment.GetCommandLineArgs()[1]); - _audioDevice = new AudioDevice( - _waveFile.Frequency, - _waveFile.Format, - _waveFile.Channels, - _waveFile.Samples, - OnAudioDeviceCallback, - AudioDeviceAllowedChanges.None); - _renderingThread.Start(); - _audioDevice.Unpause(); - } - catch (Exception e) - { - Console.Error.WriteLine($"Could not run sample: {e.Message}"); - Quit(1); - } - } - - protected override void OnQuiting() - { - _audioDevice?.Pause(); - _rendererInvalidated = false; - _rendering = false; - _renderingThread?.SafeJoin(); - _audioDevice?.Dispose(); - _waveFile?.Dispose(); - _window?.Dispose(); - } - - private void OnAudioDeviceCallback(Span stream) - { - stream.Fill(_waveFile.Silence); - var sliceLength = (int)Min(_waveFile.Length - _wavePosition, stream.Length); - if (sliceLength <= 0) - { - return; - } - var slice = _waveFile.Buffer.Slice(_wavePosition, sliceLength); - stream.MixAudioFormat(slice, _waveFile.Format, SDL.SDL_MIX_MAXVOLUME); - _wavePosition += sliceLength; - } - - private void OnWindowSizeChanged(object? sender, WindowSizeChangedEventArgs e) - { - _rendererInvalidated = true; - } - - private void Render() - { - Renderer renderer = null!; - var frameRateUpdatedTime = DateTime.Now; - var frameRateUpdateInterval = TimeSpan.FromMilliseconds(500d); - var frameRate = 0d; - var frameRateText = $"FPS: {frameRate:0.00}"; - var frameCounter = 0; - var channelCount = (int)_waveFile.Channels; - var waves = new Point[channelCount][]; - var sampleFormat = _waveFile.Format; - var sampleSize = sampleFormat.BitSize() / 8; - - try - { - while (_rendering) - { - if (_rendererInvalidated) - { - renderer?.Dispose(); - renderer = _window.CreateRenderer(RendererFlags.Accelerated/* | RendererFlags.PresentVSync*/); - for (var channel = 0; channel < channelCount; ++channel) - { - waves[channel] = new Point[renderer.OutputSize.Width]; - }; - _rendererInvalidated = false; - } - - renderer.DrawColor = _backgroundColor; - - renderer.Clear(); - - var currentTime = DateTime.Now; - var elapsedTime = currentTime - frameRateUpdatedTime; - if (elapsedTime > frameRateUpdateInterval) - { - frameRate = frameCounter / elapsedTime.TotalSeconds; - frameRateText = $"FPS: {frameRate:0.00}"; - frameRateUpdatedTime = currentTime; - frameCounter = 0; - } - - renderer.DrawColor = _frameRateColor; - - renderer.DrawTextBlended(8, 8, _frameRateFont, frameRateText); - - renderer.DrawColor = _waveColor; - - var channelHeight = renderer.OutputSize.Height / channelCount; - var halfGraphHeight = channelHeight * 9 / 20; - for (var channel = 0; channel < channelCount; ++channel) - { - var centerLine = channel * channelHeight + channelHeight / 2; - var sampleOffset = _wavePosition + sampleSize * channel; - for (var x = 0; x < renderer.OutputSize.Width; ++x) - { - var y = centerLine; - - if (sampleOffset < _waveFile.Buffer.Length) - { - var normalizedSample = _waveFile.Buffer.ToNormalizedSingle(sampleOffset, sampleFormat); - y = (int)(centerLine + normalizedSample * halfGraphHeight); - } - - waves[channel][x] = new Point(x, y); - - sampleOffset += sampleSize * channelCount; - } - - renderer.DrawLines(waves[channel]); - } - - renderer.DrawColor = _channelSeparatorColor; - - for (var channel = 0; channel <= channelCount; ++channel) - { - var y = channel * channelHeight; - renderer.DrawLine(0, y, renderer.OutputSize.Width, y); - } - - renderer.Present(); - - frameCounter++; - } - } - finally - { - renderer?.Dispose(); - } - } - - private static int Main() - { - var app = new App(); - var exitCode = app.Run(); - return exitCode; - } - } -} diff --git a/samples/WavePlayer/Program.cs b/samples/WavePlayer/Program.cs new file mode 100644 index 00000000..938272e3 --- /dev/null +++ b/samples/WavePlayer/Program.cs @@ -0,0 +1,173 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics; +using SDL2Sharp; +using SDL2Sharp.Audio; +using SDL2Sharp.Input; +using SDL2Sharp.Fonts; +using SDL2Sharp.Video; +using static System.Math; + +internal static class Program +{ + public static void Main() + { + using var mainSystem = new MainSystem(); + using var videoSubsystem = new VideoSubsystem(); + using var audioSubsystem = new AudioSubsystem(); + using var eventSubsystem = new EventSubsystem(); + using var fontSubsystem = new FontSubsystem(); + + using var window = videoSubsystem.CreateWindow("Wave Player", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); + using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var audioFile = audioSubsystem.OpenWaveFile(Environment.GetCommandLineArgs()[1]); + + var audioPlaybackPosition = 0; + var audioChannelCount = (int)audioFile.Channels; + var audioSampleSize = audioFile.Format.BitSize() / 8; + + using var audioDevice = audioSubsystem.OpenDevice( + audioFile.Frequency, + audioFile.Format, + audioFile.Channels, + audioFile.Samples, + OnAudioDeviceCallback, + AudioDeviceAllowedChanges.None); + + var lastFrameTime = TimeSpan.Zero; + var accumulatedFrameTime = TimeSpan.Zero; + var frameCounter = 0; + var frameRate = 0d; + + var programClock = Stopwatch.StartNew(); + + audioDevice.Unpause(); + + while (true) + { + var @event = eventSubsystem.PollEvent(); + if (@event is not null) + { + switch (@event) + { + case QuitEvent: + return; + + case KeyUpEvent keyEvent when !keyEvent.Repeat: + switch (keyEvent.KeyCode) + { + case KeyCode.Return when keyEvent.Modifiers.HasFlag(KeyModifiers.Alt): + case KeyCode.F11: + window.IsFullScreenDesktop = !window.IsFullScreenDesktop; + break; + + case KeyCode.Space: + if (audioDevice.Status == AudioStatus.Paused) + { + audioDevice.Unpause(); + } + else + { + audioDevice.Pause(); + } + break; + } + break; + } + } + else + { + var currentFrameTime = programClock.Elapsed; + var elapsedFrameTime = currentFrameTime - lastFrameTime; + accumulatedFrameTime += elapsedFrameTime; + + renderer.DrawColor = Color.Black; + renderer.Clear(); + renderer.DrawColor = Color.Yellow; + + var audioWavePoints = new Point[renderer.OutputSize.Width]; + var renderChannelHeight = renderer.OutputSize.Height / audioChannelCount; + var renderHalfGraphHeight = renderChannelHeight * 9 / 20; + for (var channel = 0; channel < audioChannelCount; ++channel) + { + var renderCenterLine = channel * renderChannelHeight + renderChannelHeight / 2; + var audioSampleOffset = audioPlaybackPosition + audioSampleSize * channel; + for (var x = 0; x < audioWavePoints.Length; ++x) + { + var y = renderCenterLine; + + if (audioSampleOffset < audioFile.Buffer.Length) + { + var normalizedSample = audioFile.Buffer.ToNormalizedSingle(audioSampleOffset, audioFile.Format); + y = (int)(renderCenterLine + normalizedSample * renderHalfGraphHeight); + } + + audioWavePoints[x] = new Point(x, y); + + audioSampleOffset += audioSampleSize * audioChannelCount; + } + + renderer.DrawLines(audioWavePoints); + } + + renderer.DrawColor = Color.Blue; + + for (var channel = 0; channel <= audioChannelCount; ++channel) + { + var y = channel * renderChannelHeight; + renderer.DrawLine(0, y, renderer.OutputSize.Width - 1, y); + } + + renderer.DrawColor = Color.Black; + renderer.DrawTextBlendedCentered(lazyFont, $"Average Frames Per Second: {frameRate:0.0}"); + renderer.Present(); + + if (accumulatedFrameTime >= TimeSpan.FromSeconds(1)) + { + frameRate = frameCounter / accumulatedFrameTime.TotalSeconds; + accumulatedFrameTime = TimeSpan.Zero; + frameCounter = 0; + } + else + { + ++frameCounter; + } + + lastFrameTime = currentFrameTime; + } + } + + void OnAudioDeviceCallback(Span stream) + { + stream.Fill(audioFile.Silence); + var sliceLength = (int)Min(audioFile.Length - audioPlaybackPosition, stream.Length); + if (sliceLength <= 0) + { + return; + } + var slice = audioFile.Buffer.Slice(audioPlaybackPosition, sliceLength); + stream.MixAudioFormat(slice, audioFile.Format, AudioSubsystem.MixMaxVolume); + audioPlaybackPosition += sliceLength; + } + } +} diff --git a/sources/SDL2Sharp/Application.cs b/sources/SDL2Sharp/Application.cs deleted file mode 100644 index 8f145fc1..00000000 --- a/sources/SDL2Sharp/Application.cs +++ /dev/null @@ -1,203 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Linq; -using System.Runtime.InteropServices; -using SDL2Sharp.Interop; - -namespace SDL2Sharp -{ - public abstract unsafe class Application - { - private static Application s_instance = null!; - - public static Application Instance - { - get - { - return s_instance; - } - private set - { - if (s_instance != null) - { - throw new InvalidOperationException(); - } - - s_instance = value; - } - } - - protected int ExitCode { get; set; } - - protected Application() - { - Instance = this; - ExitCode = 0; - } - - public int Run() - { - var @event = new SDL_Event(); - var eventFilterCallback = new EventFilterCallbackDelegate(OnEventFilterCallback); - - try - { - OnInitializing(); - Error.ThrowOnFailure(SDL.Init((uint)Subsystems.All)); - Error.ThrowOnFailure(TTF.Init()); - var eventFilterCallbackPointer = Marshal.GetFunctionPointerForDelegate(eventFilterCallback); - SDL.SetEventFilter(eventFilterCallbackPointer, null); - OnInitialized(); - - while (true) - { - if (0 != SDL.PollEvent(&@event)) - { - var eventType = (SDL_EventType)@event.type; - switch (eventType) - { - case SDL_EventType.SDL_QUIT: - return ExitCode; - - case SDL_EventType.SDL_KEYUP: - DispatchKeyUpEvent(@event.key); - break; - - case SDL_EventType.SDL_KEYDOWN: - DispatchKeyDownEvent(@event.key); - break; - - case SDL_EventType.SDL_MOUSEMOTION: - DispatchMouseMotionEvent(@event.motion); - break; - - case SDL_EventType.SDL_MOUSEWHEEL: - DispatchMouseWheelEvent(@event.wheel); - break; - - case SDL_EventType.SDL_WINDOWEVENT: - DispatchWindowEvent(@event.window); - break; - } - } - else - { - OnIdle(); - } - } - } - finally - { - SDL.SetEventFilter(IntPtr.Zero, null); - GC.KeepAlive(eventFilterCallback); - GC.KeepAlive(@event); - - OnQuiting(); - TTF.Quit(); - SDL.Quit(); - OnQuited(); - } - } - - public void Quit() - { - Quit(0); - } - - public void Quit(int exitCode) - { - ExitCode = exitCode; - var @event = new SDL_Event { type = (uint)SDL_EventType.SDL_QUIT }; - Error.ThrowOnFailure(SDL.PushEvent(&@event)); - } - - protected virtual void OnInitializing() { } - - protected virtual void OnInitialized() { } - - protected virtual void OnQuiting() { } - - protected virtual void OnQuited() { } - - protected virtual void OnIdle() { } - - private static void DispatchKeyDownEvent(SDL_KeyboardEvent @event) - { - var window = Window.All.FirstOrDefault(w => w.Id == @event.windowID); - if (window is not null) - { - window.HandleKeyDownEvent(@event); - } - } - - private static void DispatchKeyUpEvent(SDL_KeyboardEvent @event) - { - var window = Window.All.FirstOrDefault(w => w.Id == @event.windowID); - if (window is not null) - { - window.HandleKeyUpEvent(@event); - } - } - - private static void DispatchMouseMotionEvent(SDL_MouseMotionEvent @event) - { - var window = Window.All.FirstOrDefault(w => w.Id == @event.windowID); - if (window is not null) - { - window.HandleMouseMotionEvent(@event); - } - } - - private static void DispatchMouseWheelEvent(SDL_MouseWheelEvent @event) - { - var window = Window.All.FirstOrDefault(w => w.Id == @event.windowID); - if (window is not null) - { - window.HandleMouseWheelEvent(@event); - } - } - - private static void DispatchWindowEvent(SDL_WindowEvent @event) - { - var window = Window.All.FirstOrDefault(w => w.Id == @event.windowID); - if (window is not null) - { - window.HandleWindowEvent(@event); - } - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate int EventFilterCallbackDelegate(void* userdata, SDL_Event* @event); - - private static int OnEventFilterCallback(void* userdata, SDL_Event* @event) - { - var eventType = (SDL_EventType)@event->type; - switch (eventType) - { - case SDL_EventType.SDL_WINDOWEVENT: - DispatchWindowEvent(@event->window); - return 0; - } - return 1; - } - } -} diff --git a/sources/SDL2Sharp/AudioChannelLayout.cs b/sources/SDL2Sharp/Audio/AudioChannelLayout.cs similarity index 96% rename from sources/SDL2Sharp/AudioChannelLayout.cs rename to sources/SDL2Sharp/Audio/AudioChannelLayout.cs index dde80dc6..6242c977 100644 --- a/sources/SDL2Sharp/AudioChannelLayout.cs +++ b/sources/SDL2Sharp/Audio/AudioChannelLayout.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public enum AudioChannelLayout { diff --git a/sources/SDL2Sharp/AudioDevice.cs b/sources/SDL2Sharp/Audio/AudioDevice.cs similarity index 86% rename from sources/SDL2Sharp/AudioDevice.cs rename to sources/SDL2Sharp/Audio/AudioDevice.cs index 17ffe0bc..b3b943be 100644 --- a/sources/SDL2Sharp/AudioDevice.cs +++ b/sources/SDL2Sharp/Audio/AudioDevice.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public sealed unsafe class AudioDevice : IDisposable { @@ -30,9 +30,9 @@ public sealed unsafe class AudioDevice : IDisposable private AudioDeviceCallback _callback = null!; - private AudioDeviceCallbackDelegate _unmanagedCallback = null!; + private AudioDeviceCallbackDelegate _callbackDelegate = null!; - private GCHandle _unmanagedUserdata = default; + private GCHandle _callbackUserData = default; private bool _disposed = false; @@ -52,18 +52,20 @@ public sealed unsafe class AudioDevice : IDisposable public uint Size { get; private set; } - public AudioDevice() + public AudioStatus Status => (AudioStatus)SDL.GetAudioDeviceStatus(_deviceID); + + internal AudioDevice() { } - public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) + internal AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) : this(frequency, format, channels, samples, null!) { } - public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) + internal AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) : this(frequency, format, channels, samples, callback, AudioDeviceAllowedChanges.None) { } - public AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) + internal AudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) { Open(frequency, format, channels, samples, callback, allowedChanges); } @@ -133,7 +135,7 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe format = (ushort)format, channels = (byte)channels, silence = 0, - samples = 0, + samples = samples, padding = 0, size = 0 }; @@ -141,11 +143,10 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe if (callback != null) { _callback = callback; - _unmanagedUserdata = GCHandle.Alloc(this, GCHandleType.Normal); - _unmanagedCallback = new AudioDeviceCallbackDelegate(OnAudioDeviceCallback); - - desiredSpec.callback = Marshal.GetFunctionPointerForDelegate(_unmanagedCallback); - desiredSpec.userdata = (void*)(IntPtr)_unmanagedUserdata; + _callbackUserData = GCHandle.Alloc(this, GCHandleType.Normal); + _callbackDelegate = new AudioDeviceCallbackDelegate(OnAudioDeviceCallback); + desiredSpec.callback = Marshal.GetFunctionPointerForDelegate(_callbackDelegate); + desiredSpec.userdata = (void*)(IntPtr)_callbackUserData; } var obtainedSpec = new SDL_AudioSpec(); @@ -178,11 +179,11 @@ public void Close() _deviceID = 0; _callback = null!; - _unmanagedCallback = null!; + _callbackDelegate = null!; - if (_unmanagedUserdata.IsAllocated) + if (_callbackUserData.IsAllocated) { - _unmanagedUserdata.Free(); + _callbackUserData.Free(); } } } diff --git a/sources/SDL2Sharp/AudioDeviceAllowedChanges.cs b/sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs similarity index 97% rename from sources/SDL2Sharp/AudioDeviceAllowedChanges.cs rename to sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs index 989d3eef..7854d497 100644 --- a/sources/SDL2Sharp/AudioDeviceAllowedChanges.cs +++ b/sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using SDL2Sharp.Interop; using System; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { [Flags] public enum AudioDeviceAllowedChanges diff --git a/sources/SDL2Sharp/AudioDeviceCallback.cs b/sources/SDL2Sharp/Audio/AudioDeviceCallback.cs similarity index 96% rename from sources/SDL2Sharp/AudioDeviceCallback.cs rename to sources/SDL2Sharp/Audio/AudioDeviceCallback.cs index a4ca1a4f..41830c9d 100644 --- a/sources/SDL2Sharp/AudioDeviceCallback.cs +++ b/sources/SDL2Sharp/Audio/AudioDeviceCallback.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public delegate void AudioDeviceCallback(Span stream); } diff --git a/sources/SDL2Sharp/AudioFormat.cs b/sources/SDL2Sharp/Audio/AudioFormat.cs similarity index 97% rename from sources/SDL2Sharp/AudioFormat.cs rename to sources/SDL2Sharp/Audio/AudioFormat.cs index 11cf9780..798ddc65 100644 --- a/sources/SDL2Sharp/AudioFormat.cs +++ b/sources/SDL2Sharp/Audio/AudioFormat.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public enum AudioFormat : ushort { diff --git a/sources/SDL2Sharp/AudioFormatExtensions.cs b/sources/SDL2Sharp/Audio/AudioFormatExtensions.cs similarity index 98% rename from sources/SDL2Sharp/AudioFormatExtensions.cs rename to sources/SDL2Sharp/Audio/AudioFormatExtensions.cs index bdfb9296..8515b08d 100644 --- a/sources/SDL2Sharp/AudioFormatExtensions.cs +++ b/sources/SDL2Sharp/Audio/AudioFormatExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public static class AudioFormatExtensions { diff --git a/sources/SDL2Sharp/Audio/AudioStatus.cs b/sources/SDL2Sharp/Audio/AudioStatus.cs new file mode 100644 index 00000000..c131ec4e --- /dev/null +++ b/sources/SDL2Sharp/Audio/AudioStatus.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_AudioStatus; + +namespace SDL2Sharp.Audio +{ + public enum AudioStatus : ushort + { + Stopped = SDL_AUDIO_STOPPED, + Playing = SDL_AUDIO_PLAYING, + Paused = SDL_AUDIO_PAUSED + } +} diff --git a/sources/SDL2Sharp/Audio/AudioSubsystem.cs b/sources/SDL2Sharp/Audio/AudioSubsystem.cs new file mode 100644 index 00000000..21070615 --- /dev/null +++ b/sources/SDL2Sharp/Audio/AudioSubsystem.cs @@ -0,0 +1,67 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Audio +{ + public sealed class AudioSubsystem : IDisposable + { + private const uint InitSubsystemFlags = SDL.SDL_INIT_AUDIO; + + public const int MixMaxVolume = SDL.SDL_MIX_MAXVOLUME; + + public AudioSubsystem() + { + SDL.InitSubSystem(InitSubsystemFlags); + } + + public void Dispose() + { + SDL.QuitSubSystem(InitSubsystemFlags); + } + + public AudioDevice CreateDevice() + { + return new AudioDevice(); + } + + public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) + { + return new AudioDevice(frequency, format, channels, samples); + } + + public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) + { + return new AudioDevice(frequency, format, channels, samples, callback); + } + + public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) + { + return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); + } + + public WaveFile OpenWaveFile(string filename) + { + return new WaveFile(filename); + } + } +} diff --git a/sources/SDL2Sharp/ReadOnlySpanExtensions.cs b/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs similarity index 99% rename from sources/SDL2Sharp/ReadOnlySpanExtensions.cs rename to sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs index 3261dc18..21588eb5 100644 --- a/sources/SDL2Sharp/ReadOnlySpanExtensions.cs +++ b/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public static class ReadOnlySpanExtensions { diff --git a/sources/SDL2Sharp/SpanExtensions.cs b/sources/SDL2Sharp/Audio/SpanExtensions.cs similarity index 97% rename from sources/SDL2Sharp/SpanExtensions.cs rename to sources/SDL2Sharp/Audio/SpanExtensions.cs index f83194dc..0bc140b4 100644 --- a/sources/SDL2Sharp/SpanExtensions.cs +++ b/sources/SDL2Sharp/Audio/SpanExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public static class SpanExtensions { diff --git a/sources/SDL2Sharp/WaveFile.cs b/sources/SDL2Sharp/Audio/WaveFile.cs similarity index 97% rename from sources/SDL2Sharp/WaveFile.cs rename to sources/SDL2Sharp/Audio/WaveFile.cs index 13bc652f..61939a81 100644 --- a/sources/SDL2Sharp/WaveFile.cs +++ b/sources/SDL2Sharp/Audio/WaveFile.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,7 +22,7 @@ using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Audio { public sealed unsafe class WaveFile : IDisposable { @@ -48,7 +48,7 @@ public sealed unsafe class WaveFile : IDisposable public uint Length => _waveLength; - public WaveFile(string filename) + internal WaveFile(string filename) { using var unmanagedFilename = new MarshaledString(filename); using var unmanagedMode = new MarshaledString("rb"); diff --git a/sources/SDL2Sharp/Font.cs b/sources/SDL2Sharp/Fonts/Font.cs similarity index 95% rename from sources/SDL2Sharp/Font.cs rename to sources/SDL2Sharp/Fonts/Font.cs index 95b04e7e..1a555e46 100644 --- a/sources/SDL2Sharp/Font.cs +++ b/sources/SDL2Sharp/Fonts/Font.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,17 +19,18 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Colors; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Fonts { public sealed unsafe class Font : IDisposable { private _TTF_Font* _handle; - public Font(string path, int pointSize) + internal Font(string path, int pointSize) { using var marshaledPath = new MarshaledString(path); var handle = TTF.OpenFont(marshaledPath, pointSize); diff --git a/sources/SDL2Sharp/FontError.cs b/sources/SDL2Sharp/Fonts/FontError.cs similarity index 98% rename from sources/SDL2Sharp/FontError.cs rename to sources/SDL2Sharp/Fonts/FontError.cs index 82e557a9..6678e77d 100644 --- a/sources/SDL2Sharp/FontError.cs +++ b/sources/SDL2Sharp/Fonts/FontError.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,7 +22,7 @@ using System.Runtime.Serialization; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Fonts { public sealed class FontError : Exception { diff --git a/sources/SDL2Sharp/Fonts/FontSubsystem.cs b/sources/SDL2Sharp/Fonts/FontSubsystem.cs new file mode 100644 index 00000000..7667bad1 --- /dev/null +++ b/sources/SDL2Sharp/Fonts/FontSubsystem.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Fonts +{ + public sealed class FontSubsystem : IDisposable + { + public FontSubsystem() + { + TTF.Init(); + } + + public void Dispose() + { + TTF.Quit(); + } + + public Font OpenFont(string path, int pointSize) + { + return new Font(path, pointSize); + } + } +} diff --git a/sources/SDL2Sharp/Hints.cs b/sources/SDL2Sharp/Hints.cs index 1d3de5c2..9f78e8f5 100644 --- a/sources/SDL2Sharp/Hints.cs +++ b/sources/SDL2Sharp/Hints.cs @@ -119,7 +119,7 @@ public static class Hints public static readonly string GameControllerUseButtonLabels = SDL.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS.AsString(); - public static readonly string JOYSTICK_ALLOW_BACKGROUND_EVENTS = SDL.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS.AsString(); + public static readonly string JoystickAllowBackgroundEvents = SDL.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS.AsString(); public static readonly string JoystickHidApi = SDL.SDL_HINT_JOYSTICK_HIDAPI.AsString(); diff --git a/tests/SDL2Sharp.Tests/ApplicationTests.cs b/sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs similarity index 79% rename from tests/SDL2Sharp.Tests/ApplicationTests.cs rename to sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs index f69ec610..682c0242 100644 --- a/tests/SDL2Sharp.Tests/ApplicationTests.cs +++ b/sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs @@ -18,18 +18,14 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using Xunit; +using SDL2Sharp.Interop; -namespace SDL2Sharp.Tests +namespace SDL2Sharp.Input { - public static class ApplicationTests + public sealed class AppDidEnterBackgroundEvent : Event { - private sealed class App : Application { } - - [Fact] - public static void TestConstructor() - { - Assert.NotNull(new App()); - } + internal AppDidEnterBackgroundEvent(SDL_Event handle) + : base(handle) + { } } } diff --git a/sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs b/sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs new file mode 100644 index 00000000..7d2bbd6c --- /dev/null +++ b/sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AppDidEnterForegroundEvent : Event + { + internal AppDidEnterForegroundEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AppLowMemoryEvent.cs b/sources/SDL2Sharp/Input/AppLowMemoryEvent.cs new file mode 100644 index 00000000..77d31435 --- /dev/null +++ b/sources/SDL2Sharp/Input/AppLowMemoryEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AppLowMemoryEvent : Event + { + internal AppLowMemoryEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AppTerminatingEvent.cs b/sources/SDL2Sharp/Input/AppTerminatingEvent.cs new file mode 100644 index 00000000..d568876d --- /dev/null +++ b/sources/SDL2Sharp/Input/AppTerminatingEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AppTerminatingEvent : Event + { + internal AppTerminatingEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs b/sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs new file mode 100644 index 00000000..d23f4f10 --- /dev/null +++ b/sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AppWillEnterBackgroundEvent : Event + { + internal AppWillEnterBackgroundEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs b/sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs new file mode 100644 index 00000000..c1ba7d69 --- /dev/null +++ b/sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AppWillEnterForegroundEvent : Event + { + internal AppWillEnterForegroundEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs b/sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs new file mode 100644 index 00000000..8da7ee75 --- /dev/null +++ b/sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AudioDeviceAddedEvent : Event + { + internal AudioDeviceAddedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs b/sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs new file mode 100644 index 00000000..4408991a --- /dev/null +++ b/sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class AudioDeviceRemovedEvent : Event + { + internal AudioDeviceRemovedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs b/sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs new file mode 100644 index 00000000..5dd4f4d3 --- /dev/null +++ b/sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ClipboardUpdateEvent : Event + { + internal ClipboardUpdateEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs b/sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs new file mode 100644 index 00000000..0afe2c71 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerAxisMotionEvent : Event + { + internal ControllerAxisMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs b/sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs new file mode 100644 index 00000000..56309030 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerButtonDownEvent : Event + { + internal ControllerButtonDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs b/sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs new file mode 100644 index 00000000..7c52b7e2 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerButtonUpEvent : Event + { + internal ControllerButtonUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs b/sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs new file mode 100644 index 00000000..90235834 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerDeviceAddedEvent : Event + { + internal ControllerDeviceAddedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs b/sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs new file mode 100644 index 00000000..f06099ed --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerDeviceRemappedEvent : Event + { + internal ControllerDeviceRemappedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs b/sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs new file mode 100644 index 00000000..421cc318 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerDeviceRemovedEvent : Event + { + internal ControllerDeviceRemovedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs b/sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs new file mode 100644 index 00000000..d2b3c386 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerSensorUpdateEvent : Event + { + internal ControllerSensorUpdateEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs b/sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs new file mode 100644 index 00000000..fe3069cd --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerTouchpadDownEvent : Event + { + internal ControllerTouchpadDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs b/sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs new file mode 100644 index 00000000..c06468c7 --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerTouchpadMotionEvent : Event + { + internal ControllerTouchpadMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs b/sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs new file mode 100644 index 00000000..d518f77e --- /dev/null +++ b/sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class ControllerTouchpadUpEvent : Event + { + internal ControllerTouchpadUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DisplayEvent.cs b/sources/SDL2Sharp/Input/DisplayEvent.cs new file mode 100644 index 00000000..8bc2fedc --- /dev/null +++ b/sources/SDL2Sharp/Input/DisplayEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DisplayEvent : Event + { + internal DisplayEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DollarGestureEvent.cs b/sources/SDL2Sharp/Input/DollarGestureEvent.cs new file mode 100644 index 00000000..8fbdcc9e --- /dev/null +++ b/sources/SDL2Sharp/Input/DollarGestureEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DollarGestureEvent : Event + { + internal DollarGestureEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DollarRecordEvent.cs b/sources/SDL2Sharp/Input/DollarRecordEvent.cs new file mode 100644 index 00000000..424c93b9 --- /dev/null +++ b/sources/SDL2Sharp/Input/DollarRecordEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DollarRecordEvent : Event + { + internal DollarRecordEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DropBeginEvent.cs b/sources/SDL2Sharp/Input/DropBeginEvent.cs new file mode 100644 index 00000000..c71e8370 --- /dev/null +++ b/sources/SDL2Sharp/Input/DropBeginEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DropBeginEvent : Event + { + internal DropBeginEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DropCompleteEvent.cs b/sources/SDL2Sharp/Input/DropCompleteEvent.cs new file mode 100644 index 00000000..d1afc50d --- /dev/null +++ b/sources/SDL2Sharp/Input/DropCompleteEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DropCompleteEvent : Event + { + internal DropCompleteEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DropFileEvent.cs b/sources/SDL2Sharp/Input/DropFileEvent.cs new file mode 100644 index 00000000..a90c3d69 --- /dev/null +++ b/sources/SDL2Sharp/Input/DropFileEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DropFileEvent : Event + { + internal DropFileEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/DropTextEvent.cs b/sources/SDL2Sharp/Input/DropTextEvent.cs new file mode 100644 index 00000000..bb61f8bd --- /dev/null +++ b/sources/SDL2Sharp/Input/DropTextEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class DropTextEvent : Event + { + internal DropTextEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/WindowSizeChangedEventArgs.cs b/sources/SDL2Sharp/Input/Event.cs similarity index 75% rename from sources/SDL2Sharp/WindowSizeChangedEventArgs.cs rename to sources/SDL2Sharp/Input/Event.cs index b5f63ca1..bde9a570 100644 --- a/sources/SDL2Sharp/WindowSizeChangedEventArgs.cs +++ b/sources/SDL2Sharp/Input/Event.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,20 +18,23 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; +using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { - public sealed class WindowSizeChangedEventArgs : EventArgs + public abstract class Event { - public int Width { get; } + protected SDL_Event _handle; - public int Height { get; } + internal SDL_Event Handle => _handle; - public WindowSizeChangedEventArgs(int width, int height) + protected Event() + : this(new SDL_Event()) + { } + + protected Event(SDL_Event handle) { - Width = width; - Height = height; + _handle = handle; } } -} +} \ No newline at end of file diff --git a/sources/SDL2Sharp/Input/EventSubsystem.cs b/sources/SDL2Sharp/Input/EventSubsystem.cs new file mode 100644 index 00000000..210578f2 --- /dev/null +++ b/sources/SDL2Sharp/Input/EventSubsystem.cs @@ -0,0 +1,275 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed unsafe class EventSubsystem : IDisposable + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int EventWatchCallbackDelegate(void* userdata, SDL_Event* @event); + + private const uint InitSubsystemFlags = SDL.SDL_INIT_EVENTS; + + private readonly EventWatchCallbackDelegate _watchCallback = null!; + + private GCHandle _watchCallbackUserData = default; + + private readonly HashSet> _watchCallbacks = new(); + + public EventSubsystem() + { + SDL.InitSubSystem(InitSubsystemFlags); + + _watchCallbackUserData = GCHandle.Alloc(this, GCHandleType.Normal); + var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; + _watchCallback = new EventWatchCallbackDelegate(OnEventWatchCallback); + var watchCallbackPointer = Marshal.GetFunctionPointerForDelegate(_watchCallback); + + SDL.AddEventWatch(watchCallbackPointer, watchUserDataPointer); + } + + public void Dispose() + { + var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; + var watchCallbackPointer = Marshal.GetFunctionPointerForDelegate(_watchCallback); + SDL.DelEventWatch(watchCallbackPointer, watchUserDataPointer); + + if (_watchCallbackUserData.IsAllocated) + { + _watchCallbackUserData.Free(); + } + + SDL.QuitSubSystem(InitSubsystemFlags); + } + + public Event? PollEvent() + { + var @event = new SDL_Event(); + if (SDL.PollEvent(&@event) == 0) + { + return null; + } + return WrapEvent(@event); + } + + public void PushEvent(Event @event) + { + var eventHandle = @event.Handle; + var result = SDL.PushEvent(&@eventHandle); + Error.ThrowOnFailure(result); + } + + + public void AddWatch(Action callback) + { + _watchCallbacks.Add(callback); + } + + public void DeleteWatch(Action callback) + { + _watchCallbacks.Remove(callback); + } + + private static Event WrapEvent(SDL_Event @event) + { + var eventType = (SDL_EventType)@event.type; + switch (eventType) + { + case SDL_EventType.SDL_QUIT: + return new QuitEvent(@event); + case SDL_EventType.SDL_APP_TERMINATING: + return new AppTerminatingEvent(@event); + case SDL_EventType.SDL_APP_LOWMEMORY: + return new AppLowMemoryEvent(@event); + case SDL_EventType.SDL_APP_WILLENTERBACKGROUND: + return new AppWillEnterBackgroundEvent(@event); + case SDL_EventType.SDL_APP_DIDENTERBACKGROUND: + return new AppDidEnterBackgroundEvent(@event); + case SDL_EventType.SDL_APP_WILLENTERFOREGROUND: + return new AppWillEnterForegroundEvent(@event); + case SDL_EventType.SDL_APP_DIDENTERFOREGROUND: + return new AppDidEnterForegroundEvent(@event); + case SDL_EventType.SDL_LOCALECHANGED: + return new LocaleChangedEvent(@event); + case SDL_EventType.SDL_DISPLAYEVENT: + return new DisplayEvent(@event); + case SDL_EventType.SDL_WINDOWEVENT: + switch ((SDL_WindowEventID)@event.window.@event) + { + case SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN: + return new WindowShownEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_HIDDEN: + return new WindowHiddenEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_EXPOSED: + return new WindowExposedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_MOVED: + return new WindowMovedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_RESIZED: + return new WindowResizedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED: + return new WindowSizeChangedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_MINIMIZED: + return new WindowMinimizedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_MAXIMIZED: + return new WindowMaximizedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_RESTORED: + return new WindowRestoredEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_ENTER: + return new WindowEnterEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_LEAVE: + return new WindowLeaveEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED: + return new WindowFocusGainedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST: + return new WindowFocusLostEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_CLOSE: + return new WindowCloseEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_TAKE_FOCUS: + return new WindowTakeFocusEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_HIT_TEST: + return new WindowHitTestEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_ICCPROF_CHANGED: + return new WindowIccProfileChangedEvent(@event); + case SDL_WindowEventID.SDL_WINDOWEVENT_DISPLAY_CHANGED: + return new WindowDisplayChangedEvent(@event); + } + break; + case SDL_EventType.SDL_SYSWMEVENT: + return new SystemWindowManagerEvent(@event); + case SDL_EventType.SDL_KEYDOWN: + return new KeyDownEvent(@event); + case SDL_EventType.SDL_KEYUP: + return new KeyUpEvent(@event); + case SDL_EventType.SDL_TEXTEDITING: + return new TextEditingEvent(@event); + case SDL_EventType.SDL_TEXTINPUT: + return new TextInputEvent(@event); + case SDL_EventType.SDL_KEYMAPCHANGED: + return new KeyMapChangedEvent(@event); + case SDL_EventType.SDL_TEXTEDITING_EXT: + return new TextEditingExtEvent(@event); + case SDL_EventType.SDL_MOUSEMOTION: + return new MouseMotionEvent(@event); + case SDL_EventType.SDL_MOUSEBUTTONDOWN: + return new MouseButtonDownEvent(@event); + case SDL_EventType.SDL_MOUSEBUTTONUP: + return new MouseButtonUpEvent(@event); + case SDL_EventType.SDL_MOUSEWHEEL: + return new MouseWheelEvent(@event); + case SDL_EventType.SDL_JOYAXISMOTION: + return new JoystickAxisMotionEvent(@event); + case SDL_EventType.SDL_JOYBALLMOTION: + return new JoystickBallMotionEvent(@event); + case SDL_EventType.SDL_JOYHATMOTION: + return new JoystickHatMotionEvent(@event); + case SDL_EventType.SDL_JOYBUTTONDOWN: + return new JoystickButtonDownEvent(@event); + case SDL_EventType.SDL_JOYBUTTONUP: + return new JoystickButtonUpEvent(@event); + case SDL_EventType.SDL_JOYDEVICEADDED: + return new JoystickDeviceAddedEvent(@event); + case SDL_EventType.SDL_JOYDEVICEREMOVED: + return new JoystickDeviceRemovedEvent(@event); + case SDL_EventType.SDL_JOYBATTERYUPDATED: + return new JoystickBatteryUpdatedEvent(@event); + case SDL_EventType.SDL_CONTROLLERAXISMOTION: + return new ControllerAxisMotionEvent(@event); + case SDL_EventType.SDL_CONTROLLERBUTTONDOWN: + return new ControllerButtonDownEvent(@event); + case SDL_EventType.SDL_CONTROLLERBUTTONUP: + return new ControllerButtonUpEvent(@event); + case SDL_EventType.SDL_CONTROLLERDEVICEADDED: + return new ControllerDeviceAddedEvent(@event); + case SDL_EventType.SDL_CONTROLLERDEVICEREMOVED: + return new ControllerDeviceRemovedEvent(@event); + case SDL_EventType.SDL_CONTROLLERDEVICEREMAPPED: + return new ControllerDeviceRemappedEvent(@event); + case SDL_EventType.SDL_CONTROLLERTOUCHPADDOWN: + return new ControllerTouchpadDownEvent(@event); + case SDL_EventType.SDL_CONTROLLERTOUCHPADMOTION: + return new ControllerTouchpadMotionEvent(@event); + case SDL_EventType.SDL_CONTROLLERTOUCHPADUP: + return new ControllerTouchpadUpEvent(@event); + case SDL_EventType.SDL_CONTROLLERSENSORUPDATE: + return new ControllerSensorUpdateEvent(@event); + case SDL_EventType.SDL_FINGERDOWN: + return new FingerDownEvent(@event); + case SDL_EventType.SDL_FINGERUP: + return new FingerUpEvent(@event); + case SDL_EventType.SDL_FINGERMOTION: + return new FingerMotionEvent(@event); + case SDL_EventType.SDL_DOLLARGESTURE: + return new DollarGestureEvent(@event); + case SDL_EventType.SDL_DOLLARRECORD: + return new DollarRecordEvent(@event); + case SDL_EventType.SDL_MULTIGESTURE: + return new MultiGestureEvent(@event); + case SDL_EventType.SDL_CLIPBOARDUPDATE: + return new ClipboardUpdateEvent(@event); + case SDL_EventType.SDL_DROPFILE: + return new DropFileEvent(@event); + case SDL_EventType.SDL_DROPTEXT: + return new DropTextEvent(@event); + case SDL_EventType.SDL_DROPBEGIN: + return new DropBeginEvent(@event); + case SDL_EventType.SDL_DROPCOMPLETE: + return new DropCompleteEvent(@event); + case SDL_EventType.SDL_AUDIODEVICEADDED: + return new AudioDeviceAddedEvent(@event); + case SDL_EventType.SDL_AUDIODEVICEREMOVED: + return new AudioDeviceRemovedEvent(@event); + case SDL_EventType.SDL_SENSORUPDATE: + return new SensorUpdateEvent(@event); + case SDL_EventType.SDL_RENDER_TARGETS_RESET: + return new RenderTargetsResetEvent(@event); + case SDL_EventType.SDL_RENDER_DEVICE_RESET: + return new RenderDeviceResetEvent(@event); + case SDL_EventType.SDL_POLLSENTINEL: + return new PollSentinelEvent(@event); + case SDL_EventType.SDL_USEREVENT: + return new UserEvent(@event); + } + throw new NotImplementedException("Event type not implemented"); + } + + private void OnEventWatchCallback(Event @event) + { + foreach (var callback in _watchCallbacks) + { + callback(@event); + } + } + + private static int OnEventWatchCallback(void* userdata, SDL_Event* @event) + { + var eventSubsystemHandle = GCHandle.FromIntPtr((IntPtr)userdata); + if (eventSubsystemHandle.Target is EventSubsystem eventSubsystem) + { + eventSubsystem.OnEventWatchCallback(WrapEvent(*@event)); + } + return 0; + } + } +} diff --git a/sources/SDL2Sharp/Input/FingerDownEvent.cs b/sources/SDL2Sharp/Input/FingerDownEvent.cs new file mode 100644 index 00000000..c2a7bd22 --- /dev/null +++ b/sources/SDL2Sharp/Input/FingerDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class FingerDownEvent : Event + { + internal FingerDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/FingerMotionEvent.cs b/sources/SDL2Sharp/Input/FingerMotionEvent.cs new file mode 100644 index 00000000..b5c4ead6 --- /dev/null +++ b/sources/SDL2Sharp/Input/FingerMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class FingerMotionEvent : Event + { + internal FingerMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/FingerUpEvent.cs b/sources/SDL2Sharp/Input/FingerUpEvent.cs new file mode 100644 index 00000000..9cad90cc --- /dev/null +++ b/sources/SDL2Sharp/Input/FingerUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class FingerUpEvent : Event + { + internal FingerUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs b/sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs new file mode 100644 index 00000000..980fe582 --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickAxisMotionEvent : Event + { + internal JoystickAxisMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs b/sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs new file mode 100644 index 00000000..159f6c7b --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickBallMotionEvent : Event + { + internal JoystickBallMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs b/sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs new file mode 100644 index 00000000..467704b7 --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickBatteryUpdatedEvent : Event + { + internal JoystickBatteryUpdatedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs b/sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs new file mode 100644 index 00000000..748fe569 --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickButtonDownEvent : Event + { + internal JoystickButtonDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs b/sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs new file mode 100644 index 00000000..9901951b --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickButtonUpEvent : Event + { + internal JoystickButtonUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs b/sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs new file mode 100644 index 00000000..716a258a --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickDeviceAddedEvent : Event + { + internal JoystickDeviceAddedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs b/sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs new file mode 100644 index 00000000..165c5773 --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickDeviceRemovedEvent : Event + { + internal JoystickDeviceRemovedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs b/sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs new file mode 100644 index 00000000..8c705ccf --- /dev/null +++ b/sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class JoystickHatMotionEvent : Event + { + internal JoystickHatMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/KeyCode.cs b/sources/SDL2Sharp/Input/KeyCode.cs similarity index 99% rename from sources/SDL2Sharp/KeyCode.cs rename to sources/SDL2Sharp/Input/KeyCode.cs index 6205803f..dbbe7083 100644 --- a/sources/SDL2Sharp/KeyCode.cs +++ b/sources/SDL2Sharp/Input/KeyCode.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { public enum KeyCode { diff --git a/sources/SDL2Sharp/Input/KeyDownEvent.cs b/sources/SDL2Sharp/Input/KeyDownEvent.cs new file mode 100644 index 00000000..995822da --- /dev/null +++ b/sources/SDL2Sharp/Input/KeyDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class KeyDownEvent : KeyboardEvent + { + internal KeyDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/KeyMapChangedEvent.cs b/sources/SDL2Sharp/Input/KeyMapChangedEvent.cs new file mode 100644 index 00000000..3887ed8c --- /dev/null +++ b/sources/SDL2Sharp/Input/KeyMapChangedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class KeyMapChangedEvent : Event + { + internal KeyMapChangedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/KeyModifiers.cs b/sources/SDL2Sharp/Input/KeyModifiers.cs similarity index 97% rename from sources/SDL2Sharp/KeyModifiers.cs rename to sources/SDL2Sharp/Input/KeyModifiers.cs index ce6c5969..19057ba3 100644 --- a/sources/SDL2Sharp/KeyModifiers.cs +++ b/sources/SDL2Sharp/Input/KeyModifiers.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { [Flags] public enum KeyModifiers diff --git a/sources/SDL2Sharp/Input/KeyUpEvent.cs b/sources/SDL2Sharp/Input/KeyUpEvent.cs new file mode 100644 index 00000000..1cb30564 --- /dev/null +++ b/sources/SDL2Sharp/Input/KeyUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class KeyUpEvent : KeyboardEvent + { + internal KeyUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Internals/PlanarColorAttribute.cs b/sources/SDL2Sharp/Input/Keyboard.cs similarity index 57% rename from sources/SDL2Sharp/Internals/PlanarColorAttribute.cs rename to sources/SDL2Sharp/Input/Keyboard.cs index e5f4b2bd..1d70dd1f 100644 --- a/sources/SDL2Sharp/Internals/PlanarColorAttribute.cs +++ b/sources/SDL2Sharp/Input/Keyboard.cs @@ -19,29 +19,40 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Reflection; +using SDL2Sharp.Interop; -namespace SDL2Sharp.Internals +namespace SDL2Sharp.Input { - [AttributeUsage(AttributeTargets.Struct)] - internal sealed class PlanarColorAttribute : Attribute + public static unsafe class Keyboard { - public PixelFormatEnum PixelFormat { get; } + public static KeyboardState State + { + get + { + int keyCount; + byte* keyStates = SDL.GetKeyboardState(&keyCount); + return new KeyboardState(new Span(keyStates, keyCount)); + } + } + } + + public readonly ref struct KeyboardState + { + private readonly ReadOnlySpan _keyStates; - public PlanarColorAttribute(PixelFormatEnum pixelFormat) + public KeyboardState(Span keyStates) { - PixelFormat = pixelFormat; + _keyStates = keyStates; } - public static PixelFormatEnum GetPixelFormatOf() + public bool IsPressed(Scancode scanCode) { - var pixelFormatType = typeof(TPlanarColor); - var pixelFormatAttribute = pixelFormatType.GetCustomAttribute(); - if (pixelFormatAttribute == null) - { - return PixelFormatEnum.Unknown; - } - return pixelFormatAttribute.PixelFormat; + return _keyStates[(int)scanCode] == 1; + } + + public bool IsReleased(Scancode scanCode) + { + return _keyStates[(int)scanCode] == 0; } } } diff --git a/sources/SDL2Sharp/Subsystems.cs b/sources/SDL2Sharp/Input/KeyboardEvent.cs similarity index 65% rename from sources/SDL2Sharp/Subsystems.cs rename to sources/SDL2Sharp/Input/KeyboardEvent.cs index 95fedba8..54731dfa 100644 --- a/sources/SDL2Sharp/Subsystems.cs +++ b/sources/SDL2Sharp/Input/KeyboardEvent.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,24 +18,24 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { - [Flags] - public enum Subsystems : uint + public abstract class KeyboardEvent : Event { - None = 0, - Timer = SDL.SDL_INIT_TIMER, - Audio = SDL.SDL_INIT_AUDIO, - Video = SDL.SDL_INIT_VIDEO, - Joystick = SDL.SDL_INIT_JOYSTICK, - Haptic = SDL.SDL_INIT_HAPTIC, - GameController = SDL.SDL_INIT_GAMECONTROLLER, - Events = SDL.SDL_INIT_EVENTS, - Sensor = SDL.SDL_INIT_SENSOR, - NoParachute = SDL.SDL_INIT_NOPARACHUTE, - All = SDL.SDL_INIT_EVERYTHING, + public uint WindowID => _handle.key.windowID; + + public Scancode Scancode => (Scancode)_handle.key.keysym.scancode; + + public KeyCode KeyCode => (KeyCode)_handle.key.keysym.sym; + + public KeyModifiers Modifiers => (KeyModifiers)_handle.key.keysym.mod; + + public bool Repeat => _handle.key.repeat != 0; + + protected KeyboardEvent(SDL_Event handle) + : base(handle) + { } } } diff --git a/sources/SDL2Sharp/Input/LocaleChangedEvent.cs b/sources/SDL2Sharp/Input/LocaleChangedEvent.cs new file mode 100644 index 00000000..1937e221 --- /dev/null +++ b/sources/SDL2Sharp/Input/LocaleChangedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class LocaleChangedEvent : Event + { + internal LocaleChangedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/MouseButtonDownEvent.cs b/sources/SDL2Sharp/Input/MouseButtonDownEvent.cs new file mode 100644 index 00000000..d5074220 --- /dev/null +++ b/sources/SDL2Sharp/Input/MouseButtonDownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class MouseButtonDownEvent : Event + { + internal MouseButtonDownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/MouseButtonUpEvent.cs b/sources/SDL2Sharp/Input/MouseButtonUpEvent.cs new file mode 100644 index 00000000..e6de3402 --- /dev/null +++ b/sources/SDL2Sharp/Input/MouseButtonUpEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class MouseButtonUpEvent : Event + { + internal MouseButtonUpEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/MouseMotionEvent.cs b/sources/SDL2Sharp/Input/MouseMotionEvent.cs new file mode 100644 index 00000000..54192770 --- /dev/null +++ b/sources/SDL2Sharp/Input/MouseMotionEvent.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class MouseMotionEvent : Event + { + public uint WindowID => _handle.motion.windowID; + + public int X => _handle.motion.x; + + public int Y => _handle.motion.y; + + public int RelativeX => _handle.motion.xrel; + + public int RelativeY => _handle.motion.yrel; + + internal MouseMotionEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/MouseWheelDirection.cs b/sources/SDL2Sharp/Input/MouseWheelDirection.cs similarity index 96% rename from sources/SDL2Sharp/MouseWheelDirection.cs rename to sources/SDL2Sharp/Input/MouseWheelDirection.cs index 24007bfa..a41931dd 100644 --- a/sources/SDL2Sharp/MouseWheelDirection.cs +++ b/sources/SDL2Sharp/Input/MouseWheelDirection.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_MouseWheelDirection; -namespace SDL2Sharp +namespace SDL2Sharp.Input { public enum MouseWheelDirection { diff --git a/sources/SDL2Sharp/MouseMotionEventArgs.cs b/sources/SDL2Sharp/Input/MouseWheelEvent.cs similarity index 61% rename from sources/SDL2Sharp/MouseMotionEventArgs.cs rename to sources/SDL2Sharp/Input/MouseWheelEvent.cs index 2063e6fe..a3fc30f5 100644 --- a/sources/SDL2Sharp/MouseMotionEventArgs.cs +++ b/sources/SDL2Sharp/Input/MouseWheelEvent.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,26 +18,28 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; +using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { - public sealed class MouseMotionEventArgs : EventArgs + public sealed class MouseWheelEvent : Event { - public int X { get; } + public uint WindowID => _handle.wheel.windowID; - public int Y { get; } + public uint Which => _handle.wheel.which; - public int RelativeX { get; } + public MouseWheelDirection Direction => (MouseWheelDirection)_handle.wheel.direction; - public int RelativeY { get; } + public int X => _handle.wheel.x; - public MouseMotionEventArgs(int x, int y, int relativeX, int relativeY) - { - X = x; - Y = y; - RelativeX = relativeX; - RelativeY = relativeY; - } + public int Y => _handle.wheel.y; + + public float PreciseX => _handle.wheel.preciseX; + + public float PreciseY => _handle.wheel.preciseY; + + internal MouseWheelEvent(SDL_Event @event) + : base(@event) + { } } } diff --git a/sources/SDL2Sharp/Input/MultiGestureEvent.cs b/sources/SDL2Sharp/Input/MultiGestureEvent.cs new file mode 100644 index 00000000..ed48740f --- /dev/null +++ b/sources/SDL2Sharp/Input/MultiGestureEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class MultiGestureEvent : Event + { + internal MultiGestureEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/PollSentinelEvent.cs b/sources/SDL2Sharp/Input/PollSentinelEvent.cs new file mode 100644 index 00000000..fc6045de --- /dev/null +++ b/sources/SDL2Sharp/Input/PollSentinelEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class PollSentinelEvent : Event + { + internal PollSentinelEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/QuitEvent.cs b/sources/SDL2Sharp/Input/QuitEvent.cs new file mode 100644 index 00000000..46a20b0e --- /dev/null +++ b/sources/SDL2Sharp/Input/QuitEvent.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class QuitEvent : Event + { + public QuitEvent() + : base(new SDL_Event { type = (uint)SDL_EventType.SDL_QUIT }) + { } + + internal QuitEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs b/sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs new file mode 100644 index 00000000..66adeb3f --- /dev/null +++ b/sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class RenderDeviceResetEvent : Event + { + internal RenderDeviceResetEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs b/sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs new file mode 100644 index 00000000..988784bf --- /dev/null +++ b/sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class RenderTargetsResetEvent : Event + { + internal RenderTargetsResetEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Scancode.cs b/sources/SDL2Sharp/Input/Scancode.cs similarity index 99% rename from sources/SDL2Sharp/Scancode.cs rename to sources/SDL2Sharp/Input/Scancode.cs index 452c6794..edae8cb0 100644 --- a/sources/SDL2Sharp/Scancode.cs +++ b/sources/SDL2Sharp/Input/Scancode.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { public enum Scancode { diff --git a/sources/SDL2Sharp/Input/SensorUpdateEvent.cs b/sources/SDL2Sharp/Input/SensorUpdateEvent.cs new file mode 100644 index 00000000..5079fbe4 --- /dev/null +++ b/sources/SDL2Sharp/Input/SensorUpdateEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class SensorUpdateEvent : Event + { + internal SensorUpdateEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs b/sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs new file mode 100644 index 00000000..7880dff0 --- /dev/null +++ b/sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class SystemWindowManagerEvent : Event + { + internal SystemWindowManagerEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/TextEditingEvent.cs b/sources/SDL2Sharp/Input/TextEditingEvent.cs new file mode 100644 index 00000000..042118db --- /dev/null +++ b/sources/SDL2Sharp/Input/TextEditingEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class TextEditingEvent : Event + { + internal TextEditingEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/TextEditingExtEvent.cs b/sources/SDL2Sharp/Input/TextEditingExtEvent.cs new file mode 100644 index 00000000..ea7d78e4 --- /dev/null +++ b/sources/SDL2Sharp/Input/TextEditingExtEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class TextEditingExtEvent : Event + { + internal TextEditingExtEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/TextInputEvent.cs b/sources/SDL2Sharp/Input/TextInputEvent.cs new file mode 100644 index 00000000..be2d7fd4 --- /dev/null +++ b/sources/SDL2Sharp/Input/TextInputEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class TextInputEvent : Event + { + internal TextInputEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/UserEvent.cs b/sources/SDL2Sharp/Input/UserEvent.cs new file mode 100644 index 00000000..9508f596 --- /dev/null +++ b/sources/SDL2Sharp/Input/UserEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class UserEvent : Event + { + internal UserEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowCloseEvent.cs b/sources/SDL2Sharp/Input/WindowCloseEvent.cs new file mode 100644 index 00000000..7859aa7b --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowCloseEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowCloseEvent : WindowEvent + { + internal WindowCloseEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs b/sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs new file mode 100644 index 00000000..58cc9cab --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowDisplayChangedEvent : Event + { + internal WindowDisplayChangedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowEnterEvent.cs b/sources/SDL2Sharp/Input/WindowEnterEvent.cs new file mode 100644 index 00000000..5b094551 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowEnterEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowEnterEvent : WindowEvent + { + internal WindowEnterEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowEvent.cs b/sources/SDL2Sharp/Input/WindowEvent.cs new file mode 100644 index 00000000..00476664 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowEvent.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public abstract class WindowEvent : Event + { + public uint WindowID => _handle.window.windowID; + + protected WindowEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowExposedEvent.cs b/sources/SDL2Sharp/Input/WindowExposedEvent.cs new file mode 100644 index 00000000..4a83df5a --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowExposedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowExposedEvent : WindowEvent + { + internal WindowExposedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs b/sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs new file mode 100644 index 00000000..5fa84579 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowFocusGainedEvent : WindowEvent + { + internal WindowFocusGainedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowFocusLostEvent.cs b/sources/SDL2Sharp/Input/WindowFocusLostEvent.cs new file mode 100644 index 00000000..a044acf4 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowFocusLostEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowFocusLostEvent : WindowEvent + { + internal WindowFocusLostEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowHiddenEvent.cs b/sources/SDL2Sharp/Input/WindowHiddenEvent.cs new file mode 100644 index 00000000..4b6dc707 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowHiddenEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowHiddenEvent : WindowEvent + { + internal WindowHiddenEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowHitTestEvent.cs b/sources/SDL2Sharp/Input/WindowHitTestEvent.cs new file mode 100644 index 00000000..fe6fe1c8 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowHitTestEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowHitTestEvent : WindowEvent + { + internal WindowHitTestEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs b/sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs new file mode 100644 index 00000000..56923888 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowIccProfileChangedEvent : Event + { + internal WindowIccProfileChangedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowLeaveEvent.cs b/sources/SDL2Sharp/Input/WindowLeaveEvent.cs new file mode 100644 index 00000000..fb3e0a97 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowLeaveEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowLeaveEvent : WindowEvent + { + internal WindowLeaveEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowMaximizedEvent.cs b/sources/SDL2Sharp/Input/WindowMaximizedEvent.cs new file mode 100644 index 00000000..03e2aa26 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowMaximizedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowMaximizedEvent : WindowEvent + { + internal WindowMaximizedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowMinimizedEvent.cs b/sources/SDL2Sharp/Input/WindowMinimizedEvent.cs new file mode 100644 index 00000000..cc19b30e --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowMinimizedEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowMinimizedEvent : WindowEvent + { + internal WindowMinimizedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/WindowResizedEventArgs.cs b/sources/SDL2Sharp/Input/WindowMovedEvent.cs similarity index 75% rename from sources/SDL2Sharp/WindowResizedEventArgs.cs rename to sources/SDL2Sharp/Input/WindowMovedEvent.cs index 5eeed938..4de3fec7 100644 --- a/sources/SDL2Sharp/WindowResizedEventArgs.cs +++ b/sources/SDL2Sharp/Input/WindowMovedEvent.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,20 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; +using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Input { - public sealed class WindowResizedEventArgs : EventArgs + public sealed class WindowMovedEvent : WindowEvent { - public int Width { get; } + public int X => _handle.window.data1; - public int Height { get; } + public int Y => _handle.window.data2; - public WindowResizedEventArgs(int width, int height) - { - Width = width; - Height = height; - } + internal WindowMovedEvent(SDL_Event handle) + : base(handle) + { } } } diff --git a/sources/SDL2Sharp/Input/WindowResizedEvent.cs b/sources/SDL2Sharp/Input/WindowResizedEvent.cs new file mode 100644 index 00000000..ff85bdf9 --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowResizedEvent.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowResizedEvent : WindowEvent + { + public int Width => _handle.window.data1; + + public int Height => _handle.window.data2; + + internal WindowResizedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowRestoredEvent.cs b/sources/SDL2Sharp/Input/WindowRestoredEvent.cs new file mode 100644 index 00000000..bfd28dde --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowRestoredEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowRestoredEvent : WindowEvent + { + internal WindowRestoredEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowShownEvent.cs b/sources/SDL2Sharp/Input/WindowShownEvent.cs new file mode 100644 index 00000000..d5ba93bf --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowShownEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowShownEvent : WindowEvent + { + internal WindowShownEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs b/sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs new file mode 100644 index 00000000..c70d5e9f --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowSizeChangedEvent : WindowEvent + { + public int Width => _handle.window.data1; + + public int Height => _handle.window.data2; + + internal WindowSizeChangedEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs b/sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs new file mode 100644 index 00000000..b693801b --- /dev/null +++ b/sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Input +{ + public sealed class WindowTakeFocusEvent : WindowEvent + { + internal WindowTakeFocusEvent(SDL_Event handle) + : base(handle) + { } + } +} diff --git a/sources/SDL2Sharp/KeyEventArgs.cs b/sources/SDL2Sharp/KeyEventArgs.cs deleted file mode 100644 index 53732856..00000000 --- a/sources/SDL2Sharp/KeyEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; - -namespace SDL2Sharp -{ - public sealed class KeyEventArgs : EventArgs - { - public KeyEventArgs(Scancode scanCode, KeyCode keyCode, KeyModifiers modifiers, int repeat) - { - ScanCode = scanCode; - KeyCode = keyCode; - Modifiers = modifiers; - Repeat = repeat; - } - - public Scancode ScanCode { get; } - - public KeyCode KeyCode { get; } - - public KeyModifiers Modifiers { get; } - - public bool Alt => Modifiers.HasFlag(KeyModifiers.LeftAlt) || Modifiers.HasFlag(KeyModifiers.RightAlt); - - public bool Ctrl => Modifiers.HasFlag(KeyModifiers.LeftCtrl) || Modifiers.HasFlag(KeyModifiers.RightCtrl); - - public bool Shift => Modifiers.HasFlag(KeyModifiers.LeftShift) || Modifiers.HasFlag(KeyModifiers.RightShift); - - public int Repeat { get; } - } -} diff --git a/tests/SDL2Sharp.Tests/AssemblyFixture.cs b/sources/SDL2Sharp/MainSystem.cs similarity index 84% rename from tests/SDL2Sharp.Tests/AssemblyFixture.cs rename to sources/SDL2Sharp/MainSystem.cs index 17a3d12e..52d59d3b 100644 --- a/tests/SDL2Sharp.Tests/AssemblyFixture.cs +++ b/sources/SDL2Sharp/MainSystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,13 +21,13 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Tests +namespace SDL2Sharp { - public sealed class AssemblyFixture : IDisposable + public sealed class MainSystem : IDisposable { - public AssemblyFixture() + public MainSystem() { - Error.ThrowOnFailure(SDL.Init(SDL.SDL_INIT_EVERYTHING)); + SDL.Init(0); } public void Dispose() @@ -36,4 +36,3 @@ public void Dispose() } } } - diff --git a/sources/SDL2Sharp/MathExtensions.cs b/sources/SDL2Sharp/Math.cs similarity index 100% rename from sources/SDL2Sharp/MathExtensions.cs rename to sources/SDL2Sharp/Math.cs diff --git a/sources/SDL2Sharp/MouseWheelEventArgs.cs b/sources/SDL2Sharp/MouseWheelEventArgs.cs deleted file mode 100644 index 873f0141..00000000 --- a/sources/SDL2Sharp/MouseWheelEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp -{ - public sealed class MouseWheelEventArgs - { - public uint Which { get; } - - public MouseWheelDirection Direction { get; } - - public int X { get; } - - public int Y { get; } - - public float PreciseX { get; } - - public float PreciseY { get; } - - public MouseWheelEventArgs(uint which, MouseWheelDirection direction, int x, int y, float preciseX, float preciseY) - { - Which = which; - Direction = direction; - X = x; - Y = y; - PreciseX = preciseX; - PreciseY = preciseY; - } - } -} diff --git a/sources/SDL2Sharp/Platform.cs b/sources/SDL2Sharp/Platform.cs deleted file mode 100644 index 1408c455..00000000 --- a/sources/SDL2Sharp/Platform.cs +++ /dev/null @@ -1,128 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using SDL2Sharp.Interop; - -namespace SDL2Sharp -{ - public sealed class Platform : IDisposable - { - private VideoSubsystem _videoSubsystem = null!; - - private AudioSystem _audioSubsystem = null!; - - private EventSubsystem _eventsSubsystem = null!; - - public static Platform Instance { get; private set; } = null!; - - public VideoSubsystem Video => _videoSubsystem ??= new VideoSubsystem(); - - public AudioSystem Audio => _audioSubsystem ??= new AudioSystem(); - - public EventSubsystem Events => _eventsSubsystem ??= new EventSubsystem(); - - internal Platform() - { - if (Instance != null) - { - throw new InvalidOperationException("Only one instance of Platform is allowed."); - } - - Instance = this; - - SDL.Init(0); - } - - void IDisposable.Dispose() - { - if (Instance != null) - { - SDL.Quit(); - } - - Instance = null!; - } - } - - public sealed class VideoSubsystem : IDisposable - { - internal VideoSubsystem() - { - SDL.InitSubSystem(SDL.SDL_INIT_VIDEO); - } - - void IDisposable.Dispose() - { - SDL.QuitSubSystem(SDL.SDL_INIT_VIDEO); - } - } - - public sealed class AudioSystem : IDisposable - { - internal AudioSystem() - { - SDL.InitSubSystem(SDL.SDL_INIT_AUDIO); - } - - void IDisposable.Dispose() - { - SDL.QuitSubSystem(SDL.SDL_INIT_AUDIO); - } - - public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) - { - return new AudioDevice(frequency, format, channels, samples); - } - - public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) - { - return new AudioDevice(frequency, format, channels, samples, callback); - } - - public AudioDevice CreateAudioDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) - { - return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); - } - } - - public sealed class EventSubsystem : IDisposable - { - internal EventSubsystem() - { - SDL.InitSubSystem(SDL.SDL_INIT_EVENTS); - } - - void IDisposable.Dispose() - { - SDL.QuitSubSystem(SDL.SDL_INIT_EVENTS); - } - - public bool HasEvent(uint eventType) - { - return SDL.HasEvent(eventType) == SDL_bool.SDL_TRUE; - } - - public void PumpEvents() - { - SDL.PumpEvents(); - } - } -} diff --git a/sources/SDL2Sharp/ArrayOrder.cs b/sources/SDL2Sharp/Video/ArrayOrder.cs similarity index 97% rename from sources/SDL2Sharp/ArrayOrder.cs rename to sources/SDL2Sharp/Video/ArrayOrder.cs index 2b857077..bad6474e 100644 --- a/sources/SDL2Sharp/ArrayOrder.cs +++ b/sources/SDL2Sharp/Video/ArrayOrder.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_ArrayOrder; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum ArrayOrder { diff --git a/sources/SDL2Sharp/BitmapOrder.cs b/sources/SDL2Sharp/Video/BitmapOrder.cs similarity index 96% rename from sources/SDL2Sharp/BitmapOrder.cs rename to sources/SDL2Sharp/Video/BitmapOrder.cs index 7a170424..49844b6e 100644 --- a/sources/SDL2Sharp/BitmapOrder.cs +++ b/sources/SDL2Sharp/Video/BitmapOrder.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_BitmapOrder; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum BitmapOrder { diff --git a/sources/SDL2Sharp/BlendMode.cs b/sources/SDL2Sharp/Video/BlendMode.cs similarity index 97% rename from sources/SDL2Sharp/BlendMode.cs rename to sources/SDL2Sharp/Video/BlendMode.cs index d4f945a1..754da371 100644 --- a/sources/SDL2Sharp/BlendMode.cs +++ b/sources/SDL2Sharp/Video/BlendMode.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum BlendMode { diff --git a/sources/SDL2Sharp/Color.cs b/sources/SDL2Sharp/Video/Color.cs similarity index 77% rename from sources/SDL2Sharp/Color.cs rename to sources/SDL2Sharp/Video/Color.cs index f1091dc2..17874b3a 100644 --- a/sources/SDL2Sharp/Color.cs +++ b/sources/SDL2Sharp/Video/Color.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,10 +20,22 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public readonly struct Color { + public static readonly Color Black = new(0, 0, 0, 255); + + public static readonly Color White = new(255, 255, 255, 255); + + public static readonly Color Red = new(255, 0, 0, 255); + + public static readonly Color Green = new(0, 255, 0, 255); + + public static readonly Color Blue = new(0, 0, 255, 255); + + public static readonly Color Yellow = new(255, 255, 0, 255); + private readonly SDL_Color _handle; public Color(byte r, byte g, byte b, byte a) diff --git a/sources/SDL2Sharp/Video/ColorPlane.cs b/sources/SDL2Sharp/Video/ColorPlane.cs new file mode 100644 index 00000000..9359a191 --- /dev/null +++ b/sources/SDL2Sharp/Video/ColorPlane.cs @@ -0,0 +1,157 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video +{ + public readonly ref struct ColorPlane + { + private readonly Span _pixels; + + private readonly int _height; + + private readonly int _width; + + private readonly int _pitch; + + private readonly int _offset; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + } + + public ref byte this[int row, int column] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if (row < 0) + { + throw new ArgumentOutOfRangeException( + nameof(row), + row, + "row cannot be less than zero"); + } + + if (row >= _height) + { + throw new ArgumentOutOfRangeException( + nameof(column), + column, + "row cannot be greater than or equal to the height of the image"); + } + + if (column < 0) + { + throw new ArgumentOutOfRangeException( + nameof(column), + column, + "column cannot be less than zero"); + } + + if (column >= _width) + { + throw new ArgumentOutOfRangeException( + nameof(column), + column, + "column cannot be greater than or equal to the width of the image"); + } + + return ref DangerousGetReferenceAt(row, column); + } + } + + public unsafe ColorPlane(void* pixels, int height, int width, int pitch, int offset) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + if (_offset < 0) + { + throw new ArgumentOutOfRangeException( + nameof(offset), + offset, + "offset cannot be less than zero"); + } + + _pixels = new Span(pixels, height * pitch); + _height = height; + _width = width; + _pitch = pitch; + _offset = offset; + } + + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly ref byte DangerousGetReference() + { + ref var r0 = ref MemoryMarshal.GetReference(_pixels); + return ref Unsafe.Add(ref r0, _offset); + } + + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly ref byte DangerousGetReferenceAt(int row, int column) + { + ref var r0 = ref MemoryMarshal.GetReference(_pixels); + var index = row * _pitch + column + _offset; + return ref Unsafe.Add(ref r0, index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly void Fill(byte value) + { + _pixels.Fill(value); + } + } +} diff --git a/sources/SDL2Sharp/Colors/Abgr1555.cs b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Abgr1555.cs rename to sources/SDL2Sharp/Video/Colors/Abgr1555.cs index 7ef97ca5..cee799a8 100644 --- a/sources/SDL2Sharp/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ABGR1555)] diff --git a/sources/SDL2Sharp/Colors/Abgr4444.cs b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Abgr4444.cs rename to sources/SDL2Sharp/Video/Colors/Abgr4444.cs index 68a91b3f..f54df0a9 100644 --- a/sources/SDL2Sharp/Colors/Abgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ABGR4444)] diff --git a/sources/SDL2Sharp/Colors/Abgr8888.cs b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Abgr8888.cs rename to sources/SDL2Sharp/Video/Colors/Abgr8888.cs index b099c1c3..081254fd 100644 --- a/sources/SDL2Sharp/Colors/Abgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.ABGR8888)] diff --git a/sources/SDL2Sharp/Colors/Argb1555.cs b/sources/SDL2Sharp/Video/Colors/Argb1555.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Argb1555.cs rename to sources/SDL2Sharp/Video/Colors/Argb1555.cs index 58399135..e1bdede2 100644 --- a/sources/SDL2Sharp/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ARGB1555)] diff --git a/sources/SDL2Sharp/Colors/Argb2101010.cs b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Argb2101010.cs rename to sources/SDL2Sharp/Video/Colors/Argb2101010.cs index e56d6853..b31c37c8 100644 --- a/sources/SDL2Sharp/Colors/Argb2101010.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.ARGB2101010)] diff --git a/sources/SDL2Sharp/Colors/Argb4444.cs b/sources/SDL2Sharp/Video/Colors/Argb4444.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Argb4444.cs rename to sources/SDL2Sharp/Video/Colors/Argb4444.cs index fe3f0f56..9df10454 100644 --- a/sources/SDL2Sharp/Colors/Argb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.ARGB4444)] diff --git a/sources/SDL2Sharp/Colors/Argb8888.cs b/sources/SDL2Sharp/Video/Colors/Argb8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Argb8888.cs rename to sources/SDL2Sharp/Video/Colors/Argb8888.cs index bfcfd628..df663166 100644 --- a/sources/SDL2Sharp/Colors/Argb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.ARGB8888)] diff --git a/sources/SDL2Sharp/Colors/Bgr24.cs b/sources/SDL2Sharp/Video/Colors/Bgr24.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Bgr24.cs rename to sources/SDL2Sharp/Video/Colors/Bgr24.cs index 025fb1d9..f0167e43 100644 --- a/sources/SDL2Sharp/Colors/Bgr24.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr24.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] [PackedColor(PackedPixelFormat.BGR24)] diff --git a/sources/SDL2Sharp/Colors/Bgr565.cs b/sources/SDL2Sharp/Video/Colors/Bgr565.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Bgr565.cs rename to sources/SDL2Sharp/Video/Colors/Bgr565.cs index 775e5485..a8d3424b 100644 --- a/sources/SDL2Sharp/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr565.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.BGR565)] diff --git a/sources/SDL2Sharp/Colors/Bgra4444.cs b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Bgra4444.cs rename to sources/SDL2Sharp/Video/Colors/Bgra4444.cs index 3b3a8cab..3370bb63 100644 --- a/sources/SDL2Sharp/Colors/Bgra4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.BGRA4444)] diff --git a/sources/SDL2Sharp/Colors/Bgra5551.cs b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Bgra5551.cs rename to sources/SDL2Sharp/Video/Colors/Bgra5551.cs index 7eaecbda..8042b3c9 100644 --- a/sources/SDL2Sharp/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.BGRA5551)] diff --git a/sources/SDL2Sharp/Colors/Bgra8888.cs b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Bgra8888.cs rename to sources/SDL2Sharp/Video/Colors/Bgra8888.cs index a88533e0..2aeaba3f 100644 --- a/sources/SDL2Sharp/Colors/Bgra8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.BGRA8888)] diff --git a/sources/SDL2Sharp/Colors/Bgrx8888.cs b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Bgrx8888.cs rename to sources/SDL2Sharp/Video/Colors/Bgrx8888.cs index 92b207e8..0fd5037c 100644 --- a/sources/SDL2Sharp/Colors/Bgrx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.BGRX8888)] diff --git a/sources/SDL2Sharp/Colors/Rgb24.cs b/sources/SDL2Sharp/Video/Colors/Rgb24.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgb24.cs rename to sources/SDL2Sharp/Video/Colors/Rgb24.cs index 70d6b21a..529d17ea 100644 --- a/sources/SDL2Sharp/Colors/Rgb24.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb24.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] [PackedColor(PackedPixelFormat.RGB24)] diff --git a/sources/SDL2Sharp/Colors/Rgb32f.cs b/sources/SDL2Sharp/Video/Colors/Rgb32f.cs similarity index 99% rename from sources/SDL2Sharp/Colors/Rgb32f.cs rename to sources/SDL2Sharp/Video/Colors/Rgb32f.cs index a8de7d58..eb88fc26 100644 --- a/sources/SDL2Sharp/Colors/Rgb32f.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb32f.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] public readonly struct Rgb32f : IEquatable diff --git a/sources/SDL2Sharp/Colors/Rgb32fExtensions.cs b/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgb32fExtensions.cs rename to sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs index 928900bd..0b463e02 100644 --- a/sources/SDL2Sharp/Colors/Rgb32fExtensions.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,9 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Colors; - -namespace SDL2Sharp +namespace SDL2Sharp.Video.Colors { public static class Rgb32fExtensions { diff --git a/sources/SDL2Sharp/Colors/Rgb332.cs b/sources/SDL2Sharp/Video/Colors/Rgb332.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Rgb332.cs rename to sources/SDL2Sharp/Video/Colors/Rgb332.cs index f26feece..976b11ab 100644 --- a/sources/SDL2Sharp/Colors/Rgb332.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb332.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] [PackedColor(PackedPixelFormat.RGB332)] diff --git a/sources/SDL2Sharp/Colors/Rgb565.cs b/sources/SDL2Sharp/Video/Colors/Rgb565.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Rgb565.cs rename to sources/SDL2Sharp/Video/Colors/Rgb565.cs index f073c179..9afbe744 100644 --- a/sources/SDL2Sharp/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb565.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.RGB565)] diff --git a/sources/SDL2Sharp/Colors/Rgba4444.cs b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgba4444.cs rename to sources/SDL2Sharp/Video/Colors/Rgba4444.cs index ae90f705..4b535123 100644 --- a/sources/SDL2Sharp/Colors/Rgba4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.RGBA4444)] diff --git a/sources/SDL2Sharp/Colors/Rgba5551.cs b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgba5551.cs rename to sources/SDL2Sharp/Video/Colors/Rgba5551.cs index 7c1ce41f..e3016454 100644 --- a/sources/SDL2Sharp/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.RGBA5551)] diff --git a/sources/SDL2Sharp/Colors/Rgba8888.cs b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgba8888.cs rename to sources/SDL2Sharp/Video/Colors/Rgba8888.cs index 9e1f9add..e0faa8c5 100644 --- a/sources/SDL2Sharp/Colors/Rgba8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.RGBA8888)] diff --git a/sources/SDL2Sharp/Colors/Rgbx8888.cs b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Rgbx8888.cs rename to sources/SDL2Sharp/Video/Colors/Rgbx8888.cs index 2e0abf23..77b10d63 100644 --- a/sources/SDL2Sharp/Colors/Rgbx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.RGBX8888)] diff --git a/sources/SDL2Sharp/Colors/Uyvy.cs b/sources/SDL2Sharp/Video/Colors/Uyvy.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Uyvy.cs rename to sources/SDL2Sharp/Video/Colors/Uyvy.cs index 83e2b19f..cce4229f 100644 --- a/sources/SDL2Sharp/Colors/Uyvy.cs +++ b/sources/SDL2Sharp/Video/Colors/Uyvy.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.UYVY)] diff --git a/sources/SDL2Sharp/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xbgr1555.cs rename to sources/SDL2Sharp/Video/Colors/Xbgr1555.cs index 32853d79..d40fe1bc 100644 --- a/sources/SDL2Sharp/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XBGR1555)] diff --git a/sources/SDL2Sharp/Colors/Xbgr4444.cs b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xbgr4444.cs rename to sources/SDL2Sharp/Video/Colors/Xbgr4444.cs index 6c85753b..6a44337b 100644 --- a/sources/SDL2Sharp/Colors/Xbgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XBGR4444)] diff --git a/sources/SDL2Sharp/Colors/Xbgr8888.cs b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xbgr8888.cs rename to sources/SDL2Sharp/Video/Colors/Xbgr8888.cs index ae455037..cb26763b 100644 --- a/sources/SDL2Sharp/Colors/Xbgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.XBGR8888)] diff --git a/sources/SDL2Sharp/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xrgb1555.cs rename to sources/SDL2Sharp/Video/Colors/Xrgb1555.cs index a1e57e83..99d8dbfe 100644 --- a/sources/SDL2Sharp/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XRGB1555)] diff --git a/sources/SDL2Sharp/Colors/Xrgb4444.cs b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xrgb4444.cs rename to sources/SDL2Sharp/Video/Colors/Xrgb4444.cs index b6e6421c..17905221 100644 --- a/sources/SDL2Sharp/Colors/Xrgb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] [PackedColor(PackedPixelFormat.XRGB4444)] diff --git a/sources/SDL2Sharp/Colors/Xrgb8888.cs b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs similarity index 96% rename from sources/SDL2Sharp/Colors/Xrgb8888.cs rename to sources/SDL2Sharp/Video/Colors/Xrgb8888.cs index 1417a338..3f1a8b10 100644 --- a/sources/SDL2Sharp/Colors/Xrgb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.XRGB8888)] diff --git a/sources/SDL2Sharp/Colors/Yuy2.cs b/sources/SDL2Sharp/Video/Colors/Yuy2.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Yuy2.cs rename to sources/SDL2Sharp/Video/Colors/Yuy2.cs index 4fdc3d6f..56df5d8c 100644 --- a/sources/SDL2Sharp/Colors/Yuy2.cs +++ b/sources/SDL2Sharp/Video/Colors/Yuy2.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.YUY2)] diff --git a/sources/SDL2Sharp/Colors/Yvyu.cs b/sources/SDL2Sharp/Video/Colors/Yvyu.cs similarity index 97% rename from sources/SDL2Sharp/Colors/Yvyu.cs rename to sources/SDL2Sharp/Video/Colors/Yvyu.cs index d99d05e2..8f4d9d04 100644 --- a/sources/SDL2Sharp/Colors/Yvyu.cs +++ b/sources/SDL2Sharp/Video/Colors/Yvyu.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Colors +namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] [PackedColor(PackedPixelFormat.YVYU)] diff --git a/sources/SDL2Sharp/Cursor.cs b/sources/SDL2Sharp/Video/Cursor.cs similarity index 97% rename from sources/SDL2Sharp/Cursor.cs rename to sources/SDL2Sharp/Video/Cursor.cs index ae5ac6ca..120f0de8 100644 --- a/sources/SDL2Sharp/Cursor.cs +++ b/sources/SDL2Sharp/Video/Cursor.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public static class Cursor { diff --git a/sources/SDL2Sharp/MemoryImage.cs b/sources/SDL2Sharp/Video/MemoryImage.cs similarity index 99% rename from sources/SDL2Sharp/MemoryImage.cs rename to sources/SDL2Sharp/Video/MemoryImage.cs index 0189b3f9..bcd8d724 100644 --- a/sources/SDL2Sharp/MemoryImage.cs +++ b/sources/SDL2Sharp/Video/MemoryImage.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using Microsoft.Toolkit.HighPerformance; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed class MemoryImage where TColor : struct { diff --git a/sources/SDL2Sharp/PackedColorAttribute.cs b/sources/SDL2Sharp/Video/PackedColorAttribute.cs similarity index 97% rename from sources/SDL2Sharp/PackedColorAttribute.cs rename to sources/SDL2Sharp/Video/PackedColorAttribute.cs index ad79ec8e..3b0d75ac 100644 --- a/sources/SDL2Sharp/PackedColorAttribute.cs +++ b/sources/SDL2Sharp/Video/PackedColorAttribute.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using System.Reflection; -namespace SDL2Sharp +namespace SDL2Sharp.Video { [AttributeUsage(AttributeTargets.Struct)] internal sealed class PackedColorAttribute : Attribute diff --git a/sources/SDL2Sharp/PackedImage.cs b/sources/SDL2Sharp/Video/PackedImage.cs similarity index 98% rename from sources/SDL2Sharp/PackedImage.cs rename to sources/SDL2Sharp/Video/PackedImage.cs index bdd925c1..ca465d93 100644 --- a/sources/SDL2Sharp/PackedImage.cs +++ b/sources/SDL2Sharp/Video/PackedImage.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public ref struct PackedImage { @@ -117,7 +117,7 @@ public unsafe PackedImage(void* pixels, int height, int width, int pitch) throw new ArgumentOutOfRangeException( nameof(pitch), pitch, - "height cannot be less than zero"); + "pitch cannot be less than zero"); } _pixels = new Span(pixels, height * pitch); diff --git a/sources/SDL2Sharp/PackedPixelFormat.cs b/sources/SDL2Sharp/Video/PackedPixelFormat.cs similarity index 98% rename from sources/SDL2Sharp/PackedPixelFormat.cs rename to sources/SDL2Sharp/Video/PackedPixelFormat.cs index 050f5334..44dee9e5 100644 --- a/sources/SDL2Sharp/PackedPixelFormat.cs +++ b/sources/SDL2Sharp/Video/PackedPixelFormat.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum PackedPixelFormat : uint { diff --git a/sources/SDL2Sharp/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs similarity index 99% rename from sources/SDL2Sharp/PackedTexture.cs rename to sources/SDL2Sharp/Video/PackedTexture.cs index 9699542c..d786450e 100644 --- a/sources/SDL2Sharp/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -24,7 +24,7 @@ using Microsoft.Toolkit.HighPerformance; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class PackedTexture : IDisposable where TPackedColor : struct { diff --git a/sources/SDL2Sharp/Palette.cs b/sources/SDL2Sharp/Video/Palette.cs similarity index 98% rename from sources/SDL2Sharp/Palette.cs rename to sources/SDL2Sharp/Video/Palette.cs index 62cfd357..c67844d0 100644 --- a/sources/SDL2Sharp/Palette.cs +++ b/sources/SDL2Sharp/Video/Palette.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed class Palette where TColor : struct { diff --git a/sources/SDL2Sharp/PixelFormat.cs b/sources/SDL2Sharp/Video/PixelFormat.cs similarity index 98% rename from sources/SDL2Sharp/PixelFormat.cs rename to sources/SDL2Sharp/Video/PixelFormat.cs index 523577a0..f1f55863 100644 --- a/sources/SDL2Sharp/PixelFormat.cs +++ b/sources/SDL2Sharp/Video/PixelFormat.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class PixelFormat : IDisposable { diff --git a/sources/SDL2Sharp/PixelFormatEnum.cs b/sources/SDL2Sharp/Video/PixelFormatEnum.cs similarity index 99% rename from sources/SDL2Sharp/PixelFormatEnum.cs rename to sources/SDL2Sharp/Video/PixelFormatEnum.cs index f62029f1..1c1d988b 100644 --- a/sources/SDL2Sharp/PixelFormatEnum.cs +++ b/sources/SDL2Sharp/Video/PixelFormatEnum.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum PixelFormatEnum : uint { diff --git a/sources/SDL2Sharp/PixelFormatEnumExtensions.cs b/sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs similarity index 98% rename from sources/SDL2Sharp/PixelFormatEnumExtensions.cs rename to sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs index 252ae77f..e12477e1 100644 --- a/sources/SDL2Sharp/PixelFormatEnumExtensions.cs +++ b/sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public static class PixelFormatEnumExtensions { diff --git a/sources/SDL2Sharp/PixelType.cs b/sources/SDL2Sharp/Video/PixelType.cs similarity index 97% rename from sources/SDL2Sharp/PixelType.cs rename to sources/SDL2Sharp/Video/PixelType.cs index b1b26931..56a6b3c3 100644 --- a/sources/SDL2Sharp/PixelType.cs +++ b/sources/SDL2Sharp/Video/PixelType.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_PixelType; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum PixelType { diff --git a/sources/SDL2Sharp/Point.cs b/sources/SDL2Sharp/Video/Point.cs similarity index 96% rename from sources/SDL2Sharp/Point.cs rename to sources/SDL2Sharp/Video/Point.cs index 2d684aec..af6a3620 100644 --- a/sources/SDL2Sharp/Point.cs +++ b/sources/SDL2Sharp/Video/Point.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public readonly record struct Point { diff --git a/sources/SDL2Sharp/Rectangle.cs b/sources/SDL2Sharp/Video/Rectangle.cs similarity index 97% rename from sources/SDL2Sharp/Rectangle.cs rename to sources/SDL2Sharp/Video/Rectangle.cs index 2cf0c414..ebf3b81b 100644 --- a/sources/SDL2Sharp/Rectangle.cs +++ b/sources/SDL2Sharp/Video/Rectangle.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public readonly record struct Rectangle { diff --git a/sources/SDL2Sharp/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs similarity index 99% rename from sources/SDL2Sharp/Renderer.cs rename to sources/SDL2Sharp/Video/Renderer.cs index 39b49b2a..8b5bc92e 100644 --- a/sources/SDL2Sharp/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class Renderer : IDisposable { diff --git a/sources/SDL2Sharp/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs similarity index 85% rename from sources/SDL2Sharp/RendererExtensions.cs rename to sources/SDL2Sharp/Video/RendererExtensions.cs index a70ef449..9fcd0375 100644 --- a/sources/SDL2Sharp/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,8 +19,10 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using SDL2Sharp.Fonts; +using static System.Math; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public static class RendererExtensions { @@ -48,6 +50,27 @@ public static PackedTexture CreateTexture(this Rende return new PackedTexture(texture); } + public static Yv12Texture CreateYv12Texture(this Renderer renderer, TextureAccess access, Size size) + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + return renderer.CreateYv12Texture(access, size.Width, size.Height); + } + + public static Yv12Texture CreateYv12Texture(this Renderer renderer, TextureAccess access, int width, int height) + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + var texture = renderer.CreateTexture(PixelFormatEnum.YV12, access, width, height); + return new Yv12Texture(texture); + } + public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) where TPackedColor : struct { @@ -347,9 +370,38 @@ public static void DrawTextBlended(this Renderer renderer, int x, int y, Font fo throw new ArgumentNullException(nameof(text)); } - using var textSurface = font.RenderBlended(text, renderer.DrawColor); - using var textTexture = renderer.CreateTextureFromSurface(textSurface); - renderer.Copy(textTexture, new Rectangle(x, y, textTexture.Width, textTexture.Height)); + using var surface = font.RenderBlended(text, renderer.DrawColor); + using var texture = renderer.CreateTextureFromSurface(surface); + var destination = new Rectangle(x, y, texture.Width, texture.Height); + + renderer.Copy(texture, destination); + } + public static void DrawTextBlendedCentered(this Renderer renderer, Font font, string text) + { + if (renderer is null) + { + throw new ArgumentNullException(nameof(renderer)); + } + + if (font is null) + { + throw new ArgumentNullException(nameof(font)); + } + + if (text is null) + { + throw new ArgumentNullException(nameof(text)); + } + + using var surface = font.RenderBlended(text, renderer.DrawColor); + using var texture = renderer.CreateTextureFromSurface(surface); + var textureSize = texture.Size; + var outputSize = renderer.OutputSize; + var x = Abs(outputSize.Width - texture.Width) / 2; + var y = Abs(outputSize.Height - texture.Height) / 2; + var destination = new Rectangle(x, y, texture.Width, texture.Height); + + renderer.Copy(texture, destination); } } } diff --git a/sources/SDL2Sharp/RendererFlags.cs b/sources/SDL2Sharp/Video/RendererFlags.cs similarity index 97% rename from sources/SDL2Sharp/RendererFlags.cs rename to sources/SDL2Sharp/Video/RendererFlags.cs index 6ca63459..3527edc6 100644 --- a/sources/SDL2Sharp/RendererFlags.cs +++ b/sources/SDL2Sharp/Video/RendererFlags.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp +namespace SDL2Sharp.Video { [Flags] public enum RendererFlags : uint diff --git a/sources/SDL2Sharp/RendererInfo.cs b/sources/SDL2Sharp/Video/RendererInfo.cs similarity index 98% rename from sources/SDL2Sharp/RendererInfo.cs rename to sources/SDL2Sharp/Video/RendererInfo.cs index d518a765..a339e4eb 100644 --- a/sources/SDL2Sharp/RendererInfo.cs +++ b/sources/SDL2Sharp/Video/RendererInfo.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class RendererInfo { diff --git a/sources/SDL2Sharp/Scale.cs b/sources/SDL2Sharp/Video/Scale.cs similarity index 96% rename from sources/SDL2Sharp/Scale.cs rename to sources/SDL2Sharp/Video/Scale.cs index 2719c6ae..932ae26f 100644 --- a/sources/SDL2Sharp/Scale.cs +++ b/sources/SDL2Sharp/Video/Scale.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public readonly struct Scale { diff --git a/sources/SDL2Sharp/Size.cs b/sources/SDL2Sharp/Video/Size.cs similarity index 96% rename from sources/SDL2Sharp/Size.cs rename to sources/SDL2Sharp/Video/Size.cs index 5c119444..7e572912 100644 --- a/sources/SDL2Sharp/Size.cs +++ b/sources/SDL2Sharp/Video/Size.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public readonly record struct Size { diff --git a/sources/SDL2Sharp/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs similarity index 99% rename from sources/SDL2Sharp/Surface.cs rename to sources/SDL2Sharp/Video/Surface.cs index df28ba4a..958d2cf2 100644 --- a/sources/SDL2Sharp/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -23,7 +23,7 @@ using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class Surface : IDisposable { diff --git a/sources/SDL2Sharp/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs similarity index 98% rename from sources/SDL2Sharp/Surface{T}.cs rename to sources/SDL2Sharp/Video/Surface{T}.cs index ec7fa826..8d08492b 100644 --- a/sources/SDL2Sharp/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed class Surface : IDisposable where TPackedColor : struct { diff --git a/sources/SDL2Sharp/Texture.cs b/sources/SDL2Sharp/Video/Texture.cs similarity index 74% rename from sources/SDL2Sharp/Texture.cs rename to sources/SDL2Sharp/Video/Texture.cs index 27d3be6e..71a9372e 100644 --- a/sources/SDL2Sharp/Texture.cs +++ b/sources/SDL2Sharp/Video/Texture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class Texture : IDisposable { @@ -68,6 +68,16 @@ public int Height } } + public Size Size + { + get + { + int width, height; + Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, &width, &height)); + return new Size(width, height); + } + } + public BlendMode BlendMode { get @@ -147,6 +157,57 @@ public void WithLock(int x, int y, int width, int height, WithLock SDL.UnlockTexture(_handle); } + public void WithLock(WithLockYv12ImageCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } + + public void WithLock(Rectangle rectangle, WithLockYv12ImageCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } + + public void WithLock(int x, int y, int width, int height, WithLockYv12ImageCallback callback) + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitch; + Error.ThrowOnFailure( + SDL.LockTexture(_handle, &rect, &pixels, &pitch) + ); + + var image = new Yv12Image(pixels, height, width, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_handle); + } + + + public void WithLock(WithLockSurfaceCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } + + public void WithLock(Rectangle rectangle, WithLockSurfaceCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } + + public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallback callback) + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + SDL_Surface* surfaceHandle; + Error.ThrowOnFailure( + SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) + ); + var surface = new Surface(surfaceHandle, false); + callback.Invoke(surface); + SDL.UnlockTexture(_handle); + } + public void WithLock(WithLockSurfaceCallback callback) where TPackedColor : struct { diff --git a/sources/SDL2Sharp/TextureAccess.cs b/sources/SDL2Sharp/Video/TextureAccess.cs similarity index 96% rename from sources/SDL2Sharp/TextureAccess.cs rename to sources/SDL2Sharp/Video/TextureAccess.cs index eb705335..bf0b7f71 100644 --- a/sources/SDL2Sharp/TextureAccess.cs +++ b/sources/SDL2Sharp/Video/TextureAccess.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum TextureAccess : int { diff --git a/sources/SDL2Sharp/Video/VideoSubsystem.cs b/sources/SDL2Sharp/Video/VideoSubsystem.cs new file mode 100644 index 00000000..83418d33 --- /dev/null +++ b/sources/SDL2Sharp/Video/VideoSubsystem.cs @@ -0,0 +1,60 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Video +{ + public sealed class VideoSubsystem : IDisposable + { + private const uint InitSubsystemFlags = SDL.SDL_INIT_VIDEO; + + public VideoSubsystem() + { + SDL.InitSubSystem(InitSubsystemFlags); + } + + public void Dispose() + { + SDL.QuitSubSystem(InitSubsystemFlags); + } + + public Window CreateWindow(string title, int width, int height) + { + return new Window(title, width, height); + } + + public Window CreateWindow(string title, int width, int height, WindowFlags flags) + { + return new Window(title, width, height, flags); + } + + public Window CreateWindow(string title, int x, int y, int width, int height) + { + return new Window(title, x, y, width, height); + } + + public Window CreateWindow(string title, int x, int y, int width, int height, WindowFlags flags) + { + return new Window(title, x, y, width, height, flags); + } + } +} diff --git a/sources/SDL2Sharp/Window.cs b/sources/SDL2Sharp/Video/Window.cs similarity index 59% rename from sources/SDL2Sharp/Window.cs rename to sources/SDL2Sharp/Video/Window.cs index 80bb606d..49baccad 100644 --- a/sources/SDL2Sharp/Window.cs +++ b/sources/SDL2Sharp/Video/Window.cs @@ -22,60 +22,15 @@ using SDL2Sharp.Internals; using SDL2Sharp.Interop; using System.Runtime.InteropServices; -using System.Collections.Generic; -namespace SDL2Sharp +namespace SDL2Sharp.Video { public sealed unsafe class Window : IDisposable { - public event EventHandler? Shown; - - public event EventHandler? Hidden; - - public event EventHandler? Exposed; - - public event EventHandler? Moved; - - public event EventHandler? Resized; - - public event EventHandler? SizeChanged; - - public event EventHandler? Minimized; - - public event EventHandler? Maximized; - - public event EventHandler? Restored; - - public event EventHandler? Enter; - - public event EventHandler? Leave; - - public event EventHandler? FocusGained; - - public event EventHandler? FocusLost; - - public event EventHandler? Close; - - public event EventHandler? TakeFocus; - - public event EventHandler? HitTest; - - public event EventHandler? KeyDown; - - public event EventHandler? KeyUp; - - public event EventHandler? MouseMotion; - - public event EventHandler? MouseWheel; - - private static readonly List _all = new(); - private SDL_Window* _handle; private readonly HitTestCallbackDelegate _hitTestCallback; - public static IReadOnlyList All => _all; - public uint Id { get @@ -245,9 +200,9 @@ public bool IsBordered { get { - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_BORDERLESS; - var flags = SDL.GetWindowFlags(_handle); - return (flags & flag) == 0; + ThrowWhenDisposed(); + + return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_BORDERLESS); } set { @@ -257,16 +212,13 @@ public bool IsBordered } } - public bool IsResizable { get { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_RESIZABLE; - var flags = SDL.GetWindowFlags(_handle); - return (flags & flag) != 0; + return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_RESIZABLE); } set { @@ -282,17 +234,15 @@ public bool IsFullScreen { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN; - var flags = SDL.GetWindowFlags(_handle); - return (flags & flag) != 0; + return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_FULLSCREEN); } set { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN; + var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN : 0; Error.ThrowOnFailure( - SDL.SetWindowFullscreen(_handle, value ? flag : 0u) + SDL.SetWindowFullscreen(_handle, (uint)flags) ); } } @@ -303,17 +253,15 @@ public bool IsFullScreenDesktop { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP; - var flags = SDL.GetWindowFlags(_handle); - return (flags & flag) != 0; + return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP); } set { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP; + var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP : 0; Error.ThrowOnFailure( - SDL.SetWindowFullscreen(_handle, value ? flag : 0u) + SDL.SetWindowFullscreen(_handle, (uint)flags) ); } } @@ -324,25 +272,23 @@ public bool IsVisible { ThrowWhenDisposed(); - const uint flag = (uint)SDL_WindowFlags.SDL_WINDOW_SHOWN; - var flags = SDL.GetWindowFlags(_handle); - return (flags & flag) != 0; + return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_SHOWN); } } - public Window(string title, int width, int height) + internal Window(string title, int width, int height) : this(title, (int)SDL.SDL_WINDOWPOS_UNDEFINED, (int)SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)0) { } - public Window(string title, int width, int height, WindowFlags flags) + internal Window(string title, int width, int height, WindowFlags flags) : this(title, (int)SDL.SDL_WINDOWPOS_UNDEFINED, (int)SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)flags) { } - public Window(string title, int x, int y, int width, int height) + internal Window(string title, int x, int y, int width, int height) : this(title, x, y, width, height, (uint)0) { } - public Window(string title, int x, int y, int width, int height, WindowFlags flags) + internal Window(string title, int x, int y, int width, int height, WindowFlags flags) : this(title, x, y, width, height, (uint)flags) { } @@ -365,8 +311,6 @@ private Window(string title, int x, int y, int width, int height, uint flags) { _hitTestCallback = null!; } - - _all.Add(this); } ~Window() @@ -388,7 +332,7 @@ private void Dispose(bool _) } SDL.DestroyWindow(_handle); - _all.Remove(this); + _handle = null; } @@ -487,219 +431,21 @@ public void UpdateSurface() ); } - private void ThrowWhenDisposed() - { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } - } - - internal void HandleKeyDownEvent(SDL_KeyboardEvent @event) - { - OnKeyDown( - new KeyEventArgs( - (Scancode)@event.keysym.scancode, - (KeyCode)@event.keysym.sym, - (KeyModifiers)@event.keysym.mod, - @event.repeat - ) - ); - } - - internal void HandleKeyUpEvent(SDL_KeyboardEvent @event) - { - OnKeyUp( - new KeyEventArgs( - (Scancode)@event.keysym.scancode, - (KeyCode)@event.keysym.sym, - (KeyModifiers)@event.keysym.mod, - @event.repeat - ) - ); - } - - internal void HandleMouseMotionEvent(SDL_MouseMotionEvent @event) + private bool HasWindowFlag(SDL_WindowFlags flag) { - OnMouseMotion( - new MouseMotionEventArgs( - @event.x, - @event.y, - @event.xrel, - @event.yrel - ) - ); + var flags = (SDL_WindowFlags)SDL.GetWindowFlags(_handle); + var hasFlag = flags.HasFlag(flag); + return hasFlag; } - internal void HandleMouseWheelEvent(SDL_MouseWheelEvent @event) - { - OnMouseWheelEvent( - new MouseWheelEventArgs( - @event.which, - (MouseWheelDirection)@event.direction, - @event.x, - @event.y, - @event.preciseX, - @event.preciseY - ) - ); - } - - internal void HandleWindowEvent(SDL_WindowEvent windowEvent) + private void ThrowWhenDisposed() { - switch ((SDL_WindowEventID)windowEvent.@event) + if (_handle is null) { - case SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN: - OnShown(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_HIDDEN: - OnHidden(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_EXPOSED: - OnExposed(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_MOVED: - OnMoved(windowEvent.data1, windowEvent.data2); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_RESIZED: - OnResized(windowEvent.data1, windowEvent.data2); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED: - OnSizeChanged(windowEvent.data1, windowEvent.data2); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_MINIMIZED: - OnMinimized(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_MAXIMIZED: - OnMaximized(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_RESTORED: - OnRestored(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_ENTER: - OnEnter(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_LEAVE: - OnLeave(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED: - OnFocusGained(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST: - OnFocusLost(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_CLOSE: - OnClose(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_TAKE_FOCUS: - OnTakeFocus(); - break; - case SDL_WindowEventID.SDL_WINDOWEVENT_HIT_TEST: - OnHitTest(); - break; + throw new ObjectDisposedException(GetType().FullName); } } - private void OnShown() - { - Shown?.Invoke(this, EventArgs.Empty); - } - - private void OnHidden() - { - Hidden?.Invoke(this, EventArgs.Empty); - } - - private void OnExposed() - { - Exposed?.Invoke(this, EventArgs.Empty); - } - - private void OnMoved(int x, int y) - { - Moved?.Invoke(this, new WindowMovedEventArgs(x, y)); - } - - private void OnResized(int width, int height) - { - Resized?.Invoke(this, new WindowResizedEventArgs(width, height)); - } - - private void OnSizeChanged(int width, int height) - { - SizeChanged?.Invoke(this, new WindowSizeChangedEventArgs(width, height)); - } - - private void OnMinimized() - { - Minimized?.Invoke(this, EventArgs.Empty); - } - - private void OnMaximized() - { - Maximized?.Invoke(this, EventArgs.Empty); - } - - private void OnRestored() - { - Restored?.Invoke(this, EventArgs.Empty); - } - - private void OnEnter() - { - Enter?.Invoke(this, EventArgs.Empty); - } - - private void OnLeave() - { - Leave?.Invoke(this, EventArgs.Empty); - } - - private void OnFocusGained() - { - FocusGained?.Invoke(this, EventArgs.Empty); - } - - private void OnFocusLost() - { - FocusLost?.Invoke(this, EventArgs.Empty); - } - - private void OnClose() - { - Close?.Invoke(this, EventArgs.Empty); - } - - private void OnTakeFocus() - { - TakeFocus?.Invoke(this, EventArgs.Empty); - } - - private void OnHitTest() - { - HitTest?.Invoke(this, EventArgs.Empty); - } - - private void OnKeyDown(KeyEventArgs eventArgs) - { - KeyDown?.Invoke(this, eventArgs); - } - - private void OnKeyUp(KeyEventArgs eventArgs) - { - KeyUp?.Invoke(this, eventArgs); - } - - private void OnMouseMotion(MouseMotionEventArgs eventArgs) - { - MouseMotion?.Invoke(this, eventArgs); - } - - private void OnMouseWheelEvent(MouseWheelEventArgs eventArgs) - { - MouseWheel?.Invoke(this, eventArgs); - } - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate SDL_HitTestResult HitTestCallbackDelegate(SDL_Window* win, SDL_Point* area, void* data); diff --git a/sources/SDL2Sharp/WindowFlags.cs b/sources/SDL2Sharp/Video/WindowFlags.cs similarity index 98% rename from sources/SDL2Sharp/WindowFlags.cs rename to sources/SDL2Sharp/Video/WindowFlags.cs index 83e28208..8539b0fe 100644 --- a/sources/SDL2Sharp/WindowFlags.cs +++ b/sources/SDL2Sharp/Video/WindowFlags.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp +namespace SDL2Sharp.Video { [Flags] public enum WindowFlags diff --git a/sources/SDL2Sharp/WithLockPackedImageCallback.cs b/sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs similarity index 96% rename from sources/SDL2Sharp/WithLockPackedImageCallback.cs rename to sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs index 51fff197..398f39f0 100644 --- a/sources/SDL2Sharp/WithLockPackedImageCallback.cs +++ b/sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public delegate void WithLockPackedImageCallback(PackedImage pixels) where TPackedColor : struct; diff --git a/sources/SDL2Sharp/WithLockSurfaceCallback.cs b/sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs similarity index 90% rename from sources/SDL2Sharp/WithLockSurfaceCallback.cs rename to sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs index c6b6c6d0..08094c4e 100644 --- a/sources/SDL2Sharp/WithLockSurfaceCallback.cs +++ b/sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,8 +18,10 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { + public delegate void WithLockSurfaceCallback(Surface pixels); + public delegate void WithLockSurfaceCallback(Surface pixels) where TPackedColor : struct; } diff --git a/sources/SDL2Sharp/YuvConversionMode.cs b/sources/SDL2Sharp/Video/YuvConversionMode.cs similarity index 97% rename from sources/SDL2Sharp/YuvConversionMode.cs rename to sources/SDL2Sharp/Video/YuvConversionMode.cs index d314b828..0ef0d49f 100644 --- a/sources/SDL2Sharp/YuvConversionMode.cs +++ b/sources/SDL2Sharp/Video/YuvConversionMode.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp +namespace SDL2Sharp.Video { public enum YuvConversionMode { diff --git a/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs b/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs index 77ffa6e5..2ac8bec3 100644 --- a/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs +++ b/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs @@ -18,6 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using SDL2Sharp.Audio; using Xunit; namespace SDL2Sharp.Tests diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs index c4f26d44..627fcd90 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -18,18 +18,22 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Colors; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; using Xunit; namespace SDL2Sharp.Tests { - public sealed class PackedTextureTests : IAssemblyFixture + public sealed class PackedTextureTests { [Fact] - public static void CreatePackedTextureOfArgb8888() + public void CreatePackedTextureOfArgb8888() { var color = new Argb8888(255, 255, 255, 255); - using var window = new Window("CreatePackedTextureOfArgb8888", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreatePackedTextureOfArgb8888", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -38,10 +42,13 @@ public static void CreatePackedTextureOfArgb8888() } [Fact] - public static void CreatePackedTextureOfYUY2() + public void CreatePackedTextureOfYUY2() { var color = new Yuy2(255, 255, 255, 255); - using var window = new Window("CreatePackedTextureOfYUY2", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreatePackedTextureOfYUY2", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -50,10 +57,13 @@ public static void CreatePackedTextureOfYUY2() } [Fact] - public static void CreatePackedTextureOfYVYU() + public void CreatePackedTextureOfYVYU() { var color = new Yvyu(255, 255, 255, 255); - using var window = new Window("CreatePackedTextureOfYVYU", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreatePackedTextureOfYVYU", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -62,10 +72,13 @@ public static void CreatePackedTextureOfYVYU() } [Fact] - public static void CreatePackedTextureOfUYVY() + public void CreatePackedTextureOfUYVY() { var color = new Uyvy(255, 255, 255, 255); - using var window = new Window("CreatePackedTextureOfUYVY", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreatePackedTextureOfUYVY", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); diff --git a/tests/SDL2Sharp.Tests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/SurfaceTests.cs index 3fb75df6..825fa287 100644 --- a/tests/SDL2Sharp.Tests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/SurfaceTests.cs @@ -18,15 +18,24 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Colors; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; using Xunit; namespace SDL2Sharp.Tests { - public sealed class SurfaceTests : IAssemblyFixture + public sealed class SurfaceTests { [Fact] - public static void CreateSurfaceOfArgb8888() + public void CreateSurface() + { + var color = new Argb8888(255, 255, 255, 255); + using var surface = new Surface(512, 512, PixelFormatEnum.ARGB8888); + surface.WithLock(pixels => pixels.Fill(color)); + } + + [Fact] + public void CreateSurfaceOfArgb8888() { var color = new Argb8888(255, 255, 255, 255); using var surface = new Surface(512, 512); @@ -34,19 +43,19 @@ public static void CreateSurfaceOfArgb8888() } [Fact] - public static void CreateSurfaceOfYuy2() + public void CreateSurfaceOfYuy2() { Assert.Throws(() => new Surface(512, 512)); } [Fact] - public static void CreateSurfaceOfYvyu() + public void CreateSurfaceOfYvyu() { Assert.Throws(() => new Surface(512, 512)); } [Fact] - public static void CreateSurfaceOfUyvy() + public void CreateSurfaceOfUyvy() { Assert.Throws(() => new Surface(512, 512)); } diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index 0b01cde1..26fa64a2 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -19,18 +19,22 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Colors; +using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; using Xunit; namespace SDL2Sharp.Tests { - public sealed class TextureTests : IAssemblyFixture + public sealed class TextureTests { [Fact] public void CreateTextureOfArgb8888() { var color = new Argb8888(255, 255, 255, 255); - using var window = new Window("CreateTextureOfArgb8888", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateTextureOfArgb8888", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(PixelFormatEnum.ARGB8888, TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -42,7 +46,10 @@ public void CreateTextureOfArgb8888() public void CreateTextureOfYUY2() { var color = new Yuy2(255, 255, 255, 255); - using var window = new Window("CreateTextureOfYUY2", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateTextureOfYUY2", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(PixelFormatEnum.YUY2, TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -54,7 +61,10 @@ public void CreateTextureOfYUY2() public void CreateTextureOfYVYU() { var color = new Yvyu(255, 255, 255, 255); - using var window = new Window("CreateTextureOfYVYU", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateTextureOfYVYU", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(PixelFormatEnum.YVYU, TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -66,7 +76,10 @@ public void CreateTextureOfYVYU() public void CreateTextureOfUYVY() { var color = new Uyvy(255, 255, 255, 255); - using var window = new Window("CreateTextureOfUYVY", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateTextureOfUYVY", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(PixelFormatEnum.UYVY, TextureAccess.Streaming, renderer.OutputSize); texture.WithLock(pixels => pixels.Fill(color)); @@ -78,7 +91,10 @@ public void CreateTextureOfUYVY() public void CreateTextureOfYV12() { var color = new Uyvy(255, 255, 255, 255); - using var window = new Window("CreateTextureOfYV12", 640, 480, WindowFlags.Hidden); + + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateTextureOfYV12", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateTexture(PixelFormatEnum.YV12, TextureAccess.Streaming, renderer.OutputSize); texture.WithLock((Yv12Image pixels) => From f8c0b47852eff1a93d0a985e56832bd6e0f4364a Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 15 Jul 2024 13:44:18 +0200 Subject: [PATCH 27/62] Add support for planar texture formats (NV12, NV21, YV12 and IYUV). --- sources/SDL2Sharp/Video/IyuvImage.cs | 89 +++++++++++++++ sources/SDL2Sharp/Video/IyuvTexture.cs | 102 ++++++++++++++++++ sources/SDL2Sharp/Video/Nv12Image.cs | 84 +++++++++++++++ sources/SDL2Sharp/Video/Nv12Texture.cs | 102 ++++++++++++++++++ sources/SDL2Sharp/Video/Nv21Image.cs | 84 +++++++++++++++ sources/SDL2Sharp/Video/Nv21Texture.cs | 102 ++++++++++++++++++ .../Video/WithLockIyuvImageCallback.cs | 24 +++++ .../Video/WithLockNv12ImageCallback.cs | 24 +++++ .../Video/WithLockNv21ImageCallback.cs | 24 +++++ .../Video/WithLockYv12ImageCallback.cs | 24 +++++ sources/SDL2Sharp/Video/Yv12Image.cs | 89 +++++++++++++++ sources/SDL2Sharp/Video/Yv12Texture.cs | 102 ++++++++++++++++++ tests/SDL2Sharp.Tests/PlanarTextureTests.cs | 46 ++++++++ 13 files changed, 896 insertions(+) create mode 100644 sources/SDL2Sharp/Video/IyuvImage.cs create mode 100644 sources/SDL2Sharp/Video/IyuvTexture.cs create mode 100644 sources/SDL2Sharp/Video/Nv12Image.cs create mode 100644 sources/SDL2Sharp/Video/Nv12Texture.cs create mode 100644 sources/SDL2Sharp/Video/Nv21Image.cs create mode 100644 sources/SDL2Sharp/Video/Nv21Texture.cs create mode 100644 sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs create mode 100644 sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs create mode 100644 sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs create mode 100644 sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs create mode 100644 sources/SDL2Sharp/Video/Yv12Image.cs create mode 100644 sources/SDL2Sharp/Video/Yv12Texture.cs create mode 100644 tests/SDL2Sharp.Tests/PlanarTextureTests.cs diff --git a/sources/SDL2Sharp/Video/IyuvImage.cs b/sources/SDL2Sharp/Video/IyuvImage.cs new file mode 100644 index 00000000..f88f4ef8 --- /dev/null +++ b/sources/SDL2Sharp/Video/IyuvImage.cs @@ -0,0 +1,89 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Video +{ + public readonly ref struct IyuvImage + { + private readonly ColorPlane _yPlane; + + private readonly ColorPlane _uPlane; + + private readonly ColorPlane _vPlane; + + private readonly int _height; + + private readonly int _width; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + } + + public unsafe IyuvImage(void* pixels, int height, int width, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + _yPlane = new ColorPlane(pixels, height, width, pitch, 0); + _vPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); + _uPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch * 2); + _height = height; + _width = width; + } + + public ColorPlane Y => _yPlane; + + public ColorPlane U => _uPlane; + + public ColorPlane V => _vPlane; + } +} diff --git a/sources/SDL2Sharp/Video/IyuvTexture.cs b/sources/SDL2Sharp/Video/IyuvTexture.cs new file mode 100644 index 00000000..e147357b --- /dev/null +++ b/sources/SDL2Sharp/Video/IyuvTexture.cs @@ -0,0 +1,102 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public sealed unsafe partial class IyuvTexture : IDisposable + { + private Texture _texture; + + public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + + public TextureAccess Access => _texture.Access; + + public int Width => _texture.Width; + + public int Height => _texture.Height; + + public BlendMode BlendMode + { + get => _texture.BlendMode; + + set => _texture.BlendMode = value; + } + + public bool IsValid => _texture.IsValid; + + internal IyuvTexture(Texture texture) + { + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + } + + ~IyuvTexture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; + } + + // public void WithLock(WithLockIyuvImageCallback callback) + // { + // WithLock(0, 0, Width, Height, callback); + // } + + // public void WithLock(Rectangle rectangle, WithLockIyuvImageCallback callback) + // { + // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + // } + + // public void WithLock(int x, int y, int width, int height, WithLockIyuvImageCallback callback) + // { + // _texture.WithLock(x, y, width, height, callback); + // } + + private void ThrowWhenDisposed() + { + if (_texture is null) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + + public static implicit operator Texture(IyuvTexture texture) + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + return texture._texture; + } + } +} diff --git a/sources/SDL2Sharp/Video/Nv12Image.cs b/sources/SDL2Sharp/Video/Nv12Image.cs new file mode 100644 index 00000000..9958b641 --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv12Image.cs @@ -0,0 +1,84 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Video +{ + public readonly ref struct Nv12Image + { + private readonly ColorPlane _yPlane; + + private readonly ColorPlane _uvPlane; + + private readonly int _height; + + private readonly int _width; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + } + + public unsafe Nv12Image(void* pixels, int height, int width, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + _yPlane = new ColorPlane(pixels, height, width, pitch, 0); + _uvPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); + _height = height; + _width = width; + } + + public ColorPlane Y => _yPlane; + + public ColorPlane UV => _uvPlane; + } +} diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/Nv12Texture.cs new file mode 100644 index 00000000..f119943b --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv12Texture.cs @@ -0,0 +1,102 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public sealed unsafe partial class Nv12Texture : IDisposable + { + private Texture _texture; + + public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + + public TextureAccess Access => _texture.Access; + + public int Width => _texture.Width; + + public int Height => _texture.Height; + + public BlendMode BlendMode + { + get => _texture.BlendMode; + + set => _texture.BlendMode = value; + } + + public bool IsValid => _texture.IsValid; + + internal Nv12Texture(Texture texture) + { + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + } + + ~Nv12Texture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; + } + + // public void WithLock(WithLockNv12ImageCallback callback) + // { + // WithLock(0, 0, Width, Height, callback); + // } + + // public void WithLock(Rectangle rectangle, WithLockNv12ImageCallback callback) + // { + // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + // } + + // public void WithLock(int x, int y, int width, int height, WithLockNv12ImageCallback callback) + // { + // _texture.WithLock(x, y, width, height, callback); + // } + + private void ThrowWhenDisposed() + { + if (_texture is null) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + + public static implicit operator Texture(Nv12Texture texture) + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + return texture._texture; + } + } +} diff --git a/sources/SDL2Sharp/Video/Nv21Image.cs b/sources/SDL2Sharp/Video/Nv21Image.cs new file mode 100644 index 00000000..5449183d --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv21Image.cs @@ -0,0 +1,84 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Video +{ + public readonly ref struct Nv21Image + { + private readonly ColorPlane _yPlane; + + private readonly ColorPlane _vuPlane; + + private readonly int _height; + + private readonly int _width; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + } + + public unsafe Nv21Image(void* pixels, int height, int width, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + _yPlane = new ColorPlane(pixels, height, width, pitch, 0); + _vuPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); + _height = height; + _width = width; + } + + public ColorPlane Y => _yPlane; + + public ColorPlane VU => _vuPlane; + } +} diff --git a/sources/SDL2Sharp/Video/Nv21Texture.cs b/sources/SDL2Sharp/Video/Nv21Texture.cs new file mode 100644 index 00000000..d16a6c2c --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv21Texture.cs @@ -0,0 +1,102 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public sealed unsafe partial class Nv21Texture : IDisposable + { + private Texture _texture; + + public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + + public TextureAccess Access => _texture.Access; + + public int Width => _texture.Width; + + public int Height => _texture.Height; + + public BlendMode BlendMode + { + get => _texture.BlendMode; + + set => _texture.BlendMode = value; + } + + public bool IsValid => _texture.IsValid; + + internal Nv21Texture(Texture texture) + { + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + } + + ~Nv21Texture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; + } + + // public void WithLock(WithLockNv21ImageCallback callback) + // { + // WithLock(0, 0, Width, Height, callback); + // } + + // public void WithLock(Rectangle rectangle, WithLockNv21ImageCallback callback) + // { + // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + // } + + // public void WithLock(int x, int y, int width, int height, WithLockNv21ImageCallback callback) + // { + // _texture.WithLock(x, y, width, height, callback); + // } + + private void ThrowWhenDisposed() + { + if (_texture is null) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + + public static implicit operator Texture(Nv21Texture texture) + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + return texture._texture; + } + } +} diff --git a/sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs b/sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs new file mode 100644 index 00000000..0107876d --- /dev/null +++ b/sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs @@ -0,0 +1,24 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public delegate void WithLockIyuvImageCallback(IyuvImage pixels); +} diff --git a/sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs b/sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs new file mode 100644 index 00000000..32b3b5f2 --- /dev/null +++ b/sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs @@ -0,0 +1,24 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public delegate void WithLockNv12ImageCallback(Nv12Image pixels); +} diff --git a/sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs b/sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs new file mode 100644 index 00000000..b577af31 --- /dev/null +++ b/sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs @@ -0,0 +1,24 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public delegate void WithLockNv21ImageCallback(Nv21Image pixels); +} diff --git a/sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs b/sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs new file mode 100644 index 00000000..85216293 --- /dev/null +++ b/sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs @@ -0,0 +1,24 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public delegate void WithLockYv12ImageCallback(Yv12Image pixels); +} diff --git a/sources/SDL2Sharp/Video/Yv12Image.cs b/sources/SDL2Sharp/Video/Yv12Image.cs new file mode 100644 index 00000000..b530eced --- /dev/null +++ b/sources/SDL2Sharp/Video/Yv12Image.cs @@ -0,0 +1,89 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Video +{ + public readonly ref struct Yv12Image + { + private readonly ColorPlane _yPlane; + + private readonly ColorPlane _vPlane; + + private readonly ColorPlane _uPlane; + + private readonly int _height; + + private readonly int _width; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _height; + } + + public unsafe Yv12Image(void* pixels, int height, int width, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + _yPlane = new ColorPlane(pixels, height, width, pitch, 0); + _vPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); + _uPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch * 2); + _height = height; + _width = width; + } + + public ColorPlane Y => _yPlane; + + public ColorPlane V => _vPlane; + + public ColorPlane U => _uPlane; + } +} diff --git a/sources/SDL2Sharp/Video/Yv12Texture.cs b/sources/SDL2Sharp/Video/Yv12Texture.cs new file mode 100644 index 00000000..1a547cdd --- /dev/null +++ b/sources/SDL2Sharp/Video/Yv12Texture.cs @@ -0,0 +1,102 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public sealed unsafe partial class Yv12Texture : IDisposable + { + private Texture _texture; + + public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + + public TextureAccess Access => _texture.Access; + + public int Width => _texture.Width; + + public int Height => _texture.Height; + + public BlendMode BlendMode + { + get => _texture.BlendMode; + + set => _texture.BlendMode = value; + } + + public bool IsValid => _texture.IsValid; + + internal Yv12Texture(Texture texture) + { + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + } + + ~Yv12Texture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; + } + + public void WithLock(WithLockYv12ImageCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } + + public void WithLock(Rectangle rectangle, WithLockYv12ImageCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } + + public void WithLock(int x, int y, int width, int height, WithLockYv12ImageCallback callback) + { + _texture.WithLock(x, y, width, height, callback); + } + + private void ThrowWhenDisposed() + { + if (_texture is null) + { + throw new ObjectDisposedException(GetType().FullName); + } + } + + public static implicit operator Texture(Yv12Texture texture) + { + if (texture is null) + { + throw new ArgumentNullException(nameof(texture)); + } + + return texture._texture; + } + } +} diff --git a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs new file mode 100644 index 00000000..257fd860 --- /dev/null +++ b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Video; +using Xunit; + +namespace SDL2Sharp.Tests +{ + public sealed class PlanarTextureTests + { + [Fact] + public void CreateYv12Texture() + { + using var mainSystem = new MainSystem(); + using var videoSystem = new VideoSubsystem(); + using var window = videoSystem.CreateWindow("CreateYv12Texture", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(RendererFlags.Software); + using var texture = renderer.CreateYv12Texture(TextureAccess.Streaming, renderer.OutputSize); + texture.WithLock(pixels => + { + pixels.Y.Fill(255); + pixels.U.Fill(255); + pixels.V.Fill(255); + }); + renderer.Copy(texture); + renderer.Present(); + } + } +} From 96292928ce3fa3bfbc11488fe05eedb028bff3be Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 9 Jul 2024 04:55:54 +0200 Subject: [PATCH 28/62] Finish Ray Tracing sample. --- samples/RayTracer/Camera.cs | 66 +++----------- samples/RayTracer/IObject.cs | 7 +- samples/RayTracer/ISurface.cs | 27 ------ samples/RayTracer/MatteSurface.cs | 36 -------- samples/RayTracer/Plane.cs | 11 ++- samples/RayTracer/Program.cs | 87 +++++++++---------- samples/RayTracer/Ray.cs | 2 + samples/RayTracer/RayExtensions.cs | 17 ++-- samples/RayTracer/Sphere.cs | 29 ++++--- samples/RayTracer/World.cs | 45 ++++++++++ .../Video/Colors/Rgb32fExtensions.cs | 20 +++-- 11 files changed, 145 insertions(+), 202 deletions(-) delete mode 100644 samples/RayTracer/ISurface.cs delete mode 100644 samples/RayTracer/MatteSurface.cs diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index c4c32d1b..1e541f83 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -62,28 +62,28 @@ public void LookAt(Vector3 position, Vector3 target, Vector3 up) public void MoveForward(float distance) { var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); - var translation = forwardVector * -distance; + var translation = forwardVector * distance; _position += translation; } public void MoveBackward(float distance) { var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); - var translation = forwardVector * distance; + var translation = forwardVector * -distance; _position += translation; } public void MoveLeft(float distance) { var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); - var translation = rightVector * -distance; + var translation = rightVector * distance; _position += translation; } public void MoveRight(float distance) { var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); - var translation = rightVector * distance; + var translation = rightVector * -distance; _position += translation; } @@ -105,21 +105,21 @@ public void Yaw(float radians) { var upVector = Vector3.Transform(Vector3.UnitY, _orientation); var rotation = Quaternion.CreateFromAxisAngle(upVector, radians); - _orientation = rotation * _orientation; + _orientation *= rotation; } public void Pitch(float radians) { var rightVector = Vector3.Transform(Vector3.UnitX, _orientation); var rotation = Quaternion.CreateFromAxisAngle(rightVector, radians); - _orientation = rotation * _orientation; + _orientation *= rotation; } public void Roll(float radians) { var forwardVector = Vector3.Transform(Vector3.UnitZ, _orientation); var rotation = Quaternion.CreateFromAxisAngle(forwardVector, radians); - _orientation = rotation * _orientation; + _orientation *= rotation; } public MemoryImage TakeSnapshot(World world) @@ -129,8 +129,8 @@ public MemoryImage TakeSnapshot(World world) throw new ArgumentNullException(nameof(world)); } - var rotationMatrix = Matrix4x4.CreateFromQuaternion(_orientation); - var translationMatrix = Matrix4x4.CreateTranslation(_position); + var rotationMatrix = Matrix4x4.CreateFromQuaternion(Quaternion.Inverse(_orientation)); + var translationMatrix = Matrix4x4.CreateTranslation(-_position); var viewMatrix = rotationMatrix * translationMatrix; Parallel.For(0, Snapshot.Height, y => { @@ -146,57 +146,11 @@ public MemoryImage TakeSnapshot(World world) var ray = new Ray(Vector3.Zero, Vector3.Normalize(rayDirection)); var rayWorld = Ray.Transform(ray, viewMatrix); - var color = Trace(world, rayWorld, 0, 1f); + var color = world.Trace(rayWorld, 0, 1f); Snapshot[y, x] = color.ToArgb8888(); } }); return Snapshot; } - - private static Rgb32f Trace(World world, Ray ray, int level, float weight) - { - var intersection = ray.Intersect(world.Objects).Min; - if (intersection is not null) - { - return Shade(world, intersection, level, weight); - } - return Rgb32f.Black; - } - - private static Rgb32f Shade(World world, Intersection intersection, int level, float weight) - { - var shade = Rgb32f.Black; - var n = intersection.Normal; - var p = intersection.Point; - - foreach (var light in world.Lights) - { - var l = Vector3.Normalize(light.Position - p); - var illumination = Vector3.Dot(n, l); - if (illumination > 0f) - { - var shadowRay = new Ray(p, -l); - if (Shadow(world, shadowRay, Vector3.Distance(p, light.Position)) > 0f) - { - shade += illumination * light.Color; - } - } - var i = intersection.Object.Surface.Shade(world.Ambient, n, l, light.Color); - shade += i; - } - return shade; - } - - private const float RoundOffErrorTolerance = 1e-7f; - - private static float Shadow(World world, Ray ray, float tmax) - { - var nearestIntersection = ray.Intersect(world.Objects).Min; - if (nearestIntersection is null || nearestIntersection.Distance > tmax - RoundOffErrorTolerance) - { - return 1f; - } - return 0f; - } } diff --git a/samples/RayTracer/IObject.cs b/samples/RayTracer/IObject.cs index ff6e89a0..0975dda6 100644 --- a/samples/RayTracer/IObject.cs +++ b/samples/RayTracer/IObject.cs @@ -19,10 +19,15 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; +using SDL2Sharp.Video.Colors; internal interface IObject { - ISurface Surface { get; } + float AmbientCoefficient { get; set; } + + float DiffuseCoefficient { get; set; } + + Rgb32f DiffuseColor { get; set; } Intersection? Intersect(Ray ray); diff --git a/samples/RayTracer/ISurface.cs b/samples/RayTracer/ISurface.cs deleted file mode 100644 index a4ccb0f3..00000000 --- a/samples/RayTracer/ISurface.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Numerics; -using SDL2Sharp.Video.Colors; - -internal interface ISurface -{ - Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor); -} diff --git a/samples/RayTracer/MatteSurface.cs b/samples/RayTracer/MatteSurface.cs deleted file mode 100644 index 04470edb..00000000 --- a/samples/RayTracer/MatteSurface.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Numerics; -using SDL2Sharp.Video.Colors; - -internal sealed class MatteSurface : ISurface -{ - public float AmbientCoefficient { get; set; } = 1f; - - public float DiffuseCoefficient { get; set; } = 1f; - - public Rgb32f DiffuseColor { get; set; } - - public Rgb32f Shade(Rgb32f ambient, Vector3 surfaceNormal, Vector3 lightVector, Rgb32f lightColor) - { - return ambient * AmbientCoefficient + lightColor * DiffuseCoefficient * DiffuseColor * Vector3.Dot(surfaceNormal, lightVector); - } -} diff --git a/samples/RayTracer/Plane.cs b/samples/RayTracer/Plane.cs index e02ff12d..0f269935 100644 --- a/samples/RayTracer/Plane.cs +++ b/samples/RayTracer/Plane.cs @@ -19,15 +19,20 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; +using SDL2Sharp.Video.Colors; internal sealed class Plane : IObject { + public float AmbientCoefficient { get; set; } = 1f; + + public float DiffuseCoefficient { get; set; } = 1f; + + public Rgb32f DiffuseColor { get; set; } = Rgb32f.Black; + public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); public Vector3 Normal { get; set; } = new Vector3(0f, 1f, 0f); - public ISurface Surface { get; set; } = new MatteSurface(); - public Vector3 NormalAt(Vector3 point) { return Normal; @@ -43,7 +48,7 @@ public Vector3 NormalAt(Vector3 point) var numerator = -Vector3.Dot(Normal, ray.Origin + Position); var t = numerator / denominator; - if (t < 0) + if (t <= Ray.Epsilon) { return null; } diff --git a/samples/RayTracer/Program.cs b/samples/RayTracer/Program.cs index ede4c3b0..dec57a82 100644 --- a/samples/RayTracer/Program.cs +++ b/samples/RayTracer/Program.cs @@ -46,95 +46,68 @@ public static void Main() Ambient = new Rgb32f(0.55f, 0.44f, 0.47f), Objects = { - // Backdrop Plane - new Plane - { - Position = new Vector3(0f, 0f, 0f), - Normal = new Vector3(0f, 1f, 0f), - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(1f, 1f, 1f), - } - }, + // Backdrop Plane + new Plane + { + Position = new Vector3(0f, 0f, 0f), + Normal = new Vector3(0f, 1f, 0f), + DiffuseColor = new Rgb32f(.5f, .5f, .5f) + }, // Large center orange Sphere new Sphere { Position = new Vector3(0f, 5.25f, 0f), Radius = 10.5f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) - } + DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) }, // Small center yellow Sphere new Sphere { Position = new Vector3(-3.5f, 1.6f, -6.7f), Radius = 3.2f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) - } + DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) }, // Large back right pink Sphere new Sphere { Position = new Vector3(14f, 7f, 6.5f), Radius = 14f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - } + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) }, // Small front right orange Sphere new Sphere { Position = new Vector3(8.2f, 3.5f, -6.5f), Radius = 7f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) - } + DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) }, // Large back left pink Sphere new Sphere { Position = new Vector3(-16.6f, 6.5f, 0f), Radius = 13f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - } + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) }, // Medium front back left pink Sphere new Sphere { Position = new Vector3(-9.5f, 3f, -6f), Radius = 6f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) - } + DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) }, // Back left yellow Sphere new Sphere { Position = new Vector3(-15f, 3f, 12f), Radius = 6f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) - } + DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) }, // Far Back right blue Sphere new Sphere { Position = new Vector3(40f, 10f, 175f), Radius = 20f / 2f, - Surface = new MatteSurface - { - DiffuseColor = new Rgb32f(0.18f, 0.31f, 0.68f) - } + DiffuseColor = new Rgb32f(0.18f, 0.31f, 0.68f) }, }, Lights = @@ -149,10 +122,9 @@ public static void Main() var camera = new Camera(); camera.Roll(180f * MathF.PI / 180f); - camera.Pitch(-6f * MathF.PI / 180f); - camera.Yaw(180f * MathF.PI / 180f); - camera.MoveUp(-8.5f); - camera.MoveBackward(26f); + camera.Pitch(6f * MathF.PI / 180f); + camera.MoveUp(8.5f); + camera.MoveBackward(32f); var lastFrameTime = TimeSpan.Zero; var accumulatedFrameTime = TimeSpan.Zero; @@ -221,12 +193,26 @@ public static void Main() if (keyboardState.IsPressed(Scancode.W)) { - camera.MoveForward(1); + if (keyboardState.IsPressed(Scancode.LeftShift)) + { + camera.MoveUp(1); + } + else + { + camera.MoveForward(1); + } } if (keyboardState.IsPressed(Scancode.S)) { - camera.MoveBackward(1); + if (keyboardState.IsPressed(Scancode.LeftShift)) + { + camera.MoveDown(1); + } + else + { + camera.MoveBackward(1); + } } if (keyboardState.IsPressed(Scancode.A)) @@ -239,6 +225,11 @@ public static void Main() camera.MoveRight(1); } + if (keyboardState.IsPressed(Scancode.Q)) + { + camera.MoveUp(1); + } + screenTexture.Update(camera.TakeSnapshot(world)); renderer.BlendMode = BlendMode.None; diff --git a/samples/RayTracer/Ray.cs b/samples/RayTracer/Ray.cs index de46307a..6329960f 100644 --- a/samples/RayTracer/Ray.cs +++ b/samples/RayTracer/Ray.cs @@ -22,6 +22,8 @@ internal readonly struct Ray { + public const float Epsilon = 1e-2f; + public Vector3 Origin { get; } public Vector3 Direction { get; } diff --git a/samples/RayTracer/RayExtensions.cs b/samples/RayTracer/RayExtensions.cs index 7bfe807b..1a721f6d 100644 --- a/samples/RayTracer/RayExtensions.cs +++ b/samples/RayTracer/RayExtensions.cs @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Collections.Generic; +using System.Linq; internal static class RayExtensions { @@ -26,17 +27,11 @@ internal static class RayExtensions Comparer.Create( (a, b) => a.Distance.CompareTo(b.Distance)); - public static SortedSet Intersect(this Ray ray, IEnumerable objects) + public static Intersection? Intersect(this Ray ray, IEnumerable objects) { - var intersections = new SortedSet(_distanceComparer); - foreach (var @object in objects) - { - var intersection = @object.Intersect(ray); - if (intersection != null) - { - intersections.Add(intersection); - } - } - return intersections; + return objects + .Select(@object => @object.Intersect(ray)) + .Where(@intersection => @intersection is not null) + .MinBy(@intersection => @intersection!.Distance); } } diff --git a/samples/RayTracer/Sphere.cs b/samples/RayTracer/Sphere.cs index 0c2042d8..2114177c 100644 --- a/samples/RayTracer/Sphere.cs +++ b/samples/RayTracer/Sphere.cs @@ -20,14 +20,19 @@ using System; using System.Numerics; +using SDL2Sharp.Video.Colors; internal sealed class Sphere : IObject { public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); - public float Radius { get; set; } = 1f; + public float Radius { get; set; } - public ISurface Surface { get; set; } = new MatteSurface(); + public float AmbientCoefficient { get; set; } = 1f; + + public float DiffuseCoefficient { get; set; } = 1f; + + public Rgb32f DiffuseColor { get; set; } = Rgb32f.Black; public Vector3 NormalAt(Vector3 point) { @@ -36,26 +41,28 @@ public Vector3 NormalAt(Vector3 point) public Intersection? Intersect(Ray ray) { - var v = ray.Origin - Position; + var v = Position - ray.Origin; var b = Vector3.Dot(v, ray.Direction); - var c = Vector3.Dot(v, v) - Radius * Radius; - if (c > 0f && b > 0f) + var discriminant = b * b - Vector3.Dot(v, v) + Radius * Radius; + if (discriminant <= 0f) { return null; } - var discriminant = b * b - c; - if (discriminant < 0f) + discriminant = MathF.Sqrt(discriminant); + + var t2 = b + discriminant; + if (t2 <= Ray.Epsilon) { return null; } - var t = -b - MathF.Sqrt(discriminant); - if (t < 0f) + var t1 = b - discriminant; + if (t1 > Ray.Epsilon) { - t = 0f; + return new Intersection(this, ray, t1); } - return new Intersection(this, ray, t); + return new Intersection(this, ray, t2); } } diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index f971e8ae..35dec4b0 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -18,7 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using System.Collections.Generic; +using System.Numerics; using SDL2Sharp.Video.Colors; internal sealed class World @@ -28,4 +30,47 @@ internal sealed class World public ICollection Objects { get; } = new List(); public ICollection Lights { get; } = new List(); + + public Rgb32f Trace(Ray ray, int level, float weight) + { + var nearestIntersection = ray.Intersect(Objects); + if (nearestIntersection is not null) + { + return Shade(nearestIntersection, level, weight); + } + return Rgb32f.Black; + } + + private Rgb32f Shade(Intersection intersection, int level, float weight) + { + var color = Rgb32f.Black; + var @object = intersection.Object; + var surfaceNormal = intersection.Normal; + var surfacePoint = intersection.Point; + + foreach (var light in Lights) + { + var lightVector = Vector3.Normalize(light.Position - surfacePoint); + var illumination = Vector3.Dot(surfaceNormal, lightVector); + var shadowRay = new Ray(surfacePoint, lightVector); + var visibility = Shadow(shadowRay, MathF.Abs(Vector3.Distance(surfacePoint, light.Position))); + if (illumination > 0f && visibility > 0f) + { + var ambientCoefficient = intersection.Object.AmbientCoefficient; + var diffuseCoefficient = intersection.Object.DiffuseCoefficient; + color += Ambient * ambientCoefficient + light.Color * diffuseCoefficient * @object.DiffuseColor * illumination; + } + } + return color; + } + + private float Shadow(Ray ray, float maxDistance) + { + var nearestIntersection = ray.Intersect(Objects); + if (nearestIntersection is null || nearestIntersection.Distance > (maxDistance - Ray.Epsilon)) + { + return 1f; + } + return 0f; + } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs b/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs index 0b463e02..ccad5a84 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs @@ -18,6 +18,8 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using static System.Math; + namespace SDL2Sharp.Video.Colors { public static class Rgb32fExtensions @@ -26,9 +28,9 @@ public static Color ToColor(this Rgb32f color) { var clampedColor = Rgb32f.Clamp(color); var scaledColor = clampedColor * 255f; - var r = (byte)scaledColor.R; - var g = (byte)scaledColor.G; - var b = (byte)scaledColor.B; + var r = (byte)Round(scaledColor.R); + var g = (byte)Round(scaledColor.G); + var b = (byte)Round(scaledColor.B); return new Color(r, g, b, 255); } @@ -36,9 +38,9 @@ public static Rgba8888 ToRgba8888(this Rgb32f color) { var clampedColor = Rgb32f.Clamp(color); var scaledColor = clampedColor * 255f; - var r = (byte)scaledColor.R; - var g = (byte)scaledColor.G; - var b = (byte)scaledColor.B; + var r = (byte)Round(scaledColor.R); + var g = (byte)Round(scaledColor.G); + var b = (byte)Round(scaledColor.B); return new Rgba8888(r, g, b, 255); } @@ -46,9 +48,9 @@ public static Argb8888 ToArgb8888(this Rgb32f color) { var clampedColor = Rgb32f.Clamp(color); var scaledColor = clampedColor * 255f; - var r = (byte)scaledColor.R; - var g = (byte)scaledColor.G; - var b = (byte)scaledColor.B; + var r = (byte)Round(scaledColor.R); + var g = (byte)Round(scaledColor.G); + var b = (byte)Round(scaledColor.B); return new Argb8888(255, r, g, b); } } From 5d6325d4f721b192060989ea51e7ec0ccfc85749 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 12 Jul 2024 14:52:22 +0200 Subject: [PATCH 29/62] Use Texture.Update because it is slightly faster than Texture.WithLock. --- samples/PlasmaFractal/Program.cs | 14 ++++---- samples/TunnelEffect/Program.cs | 55 ++++++++++++++++---------------- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs index 6acc7cec..d2567b0c 100644 --- a/samples/PlasmaFractal/Program.cs +++ b/samples/PlasmaFractal/Program.cs @@ -42,6 +42,7 @@ public static void Main() using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + var screenImage = new MemoryImage(renderer.OutputSize); var sourceImage = GenerateDiamondSquareImage(renderer.OutputSize); var palette = GeneratePalette(); var reversePaletteRotation = false; @@ -84,16 +85,15 @@ public static void Main() var elapsedFrameTime = currentFrameTime - lastFrameTime; accumulatedFrameTime += elapsedFrameTime; - screenTexture.WithLock(screenImage => + for (var y = 0; y < screenImage.Height; ++y) { - for (var y = 0; y < screenImage.Height; ++y) + for (var x = 0; x < screenImage.Width; ++x) { - for (var x = 0; x < screenImage.Width; ++x) - { - screenImage[y, x] = palette[sourceImage[y, x]]; - } + screenImage[y, x] = palette[sourceImage[y, x]]; } - }); + } + + screenTexture.Update(screenImage); renderer.BlendMode = BlendMode.None; renderer.DrawColor = Color.Black; diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index a21f83c8..b4e8bf19 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -43,7 +43,8 @@ public static void Main() using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); var screenSize = renderer.OutputSize; - var sourceImageSize = NextPowerOfTwo(Max(screenSize.Width, screenSize.Height)); + var screenImage = new MemoryImage(renderer.OutputSize); + var sourceImageSize = NextPowerOfTwo(Max(renderer.OutputWidth, renderer.OutputHeight)); var sourceImage = GenerateXorImage(sourceImageSize); var transformTable = GenerateTransformTable(sourceImageSize); @@ -81,36 +82,34 @@ public static void Main() var elapsedFrameTime = currentFrameTime - lastFrameTime; accumulatedFrameTime += elapsedFrameTime; - screenTexture.WithLock(screenImage => + var screenWidth = screenImage.Width; + var screenHeight = screenImage.Height; + var sourceWidth = sourceImage.Width; + var sourceHeight = sourceImage.Height; + var sourceWidthMask = sourceWidth - 1; + var sourceHeightMask = sourceHeight - 1; + + var shiftX = (int)(screenWidth * 1.0 * currentFrameTime.TotalSeconds); + var shiftY = (int)(screenHeight * 0.25 * currentFrameTime.TotalSeconds); + var lookX = (sourceWidth - screenWidth) / 2; + var lookY = (sourceHeight - screenHeight) / 2; + var shiftLookX = shiftX + lookX; + var shiftLookY = shiftY + lookY; + + for (var screenY = 0; screenY < screenHeight; ++screenY) { - var screenWidth = screenImage.Width; - var screenHeight = screenImage.Height; - - var sourceWidth = sourceImage.Width; - var sourceHeight = sourceImage.Height; - var sourceWidthMask = sourceWidth - 1; - var sourceHeightMask = sourceHeight - 1; - - var shiftX = (int)(screenWidth * 1.0 * currentFrameTime.TotalSeconds); - var shiftY = (int)(screenHeight * 0.25 * currentFrameTime.TotalSeconds); - var lookX = (sourceWidth - screenWidth) / 2; - var lookY = (sourceHeight - screenHeight) / 2; - var shiftLookX = shiftX + lookX; - var shiftLookY = shiftY + lookY; - - for (var screenY = 0; screenY < screenHeight; ++screenY) + var transformY = screenY + lookY; + for (var screenX = 0; screenX < screenWidth; ++screenX) { - var transformY = screenY + lookY; - for (var screenX = 0; screenX < screenWidth; ++screenX) - { - var transformX = screenX + lookX; - var transform = transformTable[transformY, transformX]; - var sourceX = (transform.Distance + shiftLookX) & sourceWidthMask; - var sourceY = (transform.Angle + shiftLookY) & sourceHeightMask; - screenImage[screenY, screenX] = sourceImage[sourceY, sourceX]; - } + var transformX = screenX + lookX; + var transform = transformTable[transformY, transformX]; + var sourceX = (transform.Distance + shiftLookX) & sourceWidthMask; + var sourceY = (transform.Angle + shiftLookY) & sourceHeightMask; + screenImage[screenY, screenX] = sourceImage[sourceY, sourceX]; } - }); + } + + screenTexture.Update(screenImage); renderer.BlendMode = BlendMode.None; renderer.DrawColor = Color.Black; From 74b7d9f2329952b3102bb75b386551e2aec017b5 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 12 Jul 2024 14:53:17 +0200 Subject: [PATCH 30/62] Add properties to return the output width and output height of a Renderer. --- sources/SDL2Sharp/Video/Renderer.cs | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index 8b5bc92e..977cd508 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -57,6 +57,34 @@ public Size OutputSize } } + public int OutputWidth + { + get + { + ThrowWhenDisposed(); + + int width; + Error.ThrowOnFailure( + SDL.GetRendererOutputSize(_handle, &width, null) + ); + return width; + } + } + + public int OutputHeight + { + get + { + ThrowWhenDisposed(); + + int height; + Error.ThrowOnFailure( + SDL.GetRendererOutputSize(_handle, null, &height) + ); + return height; + } + } + public Color DrawColor { get From c395501be62a3c78045046a5c458c15fb68cc774 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 12 Jul 2024 14:54:12 +0200 Subject: [PATCH 31/62] Add support for display information. --- sources/SDL2Sharp/Video/Display.cs | 122 ++++++++++++++++++ sources/SDL2Sharp/Video/DisplayMode.cs | 41 ++++++ sources/SDL2Sharp/Video/DisplayOrientation.cs | 33 +++++ sources/SDL2Sharp/Video/VideoSubsystem.cs | 17 ++- 4 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 sources/SDL2Sharp/Video/Display.cs create mode 100644 sources/SDL2Sharp/Video/DisplayMode.cs create mode 100644 sources/SDL2Sharp/Video/DisplayOrientation.cs diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/Video/Display.cs new file mode 100644 index 00000000..05ecfc69 --- /dev/null +++ b/sources/SDL2Sharp/Video/Display.cs @@ -0,0 +1,122 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Collections.Generic; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Video +{ + public unsafe sealed class Display + { + private readonly int _displayIndex; + + public string Name + { + get + { + return new string( + Error.ReturnOrThrowOnFailure( + SDL.GetDisplayName(_displayIndex) + ) + ); + } + } + + public Rectangle Bounds + { + get + { + var rect = new SDL_Rect(); + Error.ThrowOnFailure( + SDL.GetDisplayBounds(_displayIndex, &rect) + ); + return new Rectangle(rect.x, rect.y, rect.w, rect.h); + } + } + + public DisplayMode CurrentMode + { + get + { + var displayMode = new SDL_DisplayMode(); + Error.ThrowOnFailure( + SDL.GetCurrentDisplayMode(_displayIndex, &displayMode) + ); + return new DisplayMode( + (PixelFormatEnum)displayMode.format, + displayMode.w, + displayMode.h, + displayMode.refresh_rate); + } + } + + public DisplayMode DesktopMode + { + get + { + var displayMode = new SDL_DisplayMode(); + Error.ThrowOnFailure( + SDL.GetDesktopDisplayMode(_displayIndex, &displayMode) + ); + return new DisplayMode( + (PixelFormatEnum)displayMode.format, + displayMode.w, + displayMode.h, + displayMode.refresh_rate); + } + } + + public IReadOnlyList Modes + { + get + { + var modeCount = SDL.GetNumDisplayModes(_displayIndex); + var modes = new List(modeCount); + for (var modeIndex = 0; modeIndex < modeCount; modeIndex++) + { + var displayMode = new SDL_DisplayMode(); + Error.ThrowOnFailure( + SDL.GetDisplayMode(_displayIndex, modeIndex, &displayMode) + ); + modes.Add(new DisplayMode( + (PixelFormatEnum)displayMode.format, + displayMode.w, + displayMode.h, + displayMode.refresh_rate)); + } + return modes.AsReadOnly(); + } + } + + public DisplayOrientation Orientation + { + get + { + return (DisplayOrientation)SDL.GetDisplayOrientation(_displayIndex); + } + } + + public Display(int displayIndex) + { + _displayIndex = displayIndex; + } + + } +} diff --git a/sources/SDL2Sharp/Video/DisplayMode.cs b/sources/SDL2Sharp/Video/DisplayMode.cs new file mode 100644 index 00000000..a4cdee2d --- /dev/null +++ b/sources/SDL2Sharp/Video/DisplayMode.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public sealed class DisplayMode + { + public PixelFormatEnum Format { get; } + + public int Width { get; } + + public int Height { get; } + + public int RefreshRate { get; } + + public DisplayMode(PixelFormatEnum format, int width, int height, int refreshRate) + { + Format = format; + Width = width; + Height = height; + RefreshRate = refreshRate; + } + } +} diff --git a/sources/SDL2Sharp/Video/DisplayOrientation.cs b/sources/SDL2Sharp/Video/DisplayOrientation.cs new file mode 100644 index 00000000..618fe938 --- /dev/null +++ b/sources/SDL2Sharp/Video/DisplayOrientation.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_DisplayOrientation; + +namespace SDL2Sharp.Video +{ + public enum DisplayOrientation + { + Unknown = SDL_ORIENTATION_UNKNOWN, + Landscape = SDL_ORIENTATION_LANDSCAPE, + LandscapeFlipped = SDL_ORIENTATION_LANDSCAPE_FLIPPED, + Portrait = SDL_ORIENTATION_PORTRAIT, + PortraitFlipped = SDL_ORIENTATION_PORTRAIT_FLIPPED + } +} diff --git a/sources/SDL2Sharp/Video/VideoSubsystem.cs b/sources/SDL2Sharp/Video/VideoSubsystem.cs index 83418d33..dfd053e0 100644 --- a/sources/SDL2Sharp/Video/VideoSubsystem.cs +++ b/sources/SDL2Sharp/Video/VideoSubsystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Collections.Generic; using SDL2Sharp.Interop; namespace SDL2Sharp.Video @@ -27,6 +28,20 @@ public sealed class VideoSubsystem : IDisposable { private const uint InitSubsystemFlags = SDL.SDL_INIT_VIDEO; + public IReadOnlyList Displays + { + get + { + var displayCount = SDL.GetNumVideoDisplays(); + var displays = new List(displayCount); + for (var displayIndex = 0; displayIndex < displayCount; displayIndex++) + { + displays.Add(new Display(displayIndex)); + } + return displays.AsReadOnly(); + } + } + public VideoSubsystem() { SDL.InitSubSystem(InitSubsystemFlags); From 449eb8d111cdfed8478c604ee8b02272bbca01f9 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 16 Jul 2024 11:49:08 +0200 Subject: [PATCH 32/62] Another mayor overhaul. --- samples/PlasmaFractal/Program.cs | 40 +-- samples/RayTracer/Camera.cs | 8 +- samples/RayTracer/IObject.cs | 2 +- samples/RayTracer/Plane.cs | 2 +- samples/RayTracer/PointLight.cs | 2 +- samples/RayTracer/Program.cs | 24 +- samples/RayTracer/Sphere.cs | 2 +- samples/RayTracer/World.cs | 10 +- samples/SwirlStars/Program.cs | 2 +- samples/SwirlStars/Star.cs | 2 +- samples/TunnelEffect/Program.cs | 24 +- .../SDL2Sharp.Interop/SDL_RendererFlags.cs | 5 +- .../SDL2Sharp.Interop/SDL_TextureAccess.cs | 2 +- sources/SDL2Sharp/Video/Colors/Abgr1555.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Abgr4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Abgr8888.cs | 39 ++- sources/SDL2Sharp/Video/Colors/Argb1555.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Argb2101010.cs | 35 ++- sources/SDL2Sharp/Video/Colors/Argb4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Argb8888.cs | 39 ++- sources/SDL2Sharp/Video/Colors/Bgr24.cs | 2 +- sources/SDL2Sharp/Video/Colors/Bgr565.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Bgra4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Bgra5551.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Bgra8888.cs | 39 ++- sources/SDL2Sharp/Video/Colors/Bgrx8888.cs | 39 ++- sources/SDL2Sharp/Video/Colors/Rgb24.cs | 2 +- sources/SDL2Sharp/Video/Colors/Rgb332.cs | 30 ++- sources/SDL2Sharp/Video/Colors/Rgb565.cs | 32 ++- .../Video/Colors/{Rgb32f.cs => Rgb96f.cs} | 76 +++--- ...gb32fExtensions.cs => Rgb96fExtensions.cs} | 16 +- sources/SDL2Sharp/Video/Colors/Rgba4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Rgba5551.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Rgba8888.cs | 39 ++- sources/SDL2Sharp/Video/Colors/Rgbx8888.cs | 39 ++- .../U8.cs} | 18 +- sources/SDL2Sharp/Video/Colors/UV88.cs | 42 +++ sources/SDL2Sharp/Video/Colors/Uyvy.cs | 16 +- .../V8.cs} | 17 +- sources/SDL2Sharp/Video/Colors/VU88.cs | 42 +++ sources/SDL2Sharp/Video/Colors/Xbgr1555.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Xbgr4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Xbgr8888.cs | 36 ++- sources/SDL2Sharp/Video/Colors/Xrgb1555.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Xrgb4444.cs | 32 ++- sources/SDL2Sharp/Video/Colors/Xrgb8888.cs | 36 ++- .../Y8.cs} | 17 +- sources/SDL2Sharp/Video/Colors/Yuy2.cs | 16 +- sources/SDL2Sharp/Video/Colors/Yvyu.cs | 16 +- sources/SDL2Sharp/Video/Display.cs | 6 +- sources/SDL2Sharp/Video/DisplayMode.cs | 4 +- ...ckPackedImageCallback.cs => IYuvFormat.cs} | 19 +- .../{MemoryImage.cs => ImageMemoryPlane.cs} | 32 +-- .../Video/{ColorPlane.cs => ImagePlane.cs} | 78 +++--- sources/SDL2Sharp/Video/Iyuv.cs | 88 ++++++ sources/SDL2Sharp/Video/IyuvTexture.cs | 102 ------- sources/SDL2Sharp/Video/Nv12Image.cs | 28 +- .../{Yv12Image.cs => Nv12MemoryImage.cs} | 54 ++-- sources/SDL2Sharp/Video/Nv12Texture.cs | 65 +++-- sources/SDL2Sharp/Video/Nv21Image.cs | 28 +- .../{IyuvImage.cs => Nv21MemoryImage.cs} | 54 ++-- sources/SDL2Sharp/Video/Nv21Texture.cs | 63 ++++- sources/SDL2Sharp/Video/PackedImage.cs | 112 ++------ sources/SDL2Sharp/Video/PackedLayout.cs | 37 +++ sources/SDL2Sharp/Video/PackedMemoryImage.cs | 72 +++++ sources/SDL2Sharp/Video/PackedOrder.cs | 37 +++ sources/SDL2Sharp/Video/PackedPixelFormat.cs | 55 ---- sources/SDL2Sharp/Video/PackedTexture.cs | 67 +++-- sources/SDL2Sharp/Video/PixelFormat.cs | 122 ++++----- ...orAttribute.cs => PixelFormatAttribute.cs} | 14 +- .../SDL2Sharp/Video/PixelFormatDescriptor.cs | 128 +++++++++ sources/SDL2Sharp/Video/PixelFormatEnum.cs | 78 ------ .../Video/PixelFormatEnumExtensions.cs | 66 ----- .../SDL2Sharp/Video/PixelFormatExtensions.cs | 133 +++++++++ ...LockYv12ImageCallback.cs => PixelOrder.cs} | 8 +- sources/SDL2Sharp/Video/PixelType.cs | 2 +- sources/SDL2Sharp/Video/Renderer.cs | 36 ++- sources/SDL2Sharp/Video/RendererExtensions.cs | 37 +-- sources/SDL2Sharp/Video/RendererInfo.cs | 10 +- sources/SDL2Sharp/Video/Surface.cs | 18 +- ...mageCallback.cs => SurfaceLockCallback.cs} | 5 +- sources/SDL2Sharp/Video/Surface{T}.cs | 21 +- sources/SDL2Sharp/Video/Texture.cs | 100 +------ sources/SDL2Sharp/Video/TextureAccess.cs | 2 +- sources/SDL2Sharp/Video/TextureExtensions.cs | 69 +++++ sources/SDL2Sharp/Video/Window.cs | 4 +- sources/SDL2Sharp/Video/YuvImage.cs | 103 +++++++ .../Video/{Yv12Texture.cs => YuvTexture.cs} | 48 +++- sources/SDL2Sharp/Video/Yv12.cs | 88 ++++++ .../Colors/Argb2101010Tests.cs | 47 ++++ tests/SDL2Sharp.Tests/PackedTextureTests.cs | 254 ++++++++++++++---- tests/SDL2Sharp.Tests/PlanarTextureTests.cs | 19 +- tests/SDL2Sharp.Tests/SurfaceTests.cs | 2 +- tests/SDL2Sharp.Tests/TextureTests.cs | 131 +++++---- 94 files changed, 2457 insertions(+), 1313 deletions(-) rename sources/SDL2Sharp/Video/Colors/{Rgb32f.cs => Rgb96f.cs} (68%) rename sources/SDL2Sharp/Video/Colors/{Rgb32fExtensions.cs => Rgb96fExtensions.cs} (82%) rename sources/SDL2Sharp/Video/{WithLockSurfaceCallback.cs => Colors/U8.cs} (74%) create mode 100644 sources/SDL2Sharp/Video/Colors/UV88.cs rename sources/SDL2Sharp/Video/{WithLockNv12ImageCallback.cs => Colors/V8.cs} (74%) create mode 100644 sources/SDL2Sharp/Video/Colors/VU88.cs rename sources/SDL2Sharp/Video/{WithLockNv21ImageCallback.cs => Colors/Y8.cs} (74%) rename sources/SDL2Sharp/Video/{WithLockPackedImageCallback.cs => IYuvFormat.cs} (57%) rename sources/SDL2Sharp/Video/{MemoryImage.cs => ImageMemoryPlane.cs} (80%) rename sources/SDL2Sharp/Video/{ColorPlane.cs => ImagePlane.cs} (66%) create mode 100644 sources/SDL2Sharp/Video/Iyuv.cs delete mode 100644 sources/SDL2Sharp/Video/IyuvTexture.cs rename sources/SDL2Sharp/Video/{Yv12Image.cs => Nv12MemoryImage.cs} (59%) rename sources/SDL2Sharp/Video/{IyuvImage.cs => Nv21MemoryImage.cs} (59%) create mode 100644 sources/SDL2Sharp/Video/PackedLayout.cs create mode 100644 sources/SDL2Sharp/Video/PackedMemoryImage.cs create mode 100644 sources/SDL2Sharp/Video/PackedOrder.cs delete mode 100644 sources/SDL2Sharp/Video/PackedPixelFormat.cs rename sources/SDL2Sharp/Video/{PackedColorAttribute.cs => PixelFormatAttribute.cs} (77%) create mode 100644 sources/SDL2Sharp/Video/PixelFormatDescriptor.cs delete mode 100644 sources/SDL2Sharp/Video/PixelFormatEnum.cs delete mode 100644 sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs create mode 100644 sources/SDL2Sharp/Video/PixelFormatExtensions.cs rename sources/SDL2Sharp/Video/{WithLockYv12ImageCallback.cs => PixelOrder.cs} (89%) rename sources/SDL2Sharp/Video/{WithLockIyuvImageCallback.cs => SurfaceLockCallback.cs} (86%) create mode 100644 sources/SDL2Sharp/Video/TextureExtensions.cs create mode 100644 sources/SDL2Sharp/Video/YuvImage.cs rename sources/SDL2Sharp/Video/{Yv12Texture.cs => YuvTexture.cs} (58%) create mode 100644 sources/SDL2Sharp/Video/Yv12.cs create mode 100644 tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs index d2567b0c..cf36c2ef 100644 --- a/samples/PlasmaFractal/Program.cs +++ b/samples/PlasmaFractal/Program.cs @@ -39,10 +39,10 @@ public static void Main() using var window = videoSubystem.CreateWindow("Plasma Fractal", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); - var screenImage = new MemoryImage(renderer.OutputSize); + var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImage = GenerateDiamondSquareImage(renderer.OutputSize); var palette = GeneratePalette(); var reversePaletteRotation = false; @@ -89,7 +89,7 @@ public static void Main() { for (var x = 0; x < screenImage.Width; ++x) { - screenImage[y, x] = palette[sourceImage[y, x]]; + screenImage[x, y] = palette[sourceImage[x, y]]; } } @@ -149,27 +149,27 @@ private static Palette GeneratePalette() return palette; } - private static MemoryImage GenerateDiamondSquareImage(Size size) + private static PackedMemoryImage GenerateDiamondSquareImage(Size size) { return GenerateDiamondSquareImage(size.Width, size.Height); } - private static MemoryImage GenerateDiamondSquareImage(int width, int height) + private static PackedMemoryImage GenerateDiamondSquareImage(int width, int height) { var size = NextPowerOfTwo(Max(width, height)) + 1; var image = GenerateDiamondSquareImage(size); return image.Crop(0, 0, height, width); } - private static MemoryImage GenerateDiamondSquareImage(int size) + private static PackedMemoryImage GenerateDiamondSquareImage(int size) { - var image = new MemoryImage(size, size); + var image = new PackedMemoryImage(size, size); var randomness = 256; image[0, 0] = (byte)_random.Next(0, randomness); - image[0, size - 1] = (byte)_random.Next(0, randomness); image[size - 1, 0] = (byte)_random.Next(0, randomness); + image[0, size - 1] = (byte)_random.Next(0, randomness); image[size - 1, size - 1] = (byte)_random.Next(0, randomness); randomness /= 2; @@ -199,7 +199,7 @@ private static MemoryImage GenerateDiamondSquareImage(int size) return image; } - private static void Diamond(MemoryImage map, int centerX, int centerY, int distance, int randomness) + private static void Diamond(PackedMemoryImage map, int centerX, int centerY, int distance, int randomness) { var sum = 0; var count = 0; @@ -209,14 +209,14 @@ private static void Diamond(MemoryImage map, int centerX, int centerY, int var left = centerX - distance; if (left >= 0 && left < map.Width) { - sum += map[top, left]; + sum += map[left, top]; count++; } var right = centerX + distance; if (right >= 0 && right < map.Height) { - sum += map[top, right]; + sum += map[right, top]; count++; } } @@ -227,14 +227,14 @@ private static void Diamond(MemoryImage map, int centerX, int centerY, int var left = centerX - distance; if (left >= 0 && left < map.Width) { - sum += map[bottom, left]; + sum += map[left, bottom]; count++; } var right = centerX + distance; if (right >= 0 && right < map.Height) { - sum += map[bottom, right]; + sum += map[right, bottom]; count++; } } @@ -243,38 +243,38 @@ private static void Diamond(MemoryImage map, int centerX, int centerY, int var random = _random.Next(-randomness, randomness); var value = Clamp(average + random, 0, 255); - map[centerY, centerX] = (byte)value; + map[centerX, centerY] = (byte)value; } - private static void Square(MemoryImage map, int centerX, int centerY, int distance, int randomness) + private static void Square(PackedMemoryImage map, int centerX, int centerY, int distance, int randomness) { var sum = 0; var count = 0; var top = centerY - distance; if (top >= 0 && top < map.Height) { - sum += map[top, centerX]; + sum += map[centerX, top]; count++; } var left = centerX - distance; if (left >= 0 && left < map.Width) { - sum += map[centerY, left]; + sum += map[left, centerY]; count++; } var bottom = centerY + distance; if (bottom >= 0 && bottom < map.Height) { - sum += map[bottom, centerX]; + sum += map[centerX, bottom]; count++; } var right = centerX + distance; if (right >= 0 && right < map.Height) { - sum += map[centerY, right]; + sum += map[right, centerY]; count++; } @@ -282,6 +282,6 @@ private static void Square(MemoryImage map, int centerX, int centerY, int var random = _random.Next(-randomness, randomness); var value = Clamp(average + random, 0, 255); - map[centerY, centerX] = (byte)value; + map[centerX, centerY] = (byte)value; } } diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index 1e541f83..ea22d19f 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -40,7 +40,7 @@ internal sealed class Camera public float FocalLength { get; private set; } - public MemoryImage Snapshot { get; } + public PackedMemoryImage Snapshot { get; } public Camera() { @@ -49,7 +49,7 @@ public Camera() Frustum = new Frustum(-4f / 3f, 4f / 3f, -1f, +1f, float.Epsilon, float.PositiveInfinity); FieldOfView = 90f; FocalLength = (float)(Resolution.Width / Resolution.Height / MathF.Tan(FieldOfView * MathF.PI / 180f / 2f)); - Snapshot = new MemoryImage(Resolution.Width, Resolution.Height); + Snapshot = new PackedMemoryImage(Resolution.Width, Resolution.Height); } public void LookAt(Vector3 position, Vector3 target, Vector3 up) @@ -122,7 +122,7 @@ public void Roll(float radians) _orientation *= rotation; } - public MemoryImage TakeSnapshot(World world) + public PackedMemoryImage TakeSnapshot(World world) { if (world is null) { @@ -147,7 +147,7 @@ public MemoryImage TakeSnapshot(World world) var ray = new Ray(Vector3.Zero, Vector3.Normalize(rayDirection)); var rayWorld = Ray.Transform(ray, viewMatrix); var color = world.Trace(rayWorld, 0, 1f); - Snapshot[y, x] = color.ToArgb8888(); + Snapshot[x, y] = color.ToArgb8888(); } }); diff --git a/samples/RayTracer/IObject.cs b/samples/RayTracer/IObject.cs index 0975dda6..799c91a7 100644 --- a/samples/RayTracer/IObject.cs +++ b/samples/RayTracer/IObject.cs @@ -27,7 +27,7 @@ internal interface IObject float DiffuseCoefficient { get; set; } - Rgb32f DiffuseColor { get; set; } + Rgb96f DiffuseColor { get; set; } Intersection? Intersect(Ray ray); diff --git a/samples/RayTracer/Plane.cs b/samples/RayTracer/Plane.cs index 0f269935..3bab5ab1 100644 --- a/samples/RayTracer/Plane.cs +++ b/samples/RayTracer/Plane.cs @@ -27,7 +27,7 @@ internal sealed class Plane : IObject public float DiffuseCoefficient { get; set; } = 1f; - public Rgb32f DiffuseColor { get; set; } = Rgb32f.Black; + public Rgb96f DiffuseColor { get; set; } = Rgb96f.Black; public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); diff --git a/samples/RayTracer/PointLight.cs b/samples/RayTracer/PointLight.cs index 40ad0eba..6d2f6148 100644 --- a/samples/RayTracer/PointLight.cs +++ b/samples/RayTracer/PointLight.cs @@ -25,5 +25,5 @@ internal sealed class PointLight { public Vector3 Position { get; set; } - public Rgb32f Color { get; set; } + public Rgb96f Color { get; set; } } diff --git a/samples/RayTracer/Program.cs b/samples/RayTracer/Program.cs index dec57a82..106bf600 100644 --- a/samples/RayTracer/Program.cs +++ b/samples/RayTracer/Program.cs @@ -38,12 +38,12 @@ public static void Main() using var window = videoSubystem.CreateWindow("Ray Tracer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); var world = new World { - Ambient = new Rgb32f(0.55f, 0.44f, 0.47f), + Ambient = new Rgb96f(0.55f, 0.44f, 0.47f), Objects = { // Backdrop Plane @@ -51,63 +51,63 @@ public static void Main() { Position = new Vector3(0f, 0f, 0f), Normal = new Vector3(0f, 1f, 0f), - DiffuseColor = new Rgb32f(.5f, .5f, .5f) + DiffuseColor = new Rgb96f(.5f, .5f, .5f) }, // Large center orange Sphere new Sphere { Position = new Vector3(0f, 5.25f, 0f), Radius = 10.5f / 2f, - DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) + DiffuseColor = new Rgb96f(0.89f, 0.48f, 0.42f) }, // Small center yellow Sphere new Sphere { Position = new Vector3(-3.5f, 1.6f, -6.7f), Radius = 3.2f / 2f, - DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) + DiffuseColor = new Rgb96f(0.95f, 0.93f, 0.31f) }, // Large back right pink Sphere new Sphere { Position = new Vector3(14f, 7f, 6.5f), Radius = 14f / 2f, - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) }, // Small front right orange Sphere new Sphere { Position = new Vector3(8.2f, 3.5f, -6.5f), Radius = 7f / 2f, - DiffuseColor = new Rgb32f(0.89f, 0.48f, 0.42f) + DiffuseColor = new Rgb96f(0.89f, 0.48f, 0.42f) }, // Large back left pink Sphere new Sphere { Position = new Vector3(-16.6f, 6.5f, 0f), Radius = 13f / 2f, - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) }, // Medium front back left pink Sphere new Sphere { Position = new Vector3(-9.5f, 3f, -6f), Radius = 6f / 2f, - DiffuseColor = new Rgb32f(1f, 0.44f, 0.64f) + DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) }, // Back left yellow Sphere new Sphere { Position = new Vector3(-15f, 3f, 12f), Radius = 6f / 2f, - DiffuseColor = new Rgb32f(0.95f, 0.93f, 0.31f) + DiffuseColor = new Rgb96f(0.95f, 0.93f, 0.31f) }, // Far Back right blue Sphere new Sphere { Position = new Vector3(40f, 10f, 175f), Radius = 20f / 2f, - DiffuseColor = new Rgb32f(0.18f, 0.31f, 0.68f) + DiffuseColor = new Rgb96f(0.18f, 0.31f, 0.68f) }, }, Lights = @@ -115,7 +115,7 @@ public static void Main() new PointLight { Position = new Vector3(-300f, 350f, 10f), - Color = new Rgb32f(0.70f, 0.689f, 0.6885f) + Color = new Rgb96f(0.70f, 0.689f, 0.6885f) }, }, }; diff --git a/samples/RayTracer/Sphere.cs b/samples/RayTracer/Sphere.cs index 2114177c..a5e2964a 100644 --- a/samples/RayTracer/Sphere.cs +++ b/samples/RayTracer/Sphere.cs @@ -32,7 +32,7 @@ internal sealed class Sphere : IObject public float DiffuseCoefficient { get; set; } = 1f; - public Rgb32f DiffuseColor { get; set; } = Rgb32f.Black; + public Rgb96f DiffuseColor { get; set; } = Rgb96f.Black; public Vector3 NormalAt(Vector3 point) { diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index 35dec4b0..eafe8bb0 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -25,25 +25,25 @@ internal sealed class World { - public Rgb32f Ambient { get; set; } + public Rgb96f Ambient { get; set; } public ICollection Objects { get; } = new List(); public ICollection Lights { get; } = new List(); - public Rgb32f Trace(Ray ray, int level, float weight) + public Rgb96f Trace(Ray ray, int level, float weight) { var nearestIntersection = ray.Intersect(Objects); if (nearestIntersection is not null) { return Shade(nearestIntersection, level, weight); } - return Rgb32f.Black; + return Rgb96f.Black; } - private Rgb32f Shade(Intersection intersection, int level, float weight) + private Rgb96f Shade(Intersection intersection, int level, float weight) { - var color = Rgb32f.Black; + var color = Rgb96f.Black; var @object = intersection.Object; var surfaceNormal = intersection.Normal; var surfacePoint = intersection.Point; diff --git a/samples/SwirlStars/Program.cs b/samples/SwirlStars/Program.cs index b9c2624b..5f1dbdc8 100644 --- a/samples/SwirlStars/Program.cs +++ b/samples/SwirlStars/Program.cs @@ -150,7 +150,7 @@ private static void ResetStar(Star star) x: 0f, y: 0f, z: -(.5f + 4.5f * _randomizer.NextSingle())); - star.Color = new Rgb32f( + star.Color = new Rgb96f( r: _randomizer.NextSingle(), g: _randomizer.NextSingle(), b: _randomizer.NextSingle() diff --git a/samples/SwirlStars/Star.cs b/samples/SwirlStars/Star.cs index 4542149a..2fd2f690 100644 --- a/samples/SwirlStars/Star.cs +++ b/samples/SwirlStars/Star.cs @@ -27,5 +27,5 @@ internal sealed class Star public Vector3 Velocity { get; set; } = Vector3.Zero; - public Rgb32f Color { get; set; } = Rgb32f.Black; + public Rgb96f Color { get; set; } = Rgb96f.Black; } diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index b4e8bf19..6144c4d9 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -39,11 +39,11 @@ public static void Main() using var window = videoSubystem.CreateWindow("Tunnel Effect", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); var screenSize = renderer.OutputSize; - var screenImage = new MemoryImage(renderer.OutputSize); + var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImageSize = NextPowerOfTwo(Max(renderer.OutputWidth, renderer.OutputHeight)); var sourceImage = GenerateXorImage(sourceImageSize); var transformTable = GenerateTransformTable(sourceImageSize); @@ -102,10 +102,10 @@ public static void Main() for (var screenX = 0; screenX < screenWidth; ++screenX) { var transformX = screenX + lookX; - var transform = transformTable[transformY, transformX]; + var transform = transformTable[transformX, transformY]; var sourceX = (transform.Distance + shiftLookX) & sourceWidthMask; var sourceY = (transform.Angle + shiftLookY) & sourceHeightMask; - screenImage[screenY, screenX] = sourceImage[sourceY, sourceX]; + screenImage[screenX, screenY] = sourceImage[sourceX, sourceY]; } } @@ -135,19 +135,19 @@ public static void Main() } } - private static MemoryImage GenerateXorImage(int size) + private static PackedMemoryImage GenerateXorImage(int size) { return GenerateXorImage(size, size); } - private static MemoryImage GenerateXorImage(int width, int height) + private static PackedMemoryImage GenerateXorImage(int width, int height) { - var image = new MemoryImage(width, height); + var image = new PackedMemoryImage(width, height); for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) { - image[y, x] = new Argb8888( + image[x, y] = new Argb8888( a: 0xFF, r: 0x00, g: 0x00, @@ -158,15 +158,15 @@ private static MemoryImage GenerateXorImage(int width, int height) return image; } - private static MemoryImage GenerateTransformTable(int size) + private static PackedMemoryImage GenerateTransformTable(int size) { return GenerateTransformTable(size, size); } - private static MemoryImage GenerateTransformTable(int width, int height) + private static PackedMemoryImage GenerateTransformTable(int width, int height) { const double ratio = 32d; - var transformTable = new MemoryImage(width, height); + var transformTable = new PackedMemoryImage(width, height); for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) @@ -175,7 +175,7 @@ private static MemoryImage GenerateTransformTable(int width, int heig { var angle = (int)(0.5 * width * Atan2(y - height / 2.0, x - width / 2.0) / PI); var distance = (int)(ratio * height / Sqrt((x - width / 2d) * (x - width / 2d) + (y - height / 2d) * (y - height / 2d))) % height; - transformTable[y, x] = new Transform(angle, distance); + transformTable[x, y] = new Transform(angle, distance); } } } diff --git a/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs index 71b6202d..e967e9a9 100644 --- a/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs +++ b/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,9 +18,12 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; + namespace SDL2Sharp.Interop { [NativeTypeName("int")] + [Flags] public enum SDL_RendererFlags : uint { SDL_RENDERER_SOFTWARE = 0x00000001, diff --git a/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs index adadc839..26b1bbd5 100644 --- a/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs +++ b/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs index cee799a8..fd4f24ba 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.ABGR1555)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.ABGR1555)] public readonly record struct Abgr1555 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR1555); + private readonly ushort _value; - public byte A => (byte)(_value >> 15 & 0x1); + public static Abgr1555 FromRGB(byte r, byte g, byte b) + { + return new Abgr1555((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte B => (byte)(_value >> 10 & 0x1F); + public static Abgr1555 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Abgr1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + private Abgr1555(ushort value) + { + _value = value; + } - public byte R => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Abgr1555(byte a, byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((a & 0x1) << 15 | (b & 0x1F) << 10 | (g & 0x1F) << 5 | r & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs index f54df0a9..848d3a01 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.ABGR4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.ABGR4444)] public readonly record struct Abgr4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR4444); + private readonly ushort _value; - public byte A => (byte)(_value >> 12 & 0xF); + public static Abgr4444 FromRGB(byte r, byte g, byte b) + { + return new Abgr4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte B => (byte)(_value >> 8 & 0xF); + public static Abgr4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Abgr4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 4 & 0xF); + private Abgr4444(ushort value) + { + _value = value; + } - public byte R => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Abgr4444(byte a, byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((a & 0xF) << 12 | (b & 0xF) << 8 | (g & 0xF) << 4 | r & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs index 081254fd..7f3a9588 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,26 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.ABGR8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.ABGR8888)] public readonly record struct Abgr8888 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR8888); + private readonly uint _value; - public byte A => (byte)(_value >> 24 & 0xFF); + public static Abgr8888 FromRGB(byte r, byte g, byte b) + { + return new Abgr8888(_pixelFormat.MapRGB(r, g, b)); + } + + public static Abgr8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Abgr8888(_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte B => (byte)(_value >> 16 & 0xFF); + public Abgr8888(byte a, byte b, byte g, byte r) + : this(_pixelFormat.MapRGBA(r, g, b, a)) + { } - public byte G => (byte)(_value >> 8 & 0xFF); + private Abgr8888(uint value) + { + _value = value; + } - public byte R => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Abgr8888(byte a, byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(a << 24 | b << 16 | g << 8 | r); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb1555.cs b/sources/SDL2Sharp/Video/Colors/Argb1555.cs index e1bdede2..e45df234 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.ARGB1555)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.ARGB1555)] public readonly record struct Argb1555 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB1555); + private readonly ushort _value; - public byte A => (byte)(_value >> 15 & 0x1); + public static Argb1555 FromRGB(byte r, byte g, byte b) + { + return new Argb1555((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte R => (byte)(_value >> 10 & 0x1F); + public static Argb1555 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Argb1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + private Argb1555(ushort value) + { + _value = value; + } - public byte B => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Argb1555(byte a, byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((a & 0x1) << 15 | (r & 0x1F) << 10 | (g & 0x1F) << 5 | b & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs index b31c37c8..3130400a 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,26 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.ARGB2101010)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.ARGB2101010)] public readonly record struct Argb2101010 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB2101010); + private readonly uint _value; - public ushort A => (ushort)(_value >> 30 & 0x3); + public static Argb2101010 FromRGB(byte r, byte g, byte b) + { + return new Argb2101010(_pixelFormat.MapRGB(r, g, b)); + } - public ushort R => (ushort)(_value >> 20 & 0x3FF); + public static Argb2101010 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Argb2101010(_pixelFormat.MapRGBA(r, g, b, a)); + } - public ushort G => (ushort)(_value >> 10 & 0x3FF); + private Argb2101010(uint value) + { + _value = value; + } - public ushort B => (ushort)(_value & 0x3FF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Argb2101010(byte a, ushort r, ushort g, ushort b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(a << 30 & 0x3 | r << 20 & 0x3FF | g << 10 & 0x3FF | b & 0x3FF); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb4444.cs b/sources/SDL2Sharp/Video/Colors/Argb4444.cs index 9df10454..705b7cbe 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.ARGB4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.ARGB4444)] public readonly record struct Argb4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB4444); + private readonly ushort _value; - public byte A => (byte)(_value >> 12 & 0xF); + public static Argb4444 FromRGB(byte r, byte g, byte b) + { + return new Argb4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte R => (byte)(_value >> 8 & 0xF); + public static Argb4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Argb4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 4 & 0xF); + private Argb4444(ushort value) + { + _value = value; + } - public byte B => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Argb4444(byte a, byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((a & 0xF) << 12 | (r & 0xF) << 8 | (g & 0xF) << 4 | b & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb8888.cs b/sources/SDL2Sharp/Video/Colors/Argb8888.cs index df663166..23824542 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,26 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.ARGB8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.ARGB8888)] public readonly record struct Argb8888 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB8888); + private readonly uint _value; - public byte A => (byte)(_value >> 24 & 0xFF); + public static Argb8888 FromRGB(byte r, byte g, byte b) + { + return new Argb8888(_pixelFormat.MapRGB(r, g, b)); + } + + public static Argb8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Argb8888(_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte R => (byte)(_value >> 16 & 0xFF); + public Argb8888(byte a, byte r, byte g, byte b) + : this(_pixelFormat.MapRGBA(r, g, b, a)) + { } - public byte G => (byte)(_value >> 8 & 0xFF); + private Argb8888(uint value) + { + _value = value; + } - public byte B => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Argb8888(byte a, byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(a << 24 | r << 16 | g << 8 | b); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgr24.cs b/sources/SDL2Sharp/Video/Colors/Bgr24.cs index f0167e43..a1251cc0 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr24.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr24.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PackedColor(PackedPixelFormat.BGR24)] + [PixelFormat(PixelFormat.BGR24)] public readonly record struct Bgr24 { private readonly byte _r, _g, _b; diff --git a/sources/SDL2Sharp/Video/Colors/Bgr565.cs b/sources/SDL2Sharp/Video/Colors/Bgr565.cs index a8d3424b..21745d81 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr565.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.BGR565)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.BGR565)] public readonly record struct Bgr565 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGR565); + private readonly ushort _value; - public byte B => (byte)(_value >> 11 & 0x1F); + public static Bgr565 FromRGB(byte r, byte g, byte b) + { + return new Bgr565((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Bgr565 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Bgr565((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x3F); + private Bgr565(ushort value) + { + _value = value; + } - public byte R => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Bgr565(byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((b & 0x1F) << 11 | (g & 0x3F) << 5 | r & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs index 3370bb63..a95b9614 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.BGRA4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.BGRA4444)] public readonly record struct Bgra4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA4444); + private readonly ushort _value; - public byte B => (byte)(_value >> 12 & 0xF); + public static Bgra4444 FromRGB(byte r, byte g, byte b) + { + return new Bgra4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte G => (byte)(_value >> 8 & 0xF); + public static Bgra4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Bgra4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte R => (byte)(_value >> 4 & 0xF); + private Bgra4444(ushort value) + { + _value = value; + } - public byte A => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Bgra4444(byte b, byte g, byte r, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((b & 0xF) << 12 | (g & 0xF) << 8 | (r & 0xF) << 4 | a & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs index 8042b3c9..79472a89 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.BGRA5551)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.BGRA5551)] public readonly record struct Bgra5551 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA5551); + private readonly ushort _value; - public byte B => (byte)(_value >> 10 & 0x1F); + public static Bgra5551 FromRGB(byte r, byte g, byte b) + { + return new Bgra5551((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + public static Bgra5551 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Bgra5551((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte R => (byte)(_value >> 1 & 0x1F); + private Bgra5551(ushort value) + { + _value = value; + } - public byte A => (byte)(_value & 0x1); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Bgra5551(byte b, byte g, byte r, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((b & 0x1F) << 11 | (g & 0x1F) << 6 | (r & 0x1F) << 1 | a & 0x1); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs index 2aeaba3f..0b4aa613 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,26 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.BGRA8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.BGRA8888)] public readonly record struct Bgra8888 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA8888); + private readonly uint _value; - public byte B => (byte)(_value >> 24 & 0xFF); + public static Bgra8888 FromRGBA(byte r, byte g, byte b) + { + return new Bgra8888(_pixelFormat.MapRGB(r, g, b)); + } + + public static Bgra8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Bgra8888(_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 16 & 0xFF); + public Bgra8888(byte b, byte g, byte r, byte a) + : this(_pixelFormat.MapRGBA(r, g, b, a)) + { } - public byte R => (byte)(_value >> 8 & 0xFF); + private Bgra8888(uint value) + { + _value = value; + } - public byte A => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Bgra8888(byte b, byte g, byte r, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(b << 24 | g << 16 | r << 8 | a); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs index 0fd5037c..25ac952d 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,24 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.BGRX8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.BGRX8888)] public readonly record struct Bgrx8888 { - private readonly uint _value; + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRX8888); - public byte B => (byte)(_value >> 24 & 0xFF); + private readonly uint _value; - public byte G => (byte)(_value >> 16 & 0xFF); + public static Bgrx8888 FromRGB(byte r, byte g, byte b) + { + return new Bgrx8888(_pixelFormat.MapRGB(r, g, b)); + } - public byte R => (byte)(_value >> 8 & 0xFF); + public static Bgrx8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Bgrx8888(_pixelFormat.MapRGBA(r, g, b, a)); + } public Bgrx8888(byte b, byte g, byte r) + : this(_pixelFormat.MapRGB(r, g, b)) + { } + + private Bgrx8888(uint value) + { + _value = value; + } + + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } + + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(b << 24 | g << 16 | r << 8); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb24.cs b/sources/SDL2Sharp/Video/Colors/Rgb24.cs index 529d17ea..d722562c 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb24.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb24.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PackedColor(PackedPixelFormat.RGB24)] + [PixelFormat(PixelFormat.RGB24)] public readonly record struct Rgb24 { private readonly byte _b, _g, _r; diff --git a/sources/SDL2Sharp/Video/Colors/Rgb332.cs b/sources/SDL2Sharp/Video/Colors/Rgb332.cs index 976b11ab..26fabc4b 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb332.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb332.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -23,20 +23,36 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PackedColor(PackedPixelFormat.RGB332)] + [PixelFormat(PixelFormat.RGB332)] public readonly record struct Rgb332 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGB332); + private readonly byte _value; - public byte R => (byte)(_value >> 5 & 0x7); + public static Rgb332 FromRGB(byte r, byte g, byte b) + { + return new Rgb332((byte)_pixelFormat.MapRGB(r, g, b)); + } + + public static Rgb332 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgb332((byte)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 2 & 0x7); + private Rgb332(byte value) + { + _value = value; + } - public byte B => (byte)(_value & 0x3); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Rgb332(byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (byte)((r & 0x7) << 5 | (g & 0x7) << 2 | b & 0x3); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb565.cs b/sources/SDL2Sharp/Video/Colors/Rgb565.cs index 9afbe744..a8a6fe09 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb565.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.RGB565)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.RGB565)] public readonly record struct Rgb565 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGB565); + private readonly ushort _value; - public byte R => (byte)(_value >> 11 & 0x1F); + public static Rgb565 FromRGB(byte r, byte g, byte b) + { + return new Rgb565((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Rgb565 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgb565((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x3F); + private Rgb565(ushort value) + { + _value = value; + } - public byte B => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Rgb565(byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((r & 0x1F) << 11 | (g & 0x3F) << 5 | b & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb32f.cs b/sources/SDL2Sharp/Video/Colors/Rgb96f.cs similarity index 68% rename from sources/SDL2Sharp/Video/Colors/Rgb32f.cs rename to sources/SDL2Sharp/Video/Colors/Rgb96f.cs index eb88fc26..75eea769 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb32f.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb96f.cs @@ -26,11 +26,11 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] - public readonly struct Rgb32f : IEquatable + public readonly struct Rgb96f : IEquatable { - public static Rgb32f Black { get; } = new Rgb32f(0f, 0f, 0f); + public static Rgb96f Black { get; } = new Rgb96f(0f, 0f, 0f); - public static Rgb32f White { get; } = new Rgb32f(1f, 1f, 1f); + public static Rgb96f White { get; } = new Rgb96f(1f, 1f, 1f); private readonly Vector3 _components; @@ -62,23 +62,23 @@ public float B } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgb32f(float r, float g, float b) + public Rgb96f(float r, float g, float b) : this(new Vector3(r, g, b)) { } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgb32f(Rgb32f other) + public Rgb96f(Rgb96f other) : this(other._components) { } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private Rgb32f(Vector3 components) + private Rgb96f(Vector3 components) { _components = components; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rgb32f other) + public readonly bool Equals(Rgb96f other) { return _components.Equals(other._components); } @@ -86,7 +86,7 @@ public readonly bool Equals(Rgb32f other) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override readonly bool Equals(object? obj) { - if (obj is Rgb32f other) + if (obj is Rgb96f other) { return Equals(other); } @@ -99,127 +99,127 @@ public override readonly int GetHashCode() } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Negate(Rgb32f value) + public static Rgb96f Negate(Rgb96f value) { - return new Rgb32f(-value._components); + return new Rgb96f(-value._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Add(Rgb32f left, Rgb32f right) + public static Rgb96f Add(Rgb96f left, Rgb96f right) { - return new Rgb32f(left._components + right._components); + return new Rgb96f(left._components + right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Subtract(Rgb32f left, Rgb32f right) + public static Rgb96f Subtract(Rgb96f left, Rgb96f right) { - return new Rgb32f(left._components - right._components); + return new Rgb96f(left._components - right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Multiply(float left, Rgb32f right) + public static Rgb96f Multiply(float left, Rgb96f right) { - return new Rgb32f(left * right._components); + return new Rgb96f(left * right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Multiply(Rgb32f left, float right) + public static Rgb96f Multiply(Rgb96f left, float right) { - return new Rgb32f(left._components * right); + return new Rgb96f(left._components * right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Multiply(Rgb32f left, Rgb32f right) + public static Rgb96f Multiply(Rgb96f left, Rgb96f right) { - return new Rgb32f(left._components * right._components); + return new Rgb96f(left._components * right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Divide(Rgb32f left, Rgb32f right) + public static Rgb96f Divide(Rgb96f left, Rgb96f right) { - return new Rgb32f(left._components / right._components); + return new Rgb96f(left._components / right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Divide(Rgb32f left, float right) + public static Rgb96f Divide(Rgb96f left, float right) { - return new Rgb32f(left._components / right); + return new Rgb96f(left._components / right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Clamp(Rgb32f value, Rgb32f min, Rgb32f max) + public static Rgb96f Clamp(Rgb96f value, Rgb96f min, Rgb96f max) { - return new Rgb32f(Vector3.Clamp(value._components, min._components, max._components)); + return new Rgb96f(Vector3.Clamp(value._components, min._components, max._components)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f Clamp(Rgb32f value) + public static Rgb96f Clamp(Rgb96f value) { return Clamp(value, Black, White); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator +(Rgb32f value) + public static Rgb96f operator +(Rgb96f value) { return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator -(Rgb32f value) + public static Rgb96f operator -(Rgb96f value) { return Negate(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator +(Rgb32f left, Rgb32f right) + public static Rgb96f operator +(Rgb96f left, Rgb96f right) { return Add(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator -(Rgb32f left, Rgb32f right) + public static Rgb96f operator -(Rgb96f left, Rgb96f right) { return Subtract(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator *(float left, Rgb32f right) + public static Rgb96f operator *(float left, Rgb96f right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator *(Rgb32f left, float right) + public static Rgb96f operator *(Rgb96f left, float right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator *(Rgb32f left, Rgb32f right) + public static Rgb96f operator *(Rgb96f left, Rgb96f right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator /(Rgb32f left, Rgb32f right) + public static Rgb96f operator /(Rgb96f left, Rgb96f right) { return Divide(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb32f operator /(Rgb32f left, float right) + public static Rgb96f operator /(Rgb96f left, float right) { return Divide(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rgb32f left, Rgb32f right) + public static bool operator ==(Rgb96f left, Rgb96f right) { return left.Equals(right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rgb32f left, Rgb32f right) + public static bool operator !=(Rgb96f left, Rgb96f right) { return !left.Equals(right); } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs b/sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs similarity index 82% rename from sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs rename to sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs index ccad5a84..57aecc1f 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb32fExtensions.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,11 +22,11 @@ namespace SDL2Sharp.Video.Colors { - public static class Rgb32fExtensions + public static class Rgb96fExtensions { - public static Color ToColor(this Rgb32f color) + public static Color ToColor(this Rgb96f color) { - var clampedColor = Rgb32f.Clamp(color); + var clampedColor = Rgb96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); @@ -34,9 +34,9 @@ public static Color ToColor(this Rgb32f color) return new Color(r, g, b, 255); } - public static Rgba8888 ToRgba8888(this Rgb32f color) + public static Rgba8888 ToRgba8888(this Rgb96f color) { - var clampedColor = Rgb32f.Clamp(color); + var clampedColor = Rgb96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); @@ -44,9 +44,9 @@ public static Rgba8888 ToRgba8888(this Rgb32f color) return new Rgba8888(r, g, b, 255); } - public static Argb8888 ToArgb8888(this Rgb32f color) + public static Argb8888 ToArgb8888(this Rgb96f color) { - var clampedColor = Rgb32f.Clamp(color); + var clampedColor = Rgb96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); diff --git a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs index 4b535123..3a6d2f51 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.RGBA4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.RGBA4444)] public readonly record struct Rgba4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA4444); + private readonly ushort _value; - public byte R => (byte)(_value >> 12 & 0xF); + public static Rgba4444 FromRGB(byte r, byte g, byte b) + { + return new Rgba4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte G => (byte)(_value >> 8 & 0xF); + public static Rgba4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgba4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte B => (byte)(_value >> 4 & 0xF); + private Rgba4444(ushort value) + { + _value = value; + } - public byte A => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Rgba4444(byte r, byte g, byte b, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((r & 0xF) << 12 | (g & 0xF) << 8 | (b & 0xF) << 4 | a & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs index e3016454..a4a12290 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,23 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.RGBA5551)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.RGBA5551)] public readonly record struct Rgba5551 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA5551); + private readonly ushort _value; - public byte R => (byte)(_value >> 10 & 0x1F); + public static Rgba5551 FromRGB(byte r, byte g, byte b) + { + return new Rgba5551((ushort)_pixelFormat.MapRGB(r, g, b)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + public static Rgba5551 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgba5551((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte B => (byte)(_value >> 1 & 0x1F); + private Rgba5551(ushort value) + { + _value = value; + } - public byte A => (byte)(_value & 0x1); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Rgba5551(byte r, byte g, byte b, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((r & 0x1F) << 11 | (g & 0x1F) << 6 | (b & 0x1F) << 1 | a & 0x1); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs index e0faa8c5..30b2f819 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,26 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.RGBA8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.RGBA8888)] public readonly record struct Rgba8888 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA8888); + private readonly uint _value; - public byte R => (byte)(_value >> 24 & 0xFF); + public static Rgba8888 FromRGB(byte r, byte g, byte b) + { + return new Rgba8888(_pixelFormat.MapRGB(r, g, b)); + } + + public static Rgba8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgba8888(_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 16 & 0xFF); + public Rgba8888(byte r, byte g, byte b, byte a) + : this(_pixelFormat.MapRGBA(r, g, b, a)) + { } - public byte B => (byte)(_value >> 8 & 0xFF); + private Rgba8888(uint value) + { + _value = value; + } - public byte A => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Rgba8888(byte r, byte g, byte b, byte a) + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(r << 24 | g << 16 | b << 8 | a); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs index 77b10d63..566b1a10 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,24 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.RGBX8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.RGBX8888)] public readonly record struct Rgbx8888 { - private readonly uint _value; + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBX8888); - public byte R => (byte)(_value >> 24 & 0xFF); + private readonly uint _value; - public byte G => (byte)(_value >> 16 & 0xFF); + public static Rgbx8888 FromRGB(byte r, byte g, byte b) + { + return new Rgbx8888(_pixelFormat.MapRGB(r, g, b)); + } - public byte B => (byte)(_value >> 8 & 0xFF); + public static Rgbx8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Rgbx8888(_pixelFormat.MapRGBA(r, g, b, a)); + } public Rgbx8888(byte r, byte g, byte b) + : this(_pixelFormat.MapRGB(r, g, b)) + { } + + private Rgbx8888(uint value) + { + _value = value; + } + + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } + + public (byte r, byte g, byte b, byte a) ToRGBA() { - unchecked - { - _value = (uint)(r << 24 | g << 16 | b << 8); - } + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs b/sources/SDL2Sharp/Video/Colors/U8.cs similarity index 74% rename from sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs rename to sources/SDL2Sharp/Video/Colors/U8.cs index 08094c4e..e3746da1 100644 --- a/sources/SDL2Sharp/Video/WithLockSurfaceCallback.cs +++ b/sources/SDL2Sharp/Video/Colors/U8.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,10 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video.Colors { - public delegate void WithLockSurfaceCallback(Surface pixels); + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + public readonly record struct U8 + { + private readonly byte _value; - public delegate void WithLockSurfaceCallback(Surface pixels) - where TPackedColor : struct; + public U8(byte value) + { + _value = value; + } + } } diff --git a/sources/SDL2Sharp/Video/Colors/UV88.cs b/sources/SDL2Sharp/Video/Colors/UV88.cs new file mode 100644 index 00000000..208ffe23 --- /dev/null +++ b/sources/SDL2Sharp/Video/Colors/UV88.cs @@ -0,0 +1,42 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video.Colors +{ + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + public readonly record struct UV88 + { + private readonly ushort _value; + + public byte U => (byte)(_value >> 8 & 0xFF); + + public byte V => (byte)(_value & 0xFF); + + public UV88(byte u, byte v) + { + unchecked + { + _value = (ushort)(u << 8 | v); + } + } + } +} diff --git a/sources/SDL2Sharp/Video/Colors/Uyvy.cs b/sources/SDL2Sharp/Video/Colors/Uyvy.cs index cce4229f..11b3219a 100644 --- a/sources/SDL2Sharp/Video/Colors/Uyvy.cs +++ b/sources/SDL2Sharp/Video/Colors/Uyvy.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,25 +22,25 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.UYVY)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.UYVY)] public readonly record struct Uyvy { private readonly uint _value; - public byte U0 => (byte)(_value >> 24 & 0xFF); + public byte U0 => (byte)(_value & 0xFF); - public byte Y0 => (byte)(_value >> 16 & 0xFF); + public byte Y0 => (byte)(_value >> 8 & 0xFF); - public byte V0 => (byte)(_value >> 8 & 0xFF); + public byte V0 => (byte)(_value >> 16 & 0xFF); - public byte Y1 => (byte)(_value & 0xFF); + public byte Y1 => (byte)(_value >> 24 & 0xFF); public Uyvy(byte u0, byte y0, byte v0, byte y1) { unchecked { - _value = (uint)(u0 << 24 | y0 << 16 | v0 << 8 | y1); + _value = (uint)(u0 | y0 << 8 | v0 << 16 | y1 << 24); } } } diff --git a/sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs b/sources/SDL2Sharp/Video/Colors/V8.cs similarity index 74% rename from sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs rename to sources/SDL2Sharp/Video/Colors/V8.cs index 32b3b5f2..d0887675 100644 --- a/sources/SDL2Sharp/Video/WithLockNv12ImageCallback.cs +++ b/sources/SDL2Sharp/Video/Colors/V8.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video.Colors { - public delegate void WithLockNv12ImageCallback(Nv12Image pixels); + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + public readonly record struct V8 + { + private readonly byte _value; + + public V8(byte value) + { + _value = value; + } + } } diff --git a/sources/SDL2Sharp/Video/Colors/VU88.cs b/sources/SDL2Sharp/Video/Colors/VU88.cs new file mode 100644 index 00000000..681e0548 --- /dev/null +++ b/sources/SDL2Sharp/Video/Colors/VU88.cs @@ -0,0 +1,42 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video.Colors +{ + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + public readonly record struct VU88 + { + private readonly ushort _value; + + public byte V => (byte)(_value >> 8 & 0xFF); + + public byte U => (byte)(_value & 0xFF); + + public VU88(byte v, byte u) + { + unchecked + { + _value = (ushort)(v << 8 | u); + } + } + } +} diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs index d40fe1bc..6954c11b 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.XBGR1555)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.XBGR1555)] public readonly record struct Xbgr1555 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR1555); + private readonly ushort _value; - public byte B => (byte)(_value >> 10 & 0x1F); + public static Xbgr1555 FromRGB(byte r, byte g, byte b) + { + return new Xbgr1555((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Xbgr1555 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xbgr1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + private Xbgr1555(ushort value) + { + _value = value; + } - public byte R => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Xbgr1555(byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((b & 0x1F) << 10 | (g & 0x1F) << 5 | r & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs index 6a44337b..78b064ba 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.XBGR4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.XBGR4444)] public readonly record struct Xbgr4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR4444); + private readonly ushort _value; - public byte B => (byte)(_value >> 8 & 0xF); + public static Xbgr4444 FromRGB(byte r, byte g, byte b) + { + return new Xbgr4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Xbgr4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xbgr4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 4 & 0xF); + private Xbgr4444(ushort value) + { + _value = value; + } - public byte R => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Xbgr4444(byte b, byte g, byte r) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((b & 0xF) << 8 | (g & 0xF) << 4 | r & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs index cb26763b..077a9153 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.XBGR8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.XBGR8888)] public readonly record struct Xbgr8888 { - private readonly uint _value; + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR8888); - public byte B => (byte)(_value >> 16 & 0xFF); + private readonly uint _value; - public byte G => (byte)(_value >> 8 & 0xFF); + public static Xbgr8888 FromRGB(byte r, byte g, byte b) + { + return new Xbgr8888(_pixelFormat.MapRGB(r, g, b)); + } - public byte R => (byte)(_value & 0xFF); + public static Xbgr8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xbgr8888(_pixelFormat.MapRGBA(r, g, b, a)); + } public Xbgr8888(byte b, byte g, byte r) + : this(_pixelFormat.MapRGB(r, g, b)) + { } + + private Xbgr8888(uint value) + { + _value = value; + } + + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } + + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (uint)(b << 16 | g << 8 | r); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs index 99d8dbfe..4b723794 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.XRGB1555)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.XRGB1555)] public readonly record struct Xrgb1555 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB1555); + private readonly ushort _value; - public byte R => (byte)(_value >> 10 & 0x1F); + public static Xrgb1555 FromRGB(byte r, byte g, byte b) + { + return new Xrgb1555((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Xrgb1555 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xrgb1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 5 & 0x1F); + private Xrgb1555(ushort value) + { + _value = value; + } - public byte B => (byte)(_value & 0x1F); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Xrgb1555(byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((r & 0x1F) << 10 | (g & 0x1F) << 5 | b & 0x1F); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs index 17905221..806ffdb9 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,37 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 2)] - [PackedColor(PackedPixelFormat.XRGB4444)] + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] + [PixelFormat(PixelFormat.XRGB4444)] public readonly record struct Xrgb4444 { + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB4444); + private readonly ushort _value; - public byte R => (byte)(_value >> 8 & 0xF); + public static Xrgb4444 FromRGB(byte r, byte g, byte b) + { + return new Xrgb4444((ushort)_pixelFormat.MapRGB(r, g, b)); + } + + public static Xrgb4444 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xrgb4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + } - public byte G => (byte)(_value >> 4 & 0xF); + private Xrgb4444(ushort value) + { + _value = value; + } - public byte B => (byte)(_value & 0xFF); + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } - public Xrgb4444(byte r, byte g, byte b) + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (ushort)((r & 0xF) << 8 | (g & 0xF) << 4 | b & 0xF); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs index 3f1a8b10..a54baffd 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,21 +22,41 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.XRGB8888)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.XRGB8888)] public readonly record struct Xrgb8888 { - private readonly uint _value; + private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB8888); - public byte R => (byte)(_value >> 16 & 0xFF); + private readonly uint _value; - public byte G => (byte)(_value >> 8 & 0xFF); + public static Xrgb8888 FromRGB(byte r, byte g, byte b) + { + return new Xrgb8888(_pixelFormat.MapRGB(r, g, b)); + } - public byte B => (byte)(_value & 0xFF); + public static Xrgb8888 FromRGBA(byte r, byte g, byte b, byte a) + { + return new Xrgb8888(_pixelFormat.MapRGBA(r, g, b, a)); + } public Xrgb8888(byte r, byte g, byte b) + : this(_pixelFormat.MapRGB(r, g, b)) + { } + + private Xrgb8888(uint value) + { + _value = value; + } + + public (byte r, byte g, byte b) ToRGB() + { + return _pixelFormat.GetRGB(_value); + } + + public (byte r, byte g, byte b, byte a) ToRGBA() { - _value = (uint)(r << 16 | g << 8 | b); + return _pixelFormat.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs b/sources/SDL2Sharp/Video/Colors/Y8.cs similarity index 74% rename from sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs rename to sources/SDL2Sharp/Video/Colors/Y8.cs index b577af31..32292e7e 100644 --- a/sources/SDL2Sharp/Video/WithLockNv21ImageCallback.cs +++ b/sources/SDL2Sharp/Video/Colors/Y8.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Video.Colors { - public delegate void WithLockNv21ImageCallback(Nv21Image pixels); + [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] + public readonly record struct Y8 + { + private readonly byte _value; + + public Y8(byte value) + { + _value = value; + } + } } diff --git a/sources/SDL2Sharp/Video/Colors/Yuy2.cs b/sources/SDL2Sharp/Video/Colors/Yuy2.cs index 56df5d8c..78e099c4 100644 --- a/sources/SDL2Sharp/Video/Colors/Yuy2.cs +++ b/sources/SDL2Sharp/Video/Colors/Yuy2.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,25 +22,25 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.YUY2)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.YUY2)] public readonly record struct Yuy2 { private readonly uint _value; - public byte Y0 => (byte)(_value >> 24 & 0xFF); + public byte Y0 => (byte)(_value & 0xFF); - public byte U0 => (byte)(_value >> 16 & 0xFF); + public byte U0 => (byte)(_value >> 8 & 0xFF); - public byte Y1 => (byte)(_value >> 8 & 0xFF); + public byte Y1 => (byte)(_value >> 16 & 0xFF); - public byte V0 => (byte)(_value & 0xFF); + public byte V0 => (byte)(_value >> 24 & 0xFF); public Yuy2(byte y0, byte u0, byte y1, byte v0) { unchecked { - _value = (uint)(y0 << 24 | u0 << 16 | y1 << 8 | v0); + _value = (uint)(y0 | u0 << 8 | y1 << 16 | v0 << 24); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Yvyu.cs b/sources/SDL2Sharp/Video/Colors/Yvyu.cs index 8f4d9d04..93072d04 100644 --- a/sources/SDL2Sharp/Video/Colors/Yvyu.cs +++ b/sources/SDL2Sharp/Video/Colors/Yvyu.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,25 +22,25 @@ namespace SDL2Sharp.Video.Colors { - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 4)] - [PackedColor(PackedPixelFormat.YVYU)] + [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] + [PixelFormat(PixelFormat.YVYU)] public readonly record struct Yvyu { private readonly uint _value; - public byte Y0 => (byte)(_value >> 24 & 0xFF); + public byte Y0 => (byte)(_value & 0xFF); - public byte V0 => (byte)(_value >> 16 & 0xFF); + public byte V0 => (byte)(_value >> 8 & 0xFF); - public byte Y1 => (byte)(_value >> 8 & 0xFF); + public byte Y1 => (byte)(_value >> 16 & 0xFF); - public byte U0 => (byte)(_value & 0xFF); + public byte U0 => (byte)(_value >> 24 & 0xFF); public Yvyu(byte y0, byte v0, byte y1, byte u0) { unchecked { - _value = (uint)(y0 << 24 | v0 << 16 | y1 << 8 | u0); + _value = (uint)(y0 | v0 << 8 | y1 << 16 | u0 << 24); } } } diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/Video/Display.cs index 05ecfc69..2b03a971 100644 --- a/sources/SDL2Sharp/Video/Display.cs +++ b/sources/SDL2Sharp/Video/Display.cs @@ -60,7 +60,7 @@ public DisplayMode CurrentMode SDL.GetCurrentDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( - (PixelFormatEnum)displayMode.format, + (PixelFormat)displayMode.format, displayMode.w, displayMode.h, displayMode.refresh_rate); @@ -76,7 +76,7 @@ public DisplayMode DesktopMode SDL.GetDesktopDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( - (PixelFormatEnum)displayMode.format, + (PixelFormat)displayMode.format, displayMode.w, displayMode.h, displayMode.refresh_rate); @@ -96,7 +96,7 @@ public IReadOnlyList Modes SDL.GetDisplayMode(_displayIndex, modeIndex, &displayMode) ); modes.Add(new DisplayMode( - (PixelFormatEnum)displayMode.format, + (PixelFormat)displayMode.format, displayMode.w, displayMode.h, displayMode.refresh_rate)); diff --git a/sources/SDL2Sharp/Video/DisplayMode.cs b/sources/SDL2Sharp/Video/DisplayMode.cs index a4cdee2d..96572ac6 100644 --- a/sources/SDL2Sharp/Video/DisplayMode.cs +++ b/sources/SDL2Sharp/Video/DisplayMode.cs @@ -22,7 +22,7 @@ namespace SDL2Sharp.Video { public sealed class DisplayMode { - public PixelFormatEnum Format { get; } + public PixelFormat Format { get; } public int Width { get; } @@ -30,7 +30,7 @@ public sealed class DisplayMode public int RefreshRate { get; } - public DisplayMode(PixelFormatEnum format, int width, int height, int refreshRate) + public DisplayMode(PixelFormat format, int width, int height, int refreshRate) { Format = format; Width = width; diff --git a/sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs b/sources/SDL2Sharp/Video/IYuvFormat.cs similarity index 57% rename from sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs rename to sources/SDL2Sharp/Video/IYuvFormat.cs index 398f39f0..a14cf8b5 100644 --- a/sources/SDL2Sharp/Video/WithLockPackedImageCallback.cs +++ b/sources/SDL2Sharp/Video/IYuvFormat.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,6 +20,19 @@ namespace SDL2Sharp.Video { - public delegate void WithLockPackedImageCallback(PackedImage pixels) - where TPackedColor : struct; + public interface IYuvPixelFormat + { + int GetYPlaneWidth(int imageWidth); + int GetYPlaneHeight(int imageHeight); + int GetYPlanePitch(int imagePitch); + int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + int GetUPlaneWidth(int imageWidth); + int GetUPlaneHeight(int imageHeight); + int GetUPlanePitch(int imagePitch); + int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + int GetVPlaneWidth(int imageWidth); + int GetVPlaneHeight(int imageHeight); + int GetVPlanePitch(int imagePitch); + int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + } } diff --git a/sources/SDL2Sharp/Video/MemoryImage.cs b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs similarity index 80% rename from sources/SDL2Sharp/Video/MemoryImage.cs rename to sources/SDL2Sharp/Video/ImageMemoryPlane.cs index bcd8d724..8febcf01 100644 --- a/sources/SDL2Sharp/Video/MemoryImage.cs +++ b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -23,19 +23,21 @@ namespace SDL2Sharp.Video { - public sealed class MemoryImage where TColor : struct + public sealed class ImageMemoryPlane where TPackedPixelFormat : struct { + private readonly int _width; + private readonly int _height; - private readonly int _width; + private readonly TPackedPixelFormat[] _pixels; - private readonly TColor[] _pixels; + public int Width => _width; public int Height => _height; - public int Width => _width; + public Size Size => new(_width, _height); - public TColor this[int y, int x] + public TPackedPixelFormat this[int x, int y] { get { @@ -47,14 +49,14 @@ public sealed class MemoryImage where TColor : struct } } - public MemoryImage(int width, int height) + public ImageMemoryPlane(int width, int height) { if (width <= 0) { throw new ArgumentOutOfRangeException( nameof(width), width, - "The width of the image must be a positive integer."); + "The width of the image plane must be a positive integer."); } if (height <= 0) @@ -62,19 +64,19 @@ public MemoryImage(int width, int height) throw new ArgumentOutOfRangeException( nameof(height), height, - "The height of the image must be a positive integer."); + "The height of the image plane must be a positive integer."); } _width = width; _height = height; - _pixels = new TColor[_height * _width]; + _pixels = new TPackedPixelFormat[_height * _width]; } - public MemoryImage(Size size) + public ImageMemoryPlane(Size size) : this(size.Width, size.Height) { } - public MemoryImage Crop(int top, int left, int bottom, int right) + public ImageMemoryPlane Crop(int top, int left, int bottom, int right) { if (top < 0) { @@ -124,18 +126,18 @@ public MemoryImage Crop(int top, int left, int bottom, int right) "The right of the crop rectangle cannot be less than or equal to the left of the crop rectangle."); } - var croppedImage = new MemoryImage(right - left, bottom - top); + var croppedImage = new ImageMemoryPlane(right - left, bottom - top); for (var y = 0; y < croppedImage.Height; ++y) { for (var x = 0; x < croppedImage.Width; ++x) { - croppedImage[y, x] = this[y + top, x + left]; + croppedImage[x, y] = this[x + left, y + top]; } } return croppedImage; } - public ref TColor DangerousGetReference() + public ref TPackedPixelFormat DangerousGetReference() { return ref _pixels.DangerousGetReference(); } diff --git a/sources/SDL2Sharp/Video/ColorPlane.cs b/sources/SDL2Sharp/Video/ImagePlane.cs similarity index 66% rename from sources/SDL2Sharp/Video/ColorPlane.cs rename to sources/SDL2Sharp/Video/ImagePlane.cs index 9359a191..eda497e2 100644 --- a/sources/SDL2Sharp/Video/ColorPlane.cs +++ b/sources/SDL2Sharp/Video/ImagePlane.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -25,17 +25,15 @@ namespace SDL2Sharp.Video { - public readonly ref struct ColorPlane + public readonly ref struct ImagePlane where TPackedPixelFormat : struct { - private readonly Span _pixels; - - private readonly int _height; + private readonly Span _pixels; private readonly int _width; - private readonly int _pitch; + private readonly int _height; - private readonly int _offset; + private readonly int _pitch; public readonly int Width { @@ -49,48 +47,54 @@ public readonly int Height get => _height; } - public ref byte this[int row, int column] + public Size Size + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(_width, _height); + } + + public ref TPackedPixelFormat this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (row < 0) + if (x < 0) { throw new ArgumentOutOfRangeException( - nameof(row), - row, - "row cannot be less than zero"); + nameof(x), + x, + "x cannot be less than zero"); } - if (row >= _height) + if (x >= _width) { throw new ArgumentOutOfRangeException( - nameof(column), - column, - "row cannot be greater than or equal to the height of the image"); + nameof(x), + x, + "x cannot be greater than or equal to the width of the image"); } - if (column < 0) + if (y < 0) { throw new ArgumentOutOfRangeException( - nameof(column), - column, - "column cannot be less than zero"); + nameof(y), + y, + "y cannot be less than zero"); } - if (column >= _width) + if (y >= _height) { throw new ArgumentOutOfRangeException( - nameof(column), - column, - "column cannot be greater than or equal to the width of the image"); + nameof(x), + x, + "y cannot be greater than or equal to the height of the image"); } - return ref DangerousGetReferenceAt(row, column); + return ref DangerousGetReferenceAt(x, y); } } - public unsafe ColorPlane(void* pixels, int height, int width, int pitch, int offset) + public unsafe ImagePlane(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -116,40 +120,32 @@ public unsafe ColorPlane(void* pixels, int height, int width, int pitch, int off "pitch cannot be less than zero"); } - if (_offset < 0) - { - throw new ArgumentOutOfRangeException( - nameof(offset), - offset, - "offset cannot be less than zero"); - } - - _pixels = new Span(pixels, height * pitch); + _pixels = new Span(pixels, height * pitch); _height = height; _width = width; _pitch = pitch; - _offset = offset; } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ref byte DangerousGetReference() + public readonly ref TPackedPixelFormat DangerousGetReference() { ref var r0 = ref MemoryMarshal.GetReference(_pixels); - return ref Unsafe.Add(ref r0, _offset); + const int index = 0; + return ref Unsafe.Add(ref r0, index); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ref byte DangerousGetReferenceAt(int row, int column) + public readonly ref TPackedPixelFormat DangerousGetReferenceAt(int x, int y) { ref var r0 = ref MemoryMarshal.GetReference(_pixels); - var index = row * _pitch + column + _offset; + var index = y * _pitch + x; return ref Unsafe.Add(ref r0, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly void Fill(byte value) + public readonly void Fill(TPackedPixelFormat value) { _pixels.Fill(value); } diff --git a/sources/SDL2Sharp/Video/Iyuv.cs b/sources/SDL2Sharp/Video/Iyuv.cs new file mode 100644 index 00000000..0096104e --- /dev/null +++ b/sources/SDL2Sharp/Video/Iyuv.cs @@ -0,0 +1,88 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + [PixelFormat(PixelFormat.IYUV)] + public readonly struct Iyuv : IYuvPixelFormat + { + public int GetYPlaneWidth(int imageWidth) + { + return imageWidth; + } + + public int GetYPlaneHeight(int imageHeight) + { + return imageHeight; + } + + public int GetYPlanePitch(int imagePitch) + { + return imagePitch; + } + + public int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return 0; + } + + public int GetUPlaneWidth(int imageWidth) + { + return GetYPlaneWidth(imageWidth) / 2; + } + + public int GetUPlaneHeight(int imageHeight) + { + return GetYPlaneHeight(imageHeight) / 2; + } + + public int GetUPlanePitch(int imagePitch) + { + return GetYPlanePitch(imagePitch) / 2; + } + + public int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) + + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); + } + + public int GetVPlaneWidth(int imageWidth) + { + return GetUPlaneHeight(imageWidth); + } + + public int GetVPlaneHeight(int imageHeight) + { + return GetUPlaneHeight(imageHeight); + } + + public int GetVPlanePitch(int imagePitch) + { + return GetUPlaneHeight(imagePitch); + } + + public int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return GetUPlaneOffset(imageWidth, imageHeight, imagePitch) + + GetUPlaneHeight(imageHeight) * GetUPlanePitch(imagePitch); + } + } +} diff --git a/sources/SDL2Sharp/Video/IyuvTexture.cs b/sources/SDL2Sharp/Video/IyuvTexture.cs deleted file mode 100644 index e147357b..00000000 --- a/sources/SDL2Sharp/Video/IyuvTexture.cs +++ /dev/null @@ -1,102 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; - -namespace SDL2Sharp.Video -{ - public sealed unsafe partial class IyuvTexture : IDisposable - { - private Texture _texture; - - public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; - - public TextureAccess Access => _texture.Access; - - public int Width => _texture.Width; - - public int Height => _texture.Height; - - public BlendMode BlendMode - { - get => _texture.BlendMode; - - set => _texture.BlendMode = value; - } - - public bool IsValid => _texture.IsValid; - - internal IyuvTexture(Texture texture) - { - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); - } - - ~IyuvTexture() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) - { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; - } - - // public void WithLock(WithLockIyuvImageCallback callback) - // { - // WithLock(0, 0, Width, Height, callback); - // } - - // public void WithLock(Rectangle rectangle, WithLockIyuvImageCallback callback) - // { - // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - // } - - // public void WithLock(int x, int y, int width, int height, WithLockIyuvImageCallback callback) - // { - // _texture.WithLock(x, y, width, height, callback); - // } - - private void ThrowWhenDisposed() - { - if (_texture is null) - { - throw new ObjectDisposedException(GetType().FullName); - } - } - - public static implicit operator Texture(IyuvTexture texture) - { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } - - return texture._texture; - } - } -} diff --git a/sources/SDL2Sharp/Video/Nv12Image.cs b/sources/SDL2Sharp/Video/Nv12Image.cs index 9958b641..54db3bb9 100644 --- a/sources/SDL2Sharp/Video/Nv12Image.cs +++ b/sources/SDL2Sharp/Video/Nv12Image.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,32 +20,33 @@ using System; using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { public readonly ref struct Nv12Image { - private readonly ColorPlane _yPlane; + private readonly ImagePlane _yPlane; - private readonly ColorPlane _uvPlane; + private readonly ImagePlane _uvPlane; - private readonly int _height; + public ImagePlane Y => _yPlane; - private readonly int _width; + public ImagePlane UV => _uvPlane; public readonly int Width { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _width; + get => _yPlane.Width; } public readonly int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _height; + get => _yPlane.Height; } - public unsafe Nv12Image(void* pixels, int height, int width, int pitch) + public unsafe Nv12Image(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -71,14 +72,9 @@ public unsafe Nv12Image(void* pixels, int height, int width, int pitch) "pitch cannot be less than zero"); } - _yPlane = new ColorPlane(pixels, height, width, pitch, 0); - _uvPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); - _height = height; - _width = width; + _yPlane = new ImagePlane(pixels, width, height, pitch); + var uPlanePixels = Unsafe.Add(pixels, height * pitch); + _uvPlane = new ImagePlane(uPlanePixels, width / 2, height / 2, pitch / 2); } - - public ColorPlane Y => _yPlane; - - public ColorPlane UV => _uvPlane; } } diff --git a/sources/SDL2Sharp/Video/Yv12Image.cs b/sources/SDL2Sharp/Video/Nv12MemoryImage.cs similarity index 59% rename from sources/SDL2Sharp/Video/Yv12Image.cs rename to sources/SDL2Sharp/Video/Nv12MemoryImage.cs index b530eced..f3737b51 100644 --- a/sources/SDL2Sharp/Video/Yv12Image.cs +++ b/sources/SDL2Sharp/Video/Nv12MemoryImage.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,43 +20,34 @@ using System; using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public readonly ref struct Yv12Image + public sealed class Nv12MemoryImage { - private readonly ColorPlane _yPlane; + private readonly ImageMemoryPlane _yPlane; - private readonly ColorPlane _vPlane; + private readonly ImageMemoryPlane _uvPlane; - private readonly ColorPlane _uPlane; + public ImageMemoryPlane Y => _yPlane; - private readonly int _height; + public ImageMemoryPlane UV => _uvPlane; - private readonly int _width; - - public readonly int Width + public int Width { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _width; + get => _yPlane.Width; } - public readonly int Height + public int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _height; + get => _yPlane.Height; } - public unsafe Yv12Image(void* pixels, int height, int width, int pitch) + public Nv12MemoryImage(int width, int height) { - if (height < 0) - { - throw new ArgumentOutOfRangeException( - nameof(height), - height, - "height cannot be less than zero"); - } - if (width < 0) { throw new ArgumentOutOfRangeException( @@ -65,25 +56,16 @@ public unsafe Yv12Image(void* pixels, int height, int width, int pitch) "height cannot be less than zero"); } - if (pitch < 0) + if (height < 0) { throw new ArgumentOutOfRangeException( - nameof(pitch), - pitch, - "pitch cannot be less than zero"); + nameof(height), + height, + "height cannot be less than zero"); } - _yPlane = new ColorPlane(pixels, height, width, pitch, 0); - _vPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); - _uPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch * 2); - _height = height; - _width = width; + _yPlane = new ImageMemoryPlane(width, height); + _uvPlane = new ImageMemoryPlane(width / 2, height / 2); } - - public ColorPlane Y => _yPlane; - - public ColorPlane V => _vPlane; - - public ColorPlane U => _uPlane; } } diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/Nv12Texture.cs index f119943b..1e44562b 100644 --- a/sources/SDL2Sharp/Video/Nv12Texture.cs +++ b/sources/SDL2Sharp/Video/Nv12Texture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,14 +19,20 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public sealed unsafe partial class Nv12Texture : IDisposable + public unsafe sealed class Nv12Texture : IDisposable { + public delegate void LockCallback(Nv12Image pixels); + private Texture _texture; - public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + public PixelFormat Format => _texture.Format; public TextureAccess Access => _texture.Access; @@ -66,20 +72,49 @@ private void Dispose(bool _) _texture = null!; } - // public void WithLock(WithLockNv12ImageCallback callback) - // { - // WithLock(0, 0, Width, Height, callback); - // } + public void WithLock(LockCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } - // public void WithLock(Rectangle rectangle, WithLockNv12ImageCallback callback) - // { - // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - // } + public void WithLock(Rectangle rectangle, LockCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } - // public void WithLock(int x, int y, int width, int height, WithLockNv12ImageCallback callback) - // { - // _texture.WithLock(x, y, width, height, callback); - // } + public void WithLock(int x, int y, int width, int height, LockCallback callback) + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitch; + Error.ThrowOnFailure( + SDL.LockTexture(_texture, &rect, &pixels, &pitch) + ); + + var image = new Nv12Image(pixels, width, height, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_texture); + } + + public void Update(Nv12Image image) + { + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); + var yPitch = image.Y.Width * Marshal.SizeOf(); + var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); + var uvPitch = image.UV.Width * Marshal.SizeOf(); + SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + } + + public void Update(Nv12MemoryImage image) + { + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); + var yPitch = image.Y.Width * Marshal.SizeOf(); + var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); + var uvPitch = image.UV.Width * Marshal.SizeOf(); + SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + } private void ThrowWhenDisposed() { diff --git a/sources/SDL2Sharp/Video/Nv21Image.cs b/sources/SDL2Sharp/Video/Nv21Image.cs index 5449183d..962fc483 100644 --- a/sources/SDL2Sharp/Video/Nv21Image.cs +++ b/sources/SDL2Sharp/Video/Nv21Image.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,32 +20,33 @@ using System; using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { public readonly ref struct Nv21Image { - private readonly ColorPlane _yPlane; + private readonly ImagePlane _yPlane; - private readonly ColorPlane _vuPlane; + private readonly ImagePlane _vuPlane; - private readonly int _height; + public ImagePlane Y => _yPlane; - private readonly int _width; + public ImagePlane VU => _vuPlane; public readonly int Width { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _width; + get => _yPlane.Width; } public readonly int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _height; + get => _yPlane.Height; } - public unsafe Nv21Image(void* pixels, int height, int width, int pitch) + public unsafe Nv21Image(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -71,14 +72,9 @@ public unsafe Nv21Image(void* pixels, int height, int width, int pitch) "pitch cannot be less than zero"); } - _yPlane = new ColorPlane(pixels, height, width, pitch, 0); - _vuPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); - _height = height; - _width = width; + _yPlane = new ImagePlane(pixels, width, height, pitch); + var vuPlanePixels = Unsafe.Add(pixels, height * pitch); + _vuPlane = new ImagePlane(vuPlanePixels, width / 2, height / 2, pitch / 2); } - - public ColorPlane Y => _yPlane; - - public ColorPlane VU => _vuPlane; } } diff --git a/sources/SDL2Sharp/Video/IyuvImage.cs b/sources/SDL2Sharp/Video/Nv21MemoryImage.cs similarity index 59% rename from sources/SDL2Sharp/Video/IyuvImage.cs rename to sources/SDL2Sharp/Video/Nv21MemoryImage.cs index f88f4ef8..9985012a 100644 --- a/sources/SDL2Sharp/Video/IyuvImage.cs +++ b/sources/SDL2Sharp/Video/Nv21MemoryImage.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,43 +20,34 @@ using System; using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public readonly ref struct IyuvImage + public sealed class Nv21MemoryImage { - private readonly ColorPlane _yPlane; + private readonly ImageMemoryPlane _yPlane; - private readonly ColorPlane _uPlane; + private readonly ImageMemoryPlane _uvPlane; - private readonly ColorPlane _vPlane; + public ImageMemoryPlane Y => _yPlane; - private readonly int _height; + public ImageMemoryPlane VU => _uvPlane; - private readonly int _width; - - public readonly int Width + public int Width { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _width; + get => _yPlane.Width; } - public readonly int Height + public int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _height; + get => _yPlane.Height; } - public unsafe IyuvImage(void* pixels, int height, int width, int pitch) + public unsafe Nv21MemoryImage(int width, int height) { - if (height < 0) - { - throw new ArgumentOutOfRangeException( - nameof(height), - height, - "height cannot be less than zero"); - } - if (width < 0) { throw new ArgumentOutOfRangeException( @@ -65,25 +56,16 @@ public unsafe IyuvImage(void* pixels, int height, int width, int pitch) "height cannot be less than zero"); } - if (pitch < 0) + if (height < 0) { throw new ArgumentOutOfRangeException( - nameof(pitch), - pitch, - "pitch cannot be less than zero"); + nameof(height), + height, + "height cannot be less than zero"); } - _yPlane = new ColorPlane(pixels, height, width, pitch, 0); - _vPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch); - _uPlane = new ColorPlane(pixels, height / 2, width, pitch / 2, width * pitch * 2); - _height = height; - _width = width; + _yPlane = new ImageMemoryPlane(width, height); + _uvPlane = new ImageMemoryPlane(width / 2, height / 2); } - - public ColorPlane Y => _yPlane; - - public ColorPlane U => _uPlane; - - public ColorPlane V => _vPlane; } } diff --git a/sources/SDL2Sharp/Video/Nv21Texture.cs b/sources/SDL2Sharp/Video/Nv21Texture.cs index d16a6c2c..a9ebaa6e 100644 --- a/sources/SDL2Sharp/Video/Nv21Texture.cs +++ b/sources/SDL2Sharp/Video/Nv21Texture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,14 +19,20 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { public sealed unsafe partial class Nv21Texture : IDisposable { + public delegate void LockCallback(Nv21Image pixels); + private Texture _texture; - public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + public PixelFormat Format => _texture.Format; public TextureAccess Access => _texture.Access; @@ -66,20 +72,49 @@ private void Dispose(bool _) _texture = null!; } - // public void WithLock(WithLockNv21ImageCallback callback) - // { - // WithLock(0, 0, Width, Height, callback); - // } + public void WithLock(LockCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } - // public void WithLock(Rectangle rectangle, WithLockNv21ImageCallback callback) - // { - // WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - // } + public void WithLock(Rectangle rectangle, LockCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } - // public void WithLock(int x, int y, int width, int height, WithLockNv21ImageCallback callback) - // { - // _texture.WithLock(x, y, width, height, callback); - // } + public void WithLock(int x, int y, int width, int height, LockCallback callback) + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitch; + Error.ThrowOnFailure( + SDL.LockTexture(_texture, &rect, &pixels, &pitch) + ); + + var image = new Nv21Image(pixels, width, height, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_texture); + } + + public void Update(Nv21Image image) + { + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); + var yPitch = image.Y.Width * Marshal.SizeOf(); + var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); + var uvPitch = image.VU.Width * Marshal.SizeOf(); + SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + } + + public void Update(Nv21MemoryImage image) + { + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); + var yPitch = image.Y.Width * Marshal.SizeOf(); + var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); + var uvPitch = image.VU.Width * Marshal.SizeOf(); + SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + } private void ThrowWhenDisposed() { diff --git a/sources/SDL2Sharp/Video/PackedImage.cs b/sources/SDL2Sharp/Video/PackedImage.cs index ca465d93..35818d6f 100644 --- a/sources/SDL2Sharp/Video/PackedImage.cs +++ b/sources/SDL2Sharp/Video/PackedImage.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,134 +18,62 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; namespace SDL2Sharp.Video { - public ref struct PackedImage + public readonly ref struct PackedImage where TPackedPixelFormat : struct { - private readonly Span _pixels; - - private readonly int _height; - - private readonly int _width; - - private readonly int _pitch; + private readonly ImagePlane _plane; public int Width { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return _width; - } + get => _plane.Width; } public int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return _height; - } + get => _plane.Height; } - public ref TPackedColor this[int row, int column] + public Size Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - if (row < 0) - { - throw new ArgumentOutOfRangeException( - nameof(row), - row, - "row cannot be less than zero"); - } - - if (row >= _height) - { - throw new ArgumentOutOfRangeException( - nameof(column), - column, - "row cannot be greater than or equal to the height of the image"); - } - - if (column < 0) - { - throw new ArgumentOutOfRangeException( - nameof(column), - column, - "column cannot be less than zero"); - } - - if (column >= _width) - { - throw new ArgumentOutOfRangeException( - nameof(column), - column, - "column cannot be greater than or equal to the width of the image"); - } - - return ref DangerousGetReferenceAt(row, column); - } + get => _plane.Size; } - public unsafe PackedImage(void* pixels, int height, int width, int pitch) + public ref TPackedPixelFormat this[int x, int y] { - if (height < 0) - { - throw new ArgumentOutOfRangeException( - nameof(height), - height, - "height cannot be less than zero"); - } - - if (width < 0) - { - throw new ArgumentOutOfRangeException( - nameof(width), - width, - "height cannot be less than zero"); - } - - if (pitch < 0) - { - throw new ArgumentOutOfRangeException( - nameof(pitch), - pitch, - "pitch cannot be less than zero"); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => ref _plane[x, y]; + } - _pixels = new Span(pixels, height * pitch); - _height = height; - _width = width; - _pitch = pitch; + public unsafe PackedImage(void* pixels, int width, int height, int pitch) + { + _plane = new ImagePlane(pixels, width, height, pitch); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref TPackedColor DangerousGetReference() + public ref TPackedPixelFormat DangerousGetReference() { - return ref MemoryMarshal.GetReference(_pixels); + return ref _plane.DangerousGetReference(); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref TPackedColor DangerousGetReferenceAt(int row, int column) + public ref TPackedPixelFormat DangerousGetReferenceAt(int x, int y) { - ref var r0 = ref MemoryMarshal.GetReference(_pixels); - var index = row * _pitch + column; - return ref Unsafe.Add(ref r0, index); + return ref _plane.DangerousGetReferenceAt(x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Fill(TPackedColor value) + public void Fill(TPackedPixelFormat value) { - _pixels.Fill(value); + _plane.Fill(value); } } } diff --git a/sources/SDL2Sharp/Video/PackedLayout.cs b/sources/SDL2Sharp/Video/PackedLayout.cs new file mode 100644 index 00000000..aedf2c32 --- /dev/null +++ b/sources/SDL2Sharp/Video/PackedLayout.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_PackedLayout; + +namespace SDL2Sharp.Video +{ + public enum PackedLayout + { + None = SDL_PACKEDLAYOUT_NONE, + _332 = SDL_PACKEDLAYOUT_332, + _4444 = SDL_PACKEDLAYOUT_4444, + _1555 = SDL_PACKEDLAYOUT_1555, + _5551 = SDL_PACKEDLAYOUT_5551, + _565 = SDL_PACKEDLAYOUT_565, + _8888 = SDL_PACKEDLAYOUT_8888, + _2101010 = SDL_PACKEDLAYOUT_2101010, + _1010102 = SDL_PACKEDLAYOUT_1010102, + } +} diff --git a/sources/SDL2Sharp/Video/PackedMemoryImage.cs b/sources/SDL2Sharp/Video/PackedMemoryImage.cs new file mode 100644 index 00000000..cfd7e7df --- /dev/null +++ b/sources/SDL2Sharp/Video/PackedMemoryImage.cs @@ -0,0 +1,72 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public sealed class PackedMemoryImage where TColor : struct + { + private readonly ImageMemoryPlane _plane; + + public int Width => _plane.Width; + + public int Height => _plane.Height; + + public Size Size => _plane.Size; + + public TColor this[int x, int y] + { + get + { + return _plane[x, y]; + } + set + { + _plane[x, y] = value; + } + } + + public PackedMemoryImage(Size size) + : this(size.Width, size.Height) + { } + + public PackedMemoryImage(int width, int height) + : this(new ImageMemoryPlane(width, height)) + { } + + private PackedMemoryImage(ImageMemoryPlane plane) + { + _plane = plane ?? throw new ArgumentNullException(nameof(plane)); + } + + public PackedMemoryImage Crop(int top, int left, int bottom, int right) + { + var croppedPlane = _plane.Crop(top, left, bottom, right); + var croppedImage = new PackedMemoryImage(croppedPlane); + return croppedImage; + } + + public ref TColor DangerousGetReference() + { + return ref _plane.DangerousGetReference(); + } + } +} diff --git a/sources/SDL2Sharp/Video/PackedOrder.cs b/sources/SDL2Sharp/Video/PackedOrder.cs new file mode 100644 index 00000000..f74685e7 --- /dev/null +++ b/sources/SDL2Sharp/Video/PackedOrder.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_PackedOrder; + +namespace SDL2Sharp.Video +{ + public enum PackedOrder + { + None = SDL_PACKEDORDER_NONE, + Xrgb = SDL_PACKEDORDER_XRGB, + Rgbx = SDL_PACKEDORDER_RGBX, + Argb = SDL_PACKEDORDER_ARGB, + Rgba = SDL_PACKEDORDER_RGBA, + Xbgr = SDL_PACKEDORDER_XBGR, + Bgrx = SDL_PACKEDORDER_BGRX, + Abgr = SDL_PACKEDORDER_ABGR, + Bgra = SDL_PACKEDORDER_BGRA, + } +} diff --git a/sources/SDL2Sharp/Video/PackedPixelFormat.cs b/sources/SDL2Sharp/Video/PackedPixelFormat.cs deleted file mode 100644 index 44dee9e5..00000000 --- a/sources/SDL2Sharp/Video/PackedPixelFormat.cs +++ /dev/null @@ -1,55 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Video -{ - public enum PackedPixelFormat : uint - { - ABGR1555 = PixelFormatEnum.ABGR1555, - ABGR4444 = PixelFormatEnum.ABGR4444, - ABGR8888 = PixelFormatEnum.ABGR8888, - ARGB1555 = PixelFormatEnum.ARGB1555, - ARGB4444 = PixelFormatEnum.ARGB4444, - ARGB8888 = PixelFormatEnum.ARGB8888, - ARGB2101010 = PixelFormatEnum.ARGB2101010, - BGR24 = PixelFormatEnum.BGR24, - BGR565 = PixelFormatEnum.BGR565, - BGRA4444 = PixelFormatEnum.BGRA4444, - BGRA5551 = PixelFormatEnum.BGRA5551, - BGRA8888 = PixelFormatEnum.BGRA8888, - BGRX8888 = PixelFormatEnum.BGRX8888, - RGB24 = PixelFormatEnum.RGB24, - RGB332 = PixelFormatEnum.RGB332, - RGB565 = PixelFormatEnum.RGB565, - RGBA4444 = PixelFormatEnum.RGBA4444, - RGBA5551 = PixelFormatEnum.RGBA5551, - RGBA8888 = PixelFormatEnum.RGBA8888, - RGBX8888 = PixelFormatEnum.RGBX8888, - XBGR1555 = PixelFormatEnum.XBGR1555, - XBGR4444 = PixelFormatEnum.XBGR4444, - XBGR8888 = PixelFormatEnum.XBGR8888, - XRGB1555 = PixelFormatEnum.XRGB1555, - XRGB4444 = PixelFormatEnum.XRGB4444, - XRGB8888 = PixelFormatEnum.XRGB8888, - YUY2 = PixelFormatEnum.YUY2, - UYVY = PixelFormatEnum.UYVY, - YVYU = PixelFormatEnum.YVYU, - } -} diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index d786450e..7fcbd9c6 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -26,11 +26,15 @@ namespace SDL2Sharp.Video { - public sealed unsafe class PackedTexture : IDisposable where TPackedColor : struct + public sealed unsafe class PackedTexture : IDisposable where TPackedPixelFormat : struct { + public delegate void LockCallback(PackedImage pixels); + + public delegate void LockToSurfaceCallback(Surface surface); + private Texture _texture; - public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + public PixelFormat Format => _texture.Format; public TextureAccess Access => _texture.Access; @@ -38,6 +42,8 @@ public sealed unsafe class PackedTexture : IDisposable where TPack public int Height => _texture.Height; + public Size Size => _texture.Size; + public BlendMode BlendMode { get => _texture.BlendMode; @@ -49,6 +55,11 @@ public BlendMode BlendMode internal PackedTexture(Texture texture) { + if (!texture.Format.IsPacked()) + { + throw new ArgumentException("Texture is not in a packed color format.", nameof(texture)); + } + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } @@ -70,63 +81,83 @@ private void Dispose(bool _) _texture = null!; } - public void WithLock(WithLockPackedImageCallback callback) + public void WithLock(LockCallback callback) { WithLock(0, 0, Width, Height, callback); } - public void WithLock(Rectangle rectangle, WithLockPackedImageCallback callback) + public void WithLock(Rectangle rectangle, LockCallback callback) { WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); } - public void WithLock(int x, int y, int width, int height, WithLockPackedImageCallback callback) + public void WithLock(int x, int y, int width, int height, LockCallback callback) { - _texture.WithLock(x, y, width, height, callback); + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitchInBytes; + Error.ThrowOnFailure( + SDL.LockTexture(_texture, &rect, &pixels, &pitchInBytes) + ); + + var bytesPerPixel = Marshal.SizeOf(); + var pitch = pitchInBytes / bytesPerPixel; + var image = new PackedImage(pixels, width, height, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_texture); } - public void WithLock(WithLockSurfaceCallback callback) + public void WithLock(LockToSurfaceCallback callback) { WithLock(0, 0, Width, Height, callback); } - public void WithLock(Rectangle rectangle, WithLockSurfaceCallback callback) + public void WithLock(Rectangle rectangle, LockToSurfaceCallback callback) { WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); } - public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallback callback) + public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback callback) { ThrowWhenDisposed(); - _texture.WithLock(x, y, width, height, callback); + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + SDL_Surface* surfaceHandle; + Error.ThrowOnFailure( + SDL.LockTextureToSurface(_texture, &rect, &surfaceHandle) + ); + var surface = new Surface(surfaceHandle, false); + callback.Invoke(surface); + SDL.UnlockTexture(_texture); } - public void Update(MemoryImage image) + public void Update(PackedMemoryImage image) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref image.DangerousGetReference()); - var pitch = image.Width * Marshal.SizeOf(); + var pitch = image.Width * Marshal.SizeOf(); Update(null, pointer, pitch); } - public void Update(PackedImage pixels) + public void Update(PackedImage pixels) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); - var pitch = pixels.Width * Marshal.SizeOf(); + var pitch = pixels.Width * Marshal.SizeOf(); Update(null, pointer, pitch); } - public void Update(TPackedColor[,] pixels) + public void Update(TPackedPixelFormat[,] pixels) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); var width = pixels.GetLength(1); - var pitch = width * Marshal.SizeOf(); + var pitch = width * Marshal.SizeOf(); Update(null, pointer, pitch); } @@ -145,7 +176,7 @@ private void ThrowWhenDisposed() } } - public static implicit operator Texture(PackedTexture texture) + public static implicit operator Texture(PackedTexture texture) { if (texture is null) { diff --git a/sources/SDL2Sharp/Video/PixelFormat.cs b/sources/SDL2Sharp/Video/PixelFormat.cs index f1f55863..475bf276 100644 --- a/sources/SDL2Sharp/Video/PixelFormat.cs +++ b/sources/SDL2Sharp/Video/PixelFormat.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,77 +18,61 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; -using SDL2Sharp.Interop; +using static SDL2Sharp.Interop.SDL_PixelFormatEnum; namespace SDL2Sharp.Video { - public sealed unsafe class PixelFormat : IDisposable + public enum PixelFormat : uint { - private SDL_PixelFormat* _handle; - - private readonly bool _ownsHandle; - - public PixelFormatEnum Format => (PixelFormatEnum)_handle->format; - - public byte BitsPerPixel => _handle->BitsPerPixel; - - public byte BytesPerPixel => _handle->BytesPerPixel; - - public uint RedMask => _handle->Rmask; - - public uint GreenMask => _handle->Gmask; - - public uint BlueMask => _handle->Bmask; - - public uint AlphaMask => _handle->Amask; - - public byte RedLoss => _handle->Rloss; - - public byte GreenLoss => _handle->Gloss; - - public byte BlueLoss => _handle->Bloss; - - public byte AlphaLoss => _handle->Aloss; - - public byte RedShift => _handle->Rshift; - - public byte GreenShift => _handle->Gshift; - - public byte BlueShift => _handle->Bshift; - - public byte AlphaShift => _handle->Ashift; - - internal PixelFormat(SDL_PixelFormat* handle, bool ownsHandle) - { - if (handle == null) - { - throw new ArgumentNullException(nameof(handle)); - } - - _handle = handle; - _ownsHandle = ownsHandle; - } - - public PixelFormat(PixelFormatEnum pixelFormat) - : this(Error.ReturnOrThrowOnFailure(SDL.AllocFormat((uint)pixelFormat)), true) - { } - - ~PixelFormat() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - } - - private void Dispose(bool _) - { - if (!_ownsHandle || _handle == null) return; - SDL.FreeFormat(_handle); - _handle = null; - } + Unknown = SDL_PIXELFORMAT_UNKNOWN, + Index1LSB = SDL_PIXELFORMAT_INDEX1LSB, + Index1MSB = SDL_PIXELFORMAT_INDEX1MSB, + Index4LSB = SDL_PIXELFORMAT_INDEX4LSB, + Index4MSB = SDL_PIXELFORMAT_INDEX4MSB, + Index8 = SDL_PIXELFORMAT_INDEX8, + RGB332 = SDL_PIXELFORMAT_RGB332, + XRGB4444 = SDL_PIXELFORMAT_XRGB4444, + RGB444 = SDL_PIXELFORMAT_RGB444, + XBGR4444 = SDL_PIXELFORMAT_XBGR4444, + BGR444 = SDL_PIXELFORMAT_BGR444, + XRGB1555 = SDL_PIXELFORMAT_XRGB1555, + RGB555 = SDL_PIXELFORMAT_RGB555, + XBGR1555 = SDL_PIXELFORMAT_XBGR1555, + BGR555 = SDL_PIXELFORMAT_BGR555, + ARGB4444 = SDL_PIXELFORMAT_ARGB4444, + RGBA4444 = SDL_PIXELFORMAT_RGBA4444, + ABGR4444 = SDL_PIXELFORMAT_ABGR4444, + BGRA4444 = SDL_PIXELFORMAT_BGRA4444, + ARGB1555 = SDL_PIXELFORMAT_ARGB1555, + RGBA5551 = SDL_PIXELFORMAT_RGBA5551, + ABGR1555 = SDL_PIXELFORMAT_ABGR1555, + BGRA5551 = SDL_PIXELFORMAT_BGRA5551, + RGB565 = SDL_PIXELFORMAT_RGB565, + BGR565 = SDL_PIXELFORMAT_BGR565, + RGB24 = SDL_PIXELFORMAT_RGB24, + BGR24 = SDL_PIXELFORMAT_BGR24, + XRGB8888 = SDL_PIXELFORMAT_XRGB8888, + RGB888 = SDL_PIXELFORMAT_RGB888, + RGBX8888 = SDL_PIXELFORMAT_RGBX8888, + XBGR8888 = SDL_PIXELFORMAT_XBGR8888, + BGR888 = SDL_PIXELFORMAT_BGR888, + BGRX8888 = SDL_PIXELFORMAT_BGRX8888, + ARGB8888 = SDL_PIXELFORMAT_ARGB8888, + RGBA8888 = SDL_PIXELFORMAT_RGBA8888, + ABGR8888 = SDL_PIXELFORMAT_ABGR8888, + BGRA8888 = SDL_PIXELFORMAT_BGRA8888, + ARGB2101010 = SDL_PIXELFORMAT_ARGB2101010, + RGBA32 = SDL_PIXELFORMAT_RGBA32, + ARGB32 = SDL_PIXELFORMAT_ARGB32, + BGRA32 = SDL_PIXELFORMAT_BGRA32, + ABGR32 = SDL_PIXELFORMAT_ABGR32, + YV12 = SDL_PIXELFORMAT_YV12, + IYUV = SDL_PIXELFORMAT_IYUV, + YUY2 = SDL_PIXELFORMAT_YUY2, + UYVY = SDL_PIXELFORMAT_UYVY, + YVYU = SDL_PIXELFORMAT_YVYU, + NV12 = SDL_PIXELFORMAT_NV12, + NV21 = SDL_PIXELFORMAT_NV21, + ExternalOES = SDL_PIXELFORMAT_EXTERNAL_OES, } } diff --git a/sources/SDL2Sharp/Video/PackedColorAttribute.cs b/sources/SDL2Sharp/Video/PixelFormatAttribute.cs similarity index 77% rename from sources/SDL2Sharp/Video/PackedColorAttribute.cs rename to sources/SDL2Sharp/Video/PixelFormatAttribute.cs index 3b0d75ac..cbd7d95d 100644 --- a/sources/SDL2Sharp/Video/PackedColorAttribute.cs +++ b/sources/SDL2Sharp/Video/PixelFormatAttribute.cs @@ -24,22 +24,22 @@ namespace SDL2Sharp.Video { [AttributeUsage(AttributeTargets.Struct)] - internal sealed class PackedColorAttribute : Attribute + internal sealed class PixelFormatAttribute : Attribute { - public PackedPixelFormat PixelFormat { get; } + public PixelFormat PixelFormat { get; } - public PackedColorAttribute(PackedPixelFormat pixelFormat) + public PixelFormatAttribute(PixelFormat pixelFormat) { PixelFormat = pixelFormat; } - public static PackedPixelFormat GetPixelFormatOf() + public static PixelFormat GetPixelFormatOf() { - var pixelFormatType = typeof(TPackedColor); - var pixelFormatAttribute = pixelFormatType.GetCustomAttribute(); + var pixelFormatType = typeof(TPackedPixelFormat); + var pixelFormatAttribute = pixelFormatType.GetCustomAttribute(); if (pixelFormatAttribute == null) { - throw new NotSupportedException($"The type {pixelFormatType} does not have a {nameof(PackedColorAttribute)}."); + throw new NotSupportedException($"The type {pixelFormatType} does not have a {nameof(PixelFormatAttribute)}."); } return pixelFormatAttribute.PixelFormat; } diff --git a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs new file mode 100644 index 00000000..b57ccd1b --- /dev/null +++ b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs @@ -0,0 +1,128 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Video +{ + public sealed unsafe class PixelFormatDescriptor : IDisposable + { + private SDL_PixelFormat* _handle; + + private readonly bool _ownsHandle; + + public PixelFormat Format => (PixelFormat)_handle->format; + + public byte BitsPerPixel => _handle->BitsPerPixel; + + public byte BytesPerPixel => _handle->BytesPerPixel; + + public uint RedMask => _handle->Rmask; + + public uint GreenMask => _handle->Gmask; + + public uint BlueMask => _handle->Bmask; + + public uint AlphaMask => _handle->Amask; + + public byte RedLoss => _handle->Rloss; + + public byte GreenLoss => _handle->Gloss; + + public byte BlueLoss => _handle->Bloss; + + public byte AlphaLoss => _handle->Aloss; + + public byte RedShift => _handle->Rshift; + + public byte GreenShift => _handle->Gshift; + + public byte BlueShift => _handle->Bshift; + + public byte AlphaShift => _handle->Ashift; + + internal PixelFormatDescriptor(SDL_PixelFormat* handle, bool ownsHandle) + { + if (handle == null) + { + throw new ArgumentNullException(nameof(handle)); + } + + _handle = handle; + _ownsHandle = ownsHandle; + } + + public PixelFormatDescriptor(PixelFormat pixelFormat) + : this(Error.ReturnOrThrowOnFailure(SDL.AllocFormat((uint)pixelFormat)), true) + { } + + ~PixelFormatDescriptor() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + } + + private void Dispose(bool _) + { + if (!_ownsHandle || _handle == null) return; + SDL.FreeFormat(_handle); + _handle = null; + } + + internal uint MapRGB(byte r, byte g, byte b) + { + return SDL.MapRGB(_handle, r, g, b); + } + + public uint MapRGBA(byte r, byte g, byte b, byte a) + { + return SDL.MapRGBA(_handle, r, g, b, a); + } + + public (byte r, byte g, byte b) GetRGB(uint value) + { + byte r, g, b; + SDL.GetRGB(value, _handle, &r, &g, &b); + return (r, g, b); + } + + public (byte r, byte g, byte b, byte a) GetRGBA(uint value) + { + byte r, g, b, a; + SDL.GetRGBA(value, _handle, &r, &g, &b, &a); + return (r, g, b, a); + } + + public static implicit operator SDL_PixelFormat*(PixelFormatDescriptor pixelFormat) + { + if (pixelFormat is null) + { + throw new ArgumentNullException(nameof(pixelFormat)); + } + + return pixelFormat._handle; + } + } +} diff --git a/sources/SDL2Sharp/Video/PixelFormatEnum.cs b/sources/SDL2Sharp/Video/PixelFormatEnum.cs deleted file mode 100644 index 1c1d988b..00000000 --- a/sources/SDL2Sharp/Video/PixelFormatEnum.cs +++ /dev/null @@ -1,78 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using SDL2Sharp.Interop; - -namespace SDL2Sharp.Video -{ - public enum PixelFormatEnum : uint - { - Unknown = SDL_PixelFormatEnum.SDL_PIXELFORMAT_UNKNOWN, - Index1LSB = SDL_PixelFormatEnum.SDL_PIXELFORMAT_INDEX1LSB, - Index1MSB = SDL_PixelFormatEnum.SDL_PIXELFORMAT_INDEX1MSB, - Index4LSB = SDL_PixelFormatEnum.SDL_PIXELFORMAT_INDEX4LSB, - Index4MSB = SDL_PixelFormatEnum.SDL_PIXELFORMAT_INDEX4MSB, - Index8 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_INDEX8, - RGB332 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB332, - XRGB4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XRGB4444, - RGB444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB444, - XBGR4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XBGR4444, - BGR444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGR444, - XRGB1555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XRGB1555, - RGB555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB555, - XBGR1555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XBGR1555, - BGR555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGR555, - ARGB4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ARGB4444, - RGBA4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBA4444, - ABGR4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR4444, - BGRA4444 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGRA4444, - ARGB1555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ARGB1555, - RGBA5551 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBA5551, - ABGR1555 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR1555, - BGRA5551 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGRA5551, - RGB565 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB565, - BGR565 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGR565, - RGB24 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB24, - BGR24 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGR24, - XRGB8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XRGB8888, - RGB888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGB888, - RGBX8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBX8888, - XBGR8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_XBGR8888, - BGR888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGR888, - BGRX8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGRX8888, - ARGB8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ARGB8888, - RGBA8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBA8888, - ABGR8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR8888, - BGRA8888 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGRA8888, - ARGB2101010 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ARGB2101010, - RGBA32 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_RGBA32, - ARGB32 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ARGB32, - BGRA32 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_BGRA32, - ABGR32 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_ABGR32, - YV12 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_YV12, - IYUV = SDL_PixelFormatEnum.SDL_PIXELFORMAT_IYUV, - YUY2 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_YUY2, - UYVY = SDL_PixelFormatEnum.SDL_PIXELFORMAT_UYVY, - YVYU = SDL_PixelFormatEnum.SDL_PIXELFORMAT_YVYU, - NV12 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_NV12, - NV21 = SDL_PixelFormatEnum.SDL_PIXELFORMAT_NV21, - ExternalOES = SDL_PixelFormatEnum.SDL_PIXELFORMAT_EXTERNAL_OES, - } -} diff --git a/sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs b/sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs deleted file mode 100644 index e12477e1..00000000 --- a/sources/SDL2Sharp/Video/PixelFormatEnumExtensions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Video -{ - public static class PixelFormatEnumExtensions - { - public static bool IsFourCC(this PixelFormatEnum format) - { - return (format != PixelFormatEnum.Unknown) && (GetPixelFlag(format) != 1); - } - - public static uint GetPixelFlag(this PixelFormatEnum format) - { - return (((uint)format) >> 28) & 0x0FU; - } - - public static PixelType GetPixelType(this PixelFormatEnum format) - { - return (PixelType)((((uint)format) >> 24) & 0x0F); - } - - public static uint GetBitsPerPixel(this PixelFormatEnum format) - { - return (((uint)format) >> 8) & 0xFFU; - } - - public static uint GetBytesPerPixel(this PixelFormatEnum pixelFormat) - { - return IsFourCC(pixelFormat) ? - (((pixelFormat == PixelFormatEnum.YUY2) || - (pixelFormat == PixelFormatEnum.UYVY) || - (pixelFormat == PixelFormatEnum.YVYU)) ? 2u : 1u) : ((uint)pixelFormat) & 0xFF; - } - - public static bool IsPacked(this PixelFormatEnum pixelFormat) - { - if (IsFourCC(pixelFormat)) - { - return false; - } - - var pixelType = GetPixelType(pixelFormat); - return (pixelType == PixelType.Packed8) - || (pixelType == PixelType.Packed16) - || (pixelType == PixelType.Packet32); - } - } -} diff --git a/sources/SDL2Sharp/Video/PixelFormatExtensions.cs b/sources/SDL2Sharp/Video/PixelFormatExtensions.cs new file mode 100644 index 00000000..cbcec760 --- /dev/null +++ b/sources/SDL2Sharp/Video/PixelFormatExtensions.cs @@ -0,0 +1,133 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + public static class PixelFormatExtensions + { + public static bool IsFourCC(this PixelFormat format) + { + return (format != PixelFormat.Unknown) && (GetPixelFlag(format) != 1); + } + + public static uint GetPixelFlag(this PixelFormat format) + { + return (((uint)format) >> 28) & 0x0FU; + } + + public static PixelType GetPixelType(this PixelFormat format) + { + return (PixelType)((((uint)format) >> 24) & 0x0F); + } + + public static uint GetBitsPerPixel(this PixelFormat format) + { + return (((uint)format) >> 8) & 0xFFU; + } + + public static uint GetBytesPerPixel(this PixelFormat pixelFormat) + { + return IsFourCC(pixelFormat) ? + (((pixelFormat == PixelFormat.YUY2) || + (pixelFormat == PixelFormat.UYVY) || + (pixelFormat == PixelFormat.YVYU)) ? 2u : 1u) : ((uint)pixelFormat) & 0xFF; + } + + public static PixelOrder GetPixelOrder(this PixelFormat format) + { + return (PixelOrder)((((uint)format) >> 20) & 0x0F); + } + + public static PackedLayout GetPixelLayout(this PixelFormat format) + { + return (PackedLayout)((((uint)format) >> 16) & 0x0F); + } + + public static bool IsIndexed(this PixelFormat pixelFormat) + { + if (IsFourCC(pixelFormat)) + { + return false; + } + + var pixelType = GetPixelType(pixelFormat); + return (pixelType == PixelType.Index1) + || (pixelType == PixelType.Index4) + || (pixelType == PixelType.Index8); + } + + public static bool IsPacked(this PixelFormat pixelFormat) + { + if (IsFourCC(pixelFormat)) + { + return false; + } + + var pixelType = GetPixelType(pixelFormat); + return (pixelType == PixelType.Packed8) + || (pixelType == PixelType.Packed16) + || (pixelType == PixelType.Packet32); + } + + public static bool IsArray(this PixelFormat pixelFormat) + { + if (IsFourCC(pixelFormat)) + { + return false; + } + + var pixelType = GetPixelType(pixelFormat); + return (pixelType == PixelType.ArrayU8) + || (pixelType == PixelType.ArrayU16) + || (pixelType == PixelType.ArrayU32) + || (pixelType == PixelType.ArrayF16) + || (pixelType == PixelType.ArrayF32); + } + + public static bool IsAlpha(this PixelFormat pixelFormat) + { + if (IsFourCC(pixelFormat)) + { + return false; + } + + var pixelOrder = GetPixelOrder(pixelFormat); + if (IsPacked(pixelFormat)) + { + var packedOrder = (PackedOrder)pixelOrder; + return (packedOrder == PackedOrder.Argb) + || (packedOrder == PackedOrder.Rgba) + || (packedOrder == PackedOrder.Abgr) + || (packedOrder == PackedOrder.Bgra); + } + + if (IsArray(pixelFormat)) + { + var arrayOrder = (ArrayOrder)pixelOrder; + return (arrayOrder == ArrayOrder.Argb) + || (arrayOrder == ArrayOrder.Rgba) + || (arrayOrder == ArrayOrder.Abgr) + || (arrayOrder == ArrayOrder.Bgra); + } + + return false; + } + } +} diff --git a/sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs b/sources/SDL2Sharp/Video/PixelOrder.cs similarity index 89% rename from sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs rename to sources/SDL2Sharp/Video/PixelOrder.cs index 85216293..38e12711 100644 --- a/sources/SDL2Sharp/Video/WithLockYv12ImageCallback.cs +++ b/sources/SDL2Sharp/Video/PixelOrder.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,7 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { - public delegate void WithLockYv12ImageCallback(Yv12Image pixels); + public enum PixelOrder : uint + { + } } diff --git a/sources/SDL2Sharp/Video/PixelType.cs b/sources/SDL2Sharp/Video/PixelType.cs index 56a6b3c3..6b89ff2b 100644 --- a/sources/SDL2Sharp/Video/PixelType.cs +++ b/sources/SDL2Sharp/Video/PixelType.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index 977cd508..f4e6f330 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -19,6 +19,8 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using SDL2Sharp.Interop; namespace SDL2Sharp.Video @@ -248,12 +250,12 @@ private void Dispose(bool _) _handle = null; } - public Texture CreateTexture(PixelFormatEnum pixelFormat, TextureAccess access, Size size) + public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, Size size) { return CreateTexture(pixelFormat, access, size.Width, size.Height); } - public Texture CreateTexture(PixelFormatEnum pixelFormat, TextureAccess access, int width, int height) + public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, int width, int height) { ThrowWhenDisposed(); @@ -413,6 +415,36 @@ public void Present() SDL.RenderPresent(_handle); } + public PackedMemoryImage ReadPixels() + where TPackedPixelFormat : struct + { + ThrowWhenDisposed(); + + return ReadPixels( + new Rectangle(0, 0, OutputWidth, OutputHeight) + ); + } + + public PackedMemoryImage ReadPixels(Rectangle rectangle) + where TPackedPixelFormat : struct + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = rectangle.X, y = rectangle.Y, w = rectangle.Width, h = rectangle.Height }; + var format = PixelFormatAttribute.GetPixelFormatOf(); + var image = new PackedMemoryImage(rectangle.Width, rectangle.Height); + var pixels = Unsafe.AsPointer(ref image.DangerousGetReference()); + var pitch = rectangle.Width * Marshal.SizeOf(); + Error.ThrowOnFailure( + SDL.RenderReadPixels(_handle, + &rect, + (uint)format, + pixels, + pitch) + ); + return image; + } + private void ThrowWhenDisposed() { if (_handle is null) diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index 9fcd0375..e5b9d4ff 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -26,53 +26,56 @@ namespace SDL2Sharp.Video { public static class RendererExtensions { - public static PackedTexture CreateTexture(this Renderer renderer, TextureAccess access, Size size) - where TPackedColor : struct + public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, Size size) + where TPackedPixelFormat : struct { if (renderer is null) { throw new ArgumentNullException(nameof(renderer)); } - return renderer.CreateTexture(access, size.Width, size.Height); + return renderer.CreatePackedTexture(access, size.Width, size.Height); } - public static PackedTexture CreateTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TPackedColor : struct + public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TPackedPixelFormat : struct { if (renderer is null) { throw new ArgumentNullException(nameof(renderer)); } - var pixelFormat = PackedColorAttribute.GetPixelFormatOf(); - var texture = renderer.CreateTexture((PixelFormatEnum)pixelFormat, access, width, height); - return new PackedTexture(texture); + var pixelFormat = PixelFormatAttribute.GetPixelFormatOf(); + var texture = renderer.CreateTexture((PixelFormat)pixelFormat, access, width, height); + return new PackedTexture(texture); } - public static Yv12Texture CreateYv12Texture(this Renderer renderer, TextureAccess access, Size size) + public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, Size size) + where TYuvPixelFormat : IYuvPixelFormat, new() { if (renderer is null) { throw new ArgumentNullException(nameof(renderer)); } - return renderer.CreateYv12Texture(access, size.Width, size.Height); + return renderer.CreateYuvTexture(access, size.Width, size.Height); } - public static Yv12Texture CreateYv12Texture(this Renderer renderer, TextureAccess access, int width, int height) + public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TYuvPixelFormat : IYuvPixelFormat, new() { if (renderer is null) { throw new ArgumentNullException(nameof(renderer)); } - var texture = renderer.CreateTexture(PixelFormatEnum.YV12, access, width, height); - return new Yv12Texture(texture); + var pixelFormat = PixelFormatAttribute.GetPixelFormatOf(); + var texture = renderer.CreateTexture(pixelFormat, access, width, height); + return new YuvTexture(texture); } - public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) - where TPackedColor : struct + public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) + where TPackedPixelFormat : struct { if (renderer is null) { @@ -80,7 +83,7 @@ public static PackedTexture CreateTextureFromSurface } var texture = renderer.CreateTextureFromSurface(surface); - var packedTexture = new PackedTexture(texture); + var packedTexture = new PackedTexture(texture); return packedTexture; } diff --git a/sources/SDL2Sharp/Video/RendererInfo.cs b/sources/SDL2Sharp/Video/RendererInfo.cs index a339e4eb..e322acec 100644 --- a/sources/SDL2Sharp/Video/RendererInfo.cs +++ b/sources/SDL2Sharp/Video/RendererInfo.cs @@ -28,18 +28,18 @@ public sealed unsafe class RendererInfo { private readonly SDL_RendererInfo _handle; - private readonly Lazy> _textureFormats; + private readonly Lazy> _textureFormats; public RendererInfo(SDL_RendererInfo handle) { _handle = handle; - _textureFormats = new Lazy>(() => + _textureFormats = new Lazy>(() => { var numTextureFormats = (int)_handle.num_texture_formats; - var textureFormats = new List(numTextureFormats); + var textureFormats = new List(numTextureFormats); for (var index = 0; index < numTextureFormats; ++index) { - textureFormats.Add((PixelFormatEnum)_handle.texture_formats[index]); + textureFormats.Add((PixelFormat)_handle.texture_formats[index]); } return textureFormats.AsReadOnly(); }); @@ -49,7 +49,7 @@ public RendererInfo(SDL_RendererInfo handle) public RendererFlags Flags => (RendererFlags)_handle.flags; - public IReadOnlyList TextureFormats => _textureFormats.Value; + public IReadOnlyList TextureFormats => _textureFormats.Value; public int MaxTextureWidth => _handle.max_texture_width; diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs index 958d2cf2..1e4f514e 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -31,7 +31,7 @@ public sealed unsafe class Surface : IDisposable private readonly bool _freeHandle; - public PixelFormat Format => new(_handle->format, false); + public PixelFormatDescriptor Format => new(_handle->format, false); public int Width => _handle->w; @@ -67,7 +67,7 @@ internal Surface(SDL_Surface* handle, bool freeHandle) _freeHandle = freeHandle; } - public Surface(int width, int height, PixelFormatEnum format) + public Surface(int width, int height, PixelFormat format) : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) { } @@ -75,7 +75,7 @@ public Surface(int width, int height, uint redMask, uint greenMask, uint blueMas : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) { } - public Surface(void* pixels, int width, int height, int pitch, PixelFormatEnum format) + public Surface(void* pixels, int width, int height, int pitch, PixelFormat format) : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) { } @@ -123,7 +123,7 @@ public void Blit(Surface surface) ); } - public Surface ConvertTo(PixelFormatEnum format) + public Surface ConvertTo(PixelFormat format) { ThrowWhenDisposed(); @@ -139,8 +139,8 @@ public void FillRect(uint color) ); } - public void WithLock(WithLockPackedImageCallback callback) - where TPackedColor : struct + public void WithLock(SurfaceLockCallback callback) + where TPackedPixelFormat : struct { ThrowWhenDisposed(); @@ -152,10 +152,10 @@ public void WithLock(WithLockPackedImageCallback cal ); } - var bytesPerPixel = Marshal.SizeOf(); + var bytesPerPixel = Marshal.SizeOf(); var pitchInBytes = _handle->pitch; var pitch = pitchInBytes / bytesPerPixel; - var pixels = new PackedImage(_handle->pixels, _handle->w, _handle->h, pitch); + var pixels = new PackedImage(_handle->pixels, _handle->h, _handle->w, pitch); callback.Invoke(pixels); diff --git a/sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs b/sources/SDL2Sharp/Video/SurfaceLockCallback.cs similarity index 86% rename from sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs rename to sources/SDL2Sharp/Video/SurfaceLockCallback.cs index 0107876d..eefd164d 100644 --- a/sources/SDL2Sharp/Video/WithLockIyuvImageCallback.cs +++ b/sources/SDL2Sharp/Video/SurfaceLockCallback.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,5 +20,6 @@ namespace SDL2Sharp.Video { - public delegate void WithLockIyuvImageCallback(IyuvImage pixels); + public delegate void SurfaceLockCallback(PackedImage pixels) + where TPacketColor : struct; } diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs index 8d08492b..1aece11b 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,15 +19,16 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Collections.Generic; using SDL2Sharp.Interop; namespace SDL2Sharp.Video { - public sealed class Surface : IDisposable where TPackedColor : struct + public sealed class Surface : IDisposable where TPackedPixelFormat : struct { private Surface _surface; - public PixelFormat Format => _surface.Format; + public PixelFormatDescriptor Format => _surface.Format; public int Width => _surface.Width; @@ -35,8 +36,10 @@ public sealed class Surface : IDisposable where TPackedColor : str public int Pitch => _surface.Pitch; + public IEnumerable? Size { get; internal set; } + public Surface(int width, int height) - : this(new Surface(width, height, (PixelFormatEnum)PackedColorAttribute.GetPixelFormatOf())) + : this(new Surface(width, height, (PixelFormat)PixelFormatAttribute.GetPixelFormatOf())) { } internal unsafe Surface(SDL_Surface* surface) @@ -70,7 +73,7 @@ private void Dispose(bool _) _surface = null!; } - public void Blit(Surface surface) + public void Blit(Surface surface) { ThrowWhenDisposed(); @@ -86,8 +89,8 @@ public Surface Convert() where TTargetColor : struct { ThrowWhenDisposed(); - var targetPixelFormat = PackedColorAttribute.GetPixelFormatOf(); - var targetSurface = _surface.ConvertTo((PixelFormatEnum)targetPixelFormat); + var targetPixelFormat = PixelFormatAttribute.GetPixelFormatOf(); + var targetSurface = _surface.ConvertTo((PixelFormat)targetPixelFormat); return new Surface(targetSurface); } @@ -98,7 +101,7 @@ public void FillRect(uint color) _surface.FillRect(color); } - public void WithLock(WithLockPackedImageCallback callback) + public void WithLock(SurfaceLockCallback callback) { _surface.WithLock(callback); } @@ -111,7 +114,7 @@ private void ThrowWhenDisposed() } } - public static implicit operator Surface(Surface surface) + public static implicit operator Surface(Surface surface) { if (surface is null) { diff --git a/sources/SDL2Sharp/Video/Texture.cs b/sources/SDL2Sharp/Video/Texture.cs index 71a9372e..43212d0a 100644 --- a/sources/SDL2Sharp/Video/Texture.cs +++ b/sources/SDL2Sharp/Video/Texture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,22 +19,23 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.InteropServices; using SDL2Sharp.Interop; namespace SDL2Sharp.Video { public sealed unsafe class Texture : IDisposable { + public delegate void LockToSurfaceCallback(Surface pixels); + private SDL_Texture* _handle; - public PixelFormatEnum Format + public PixelFormat Format { get { uint format; Error.ThrowOnFailure(SDL.QueryTexture(_handle, &format, null, null, null)); - return (PixelFormatEnum)format; + return (PixelFormat)format; } } @@ -126,75 +127,17 @@ private void Dispose(bool _) _handle = null; } - public void WithLock(WithLockPackedImageCallback callback) - where TPackedColor : struct - { - WithLock(0, 0, Width, Height, callback); - } - - public void WithLock(Rectangle rectangle, WithLockPackedImageCallback callback) - where TPackedColor : struct - { - WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - } - - public void WithLock(int x, int y, int width, int height, WithLockPackedImageCallback callback) - where TPackedColor : struct - { - ThrowWhenDisposed(); - - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - void* pixels; - int pitchInBytes; - Error.ThrowOnFailure( - SDL.LockTexture(_handle, &rect, &pixels, &pitchInBytes) - ); - - var bytesPerPixel = Marshal.SizeOf(); - var pitch = pitchInBytes / bytesPerPixel; - var image = new PackedImage(pixels, height, width, pitch); - callback.Invoke(image); - SDL.UnlockTexture(_handle); - } - - public void WithLock(WithLockYv12ImageCallback callback) - { - WithLock(0, 0, Width, Height, callback); - } - - public void WithLock(Rectangle rectangle, WithLockYv12ImageCallback callback) - { - WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - } - - public void WithLock(int x, int y, int width, int height, WithLockYv12ImageCallback callback) - { - ThrowWhenDisposed(); - - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - void* pixels; - int pitch; - Error.ThrowOnFailure( - SDL.LockTexture(_handle, &rect, &pixels, &pitch) - ); - - var image = new Yv12Image(pixels, height, width, pitch); - callback.Invoke(image); - SDL.UnlockTexture(_handle); - } - - - public void WithLock(WithLockSurfaceCallback callback) + public void WithLock(LockToSurfaceCallback callback) { WithLock(0, 0, Width, Height, callback); } - public void WithLock(Rectangle rectangle, WithLockSurfaceCallback callback) + public void WithLock(Rectangle rectangle, LockToSurfaceCallback callback) { WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); } - public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallback callback) + public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback callback) { ThrowWhenDisposed(); @@ -208,33 +151,6 @@ public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallbac SDL.UnlockTexture(_handle); } - public void WithLock(WithLockSurfaceCallback callback) - where TPackedColor : struct - { - WithLock(0, 0, Width, Height, callback); - } - - public void WithLock(Rectangle rectangle, WithLockSurfaceCallback callback) - where TPackedColor : struct - { - WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - } - - public void WithLock(int x, int y, int width, int height, WithLockSurfaceCallback callback) - where TPackedColor : struct - { - ThrowWhenDisposed(); - - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - SDL_Surface* surfaceHandle; - Error.ThrowOnFailure( - SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) - ); - var surface = new Surface(surfaceHandle, false); - callback.Invoke(surface); - SDL.UnlockTexture(_handle); - } - private void ThrowWhenDisposed() { if (_handle is null) diff --git a/sources/SDL2Sharp/Video/TextureAccess.cs b/sources/SDL2Sharp/Video/TextureAccess.cs index bf0b7f71..962cc3ca 100644 --- a/sources/SDL2Sharp/Video/TextureAccess.cs +++ b/sources/SDL2Sharp/Video/TextureAccess.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs new file mode 100644 index 00000000..32bffe96 --- /dev/null +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -0,0 +1,69 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Video +{ + public static class TextureExtensions + { + public static PackedTexture AsPacked(this Texture texture) + where TPacketColor : struct + { + return new PackedTexture(texture); + } + + public static YuvTexture AsIYUV(this Texture texture) + { + if (texture.Format != PixelFormat.IYUV) + { + throw new ArgumentException("Texture is not in IYUV color format.", nameof(texture)); + } + return new YuvTexture(texture); + } + + public static Nv12Texture AsNV12(this Texture texture) + { + if (texture.Format != PixelFormat.NV12) + { + throw new ArgumentException("Texture is not in NV12 color format.", nameof(texture)); + } + return new Nv12Texture(texture); + } + + public static Nv21Texture AsNV21(this Texture texture) + { + if (texture.Format != PixelFormat.NV21) + { + throw new ArgumentException("Texture is not in NV21 color format.", nameof(texture)); + } + return new Nv21Texture(texture); + } + + public static YuvTexture AsYV12(this Texture texture) + { + if (texture.Format != PixelFormat.YV12) + { + throw new ArgumentException("Texture is not in YV12 color format.", nameof(texture)); + } + return new YuvTexture(texture); + } + } +} diff --git a/sources/SDL2Sharp/Video/Window.cs b/sources/SDL2Sharp/Video/Window.cs index 49baccad..d637d0ab 100644 --- a/sources/SDL2Sharp/Video/Window.cs +++ b/sources/SDL2Sharp/Video/Window.cs @@ -172,7 +172,7 @@ public Size ClientSize } } - public PixelFormatEnum PixelFormat + public PixelFormat PixelFormat { get { @@ -180,7 +180,7 @@ public PixelFormatEnum PixelFormat var pixelFormat = SDL.GetWindowPixelFormat(_handle); Error.ThrowOnFailure(pixelFormat); - return (PixelFormatEnum)pixelFormat; + return (PixelFormat)pixelFormat; } } diff --git a/sources/SDL2Sharp/Video/YuvImage.cs b/sources/SDL2Sharp/Video/YuvImage.cs new file mode 100644 index 00000000..3ef28be7 --- /dev/null +++ b/sources/SDL2Sharp/Video/YuvImage.cs @@ -0,0 +1,103 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; + +namespace SDL2Sharp.Video +{ + public readonly ref struct YuvImage where TYuvPixelFormat : IYuvPixelFormat, new() + { + private static readonly TYuvPixelFormat _format = new(); + + private readonly ImagePlane _yPlane; + + private readonly ImagePlane _uPlane; + + private readonly ImagePlane _vPlane; + + public ImagePlane Y => _yPlane; + + public ImagePlane U => _uPlane; + + public ImagePlane V => _vPlane; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Height; + } + + public unsafe YuvImage(void* pixels, int width, int height, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + var yPlaneHeight = _format.GetYPlaneHeight(height); + var yPlaneWidth = _format.GetYPlaneWidth(width); + var yPlanePitch = _format.GetYPlanePitch(pitch); + var yPlaneOffset = _format.GetYPlaneOffset(width, height, pitch); + var yPlanePixels = Unsafe.Add(pixels, yPlaneOffset); + _yPlane = new ImagePlane(yPlanePixels, yPlaneWidth, yPlaneHeight, yPlanePitch); + + var uPlaneHeight = _format.GetUPlaneHeight(height); + var uPlaneWidth = _format.GetUPlaneWidth(width); + var uPlanePitch = _format.GetUPlanePitch(pitch); + var uPlaneOffset = _format.GetUPlaneOffset(width, height, pitch); + var uPlanePixels = Unsafe.Add(pixels, uPlaneOffset); + _uPlane = new ImagePlane(uPlanePixels, uPlaneWidth, uPlaneHeight, uPlanePitch); + + var vPlaneHeight = _format.GetVPlaneHeight(height); + var vPlaneWidth = _format.GetVPlaneWidth(width); + var vPlanePitch = _format.GetVPlanePitch(pitch); + var vPlaneOffset = _format.GetVPlaneOffset(width, height, pitch); + var vPlanePixels = Unsafe.Add(pixels, vPlaneOffset); + _vPlane = new ImagePlane(vPlanePixels, vPlaneWidth, vPlaneHeight, vPlanePitch); + } + } +} diff --git a/sources/SDL2Sharp/Video/Yv12Texture.cs b/sources/SDL2Sharp/Video/YuvTexture.cs similarity index 58% rename from sources/SDL2Sharp/Video/Yv12Texture.cs rename to sources/SDL2Sharp/Video/YuvTexture.cs index 1a547cdd..64025d13 100644 --- a/sources/SDL2Sharp/Video/Yv12Texture.cs +++ b/sources/SDL2Sharp/Video/YuvTexture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,14 +19,20 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public sealed unsafe partial class Yv12Texture : IDisposable + public sealed unsafe partial class YuvTexture : IDisposable where TYuvPixelFormat : IYuvPixelFormat, new() { + public delegate void LockCallback(YuvImage pixels); + private Texture _texture; - public PackedPixelFormat Format => (PackedPixelFormat)_texture.Format; + public PixelFormat Format => _texture.Format; public TextureAccess Access => _texture.Access; @@ -43,12 +49,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal Yv12Texture(Texture texture) + internal YuvTexture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~Yv12Texture() + ~YuvTexture() { Dispose(false); } @@ -66,19 +72,41 @@ private void Dispose(bool _) _texture = null!; } - public void WithLock(WithLockYv12ImageCallback callback) + public void WithLock(LockCallback callback) { WithLock(0, 0, Width, Height, callback); } - public void WithLock(Rectangle rectangle, WithLockYv12ImageCallback callback) + public void WithLock(Rectangle rectangle, LockCallback callback) { WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); } - public void WithLock(int x, int y, int width, int height, WithLockYv12ImageCallback callback) + public void WithLock(int x, int y, int width, int height, LockCallback callback) + { + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitch; + Error.ThrowOnFailure( + SDL.LockTexture(_texture, &rect, &pixels, &pitch) + ); + + var image = new YuvImage(pixels, width, height, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_texture); + } + + public void Update(YuvImage image) { - _texture.WithLock(x, y, width, height, callback); + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); + var yPitch = image.Y.Width * Marshal.SizeOf(); + var uPlane = (byte*)Unsafe.AsPointer(ref image.U.DangerousGetReference()); + var uPitch = image.U.Width * Marshal.SizeOf(); + var vPlane = (byte*)Unsafe.AsPointer(ref image.V.DangerousGetReference()); + var vPitch = image.V.Width * Marshal.SizeOf(); + SDL.UpdateYUVTexture(_texture, null, yPlane, yPitch, uPlane, uPitch, vPlane, vPitch); } private void ThrowWhenDisposed() @@ -89,7 +117,7 @@ private void ThrowWhenDisposed() } } - public static implicit operator Texture(Yv12Texture texture) + public static implicit operator Texture(YuvTexture texture) { if (texture is null) { diff --git a/sources/SDL2Sharp/Video/Yv12.cs b/sources/SDL2Sharp/Video/Yv12.cs new file mode 100644 index 00000000..5877341e --- /dev/null +++ b/sources/SDL2Sharp/Video/Yv12.cs @@ -0,0 +1,88 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video +{ + [PixelFormat(PixelFormat.YV12)] + public readonly struct Yv12 : IYuvPixelFormat + { + public int GetYPlaneWidth(int imageWidth) + { + return imageWidth; + } + + public int GetYPlaneHeight(int imageHeight) + { + return imageHeight; + } + + public int GetYPlanePitch(int imagePitch) + { + return imagePitch; + } + + public int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return 0; + } + + public int GetVPlaneWidth(int imageWidth) + { + return GetYPlaneHeight(imageWidth) / 2; + } + + public int GetVPlaneHeight(int imageHeight) + { + return GetYPlaneHeight(imageHeight) / 2; + } + + public int GetVPlanePitch(int imagePitch) + { + return GetYPlanePitch(imagePitch) / 2; + } + + public int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) + + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); + } + + public int GetUPlaneWidth(int imageWidth) + { + return GetVPlaneWidth(imageWidth); + } + + public int GetUPlaneHeight(int imageHeight) + { + return GetVPlaneHeight(imageHeight); + } + + public int GetUPlanePitch(int imagePitch) + { + return GetVPlanePitch(imagePitch); + } + + public int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + { + return GetVPlaneOffset(imageWidth, imageHeight, imagePitch) + + GetVPlaneHeight(imageHeight) * GetVPlanePitch(imagePitch); + } + } +} diff --git a/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs b/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs new file mode 100644 index 00000000..3e063e2b --- /dev/null +++ b/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs @@ -0,0 +1,47 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Video.Colors; +using Xunit; + +namespace SDL2Sharp.Tests.Colors +{ + public static class Argb2101010Tests + { + [Fact] + public static void SelfEquality() + { +#pragma warning disable CS1718 // Comparison made to same variable + var color = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + Assert.True(color == color); + Assert.False(color != color); +#pragma warning restore CS1718 // Comparison made to same variable + } + + [Fact] + public static void Equality() + { + var a = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + var b = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + Assert.True(a == b); + Assert.False(a != b); + } + } +} diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs index 627fcd90..24234985 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -18,72 +18,236 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using SDL2Sharp.Video; using SDL2Sharp.Video.Colors; using Xunit; namespace SDL2Sharp.Tests { - public sealed class PackedTextureTests + public static class PackedTextureTests { + private static readonly Random _random = new(); + [Fact] - public void CreatePackedTextureOfArgb8888() - { - var color = new Argb8888(255, 255, 255, 255); + public static void WriteAndReadAbgr1555() => WriteAndRead + ( + () => Abgr1555.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreatePackedTextureOfArgb8888", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); - } + [Fact] + public static void WriteAndReadAbgr4444() => WriteAndRead + ( + () => Abgr4444.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); [Fact] - public void CreatePackedTextureOfYUY2() - { - var color = new Yuy2(255, 255, 255, 255); + public static void WriteAndReadAbgr8888() => WriteAndRead + ( + () => Abgr8888.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreatePackedTextureOfYUY2", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); - } + [Fact] + public static void WriteAndReadArgb1555() => WriteAndRead + ( + () => Argb1555.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); [Fact] - public void CreatePackedTextureOfYVYU() - { - var color = new Yvyu(255, 255, 255, 255); + public static void WriteAndReadArgb2101010() => WriteAndRead + ( + () => Argb2101010.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreatePackedTextureOfYVYU", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); - } + [Fact] + public static void WriteAndReadArgb4444() => WriteAndRead + ( + () => Argb4444.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); [Fact] - public void CreatePackedTextureOfUYVY() - { - var color = new Uyvy(255, 255, 255, 255); + public static void WriteAndReadArgb8888() => WriteAndRead( + () => Argb8888.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadRgba8888() => WriteAndRead( + () => new Rgba8888( + a: (byte)_random.Next(0, 256), + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadBgr565() => WriteAndRead( + () => Bgr565.FromRGB( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256) + ) + ); + [Fact] + public static void WriteAndReadBgra4444() => WriteAndRead( + () => Bgra4444.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadBgra5551() => WriteAndRead( + () => Bgra4444.FromRGBA( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadBgra8888() => WriteAndRead( + () => new Bgra8888( + b: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + r: (byte)_random.Next(0, 256), + a: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadRgb332() => WriteAndRead( + () => Rgb332.FromRGB( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256) + ) + ); + + [Fact] + public static void WriteAndReadRgb565() => WriteAndRead( + () => Rgb565.FromRGB( + r: (byte)_random.Next(0, 256), + g: (byte)_random.Next(0, 256), + b: (byte)_random.Next(0, 256) + ) + ); + + private static void WriteAndRead(Func colorGenerator) + where TPackedPixelFormat : struct, IEquatable + { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreatePackedTextureOfUYVY", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); + using var window = videoSystem.CreateWindow("PackedTextureTests", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(RendererFlags.Software | RendererFlags.TargetTexture); + using var sourceTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); + using var targetTexture = renderer.CreatePackedTexture(TextureAccess.Target, renderer.OutputSize); + var sourceImage = GenerateImage(renderer.OutputSize, colorGenerator); + + sourceTexture.Update(sourceImage); + + //sourceTexture.WithLock(pixels => + //{ + // for (var y = 0; y < pixels.Height; y++) + // { + // for (var x = 0; x < pixels.Width; x++) + // { + // pixels[x, y] = sourceImage[x, y]; + // } + // } + //}); + + renderer.Target = targetTexture; + renderer.Copy(sourceTexture); renderer.Present(); + + var targetImage = renderer.ReadPixels(); + + Assert.Equal(sourceImage.Size, targetImage.Size); + Assert.Equal(sourceImage.Height, targetImage.Height); + Assert.Equal(sourceImage.Width, targetImage.Width); + Assert.Equal(sourceImage, targetImage, (expectedImage, actualImage) => + { + if (expectedImage is null && actualImage is null) + { + return true; + } + + if (expectedImage is null || actualImage is null) + { + return false; + } + + if (expectedImage.Size != actualImage.Size) + { + return false; + } + + for (var y = 0; y < expectedImage.Height; y++) + { + for (var x = 0; x < expectedImage.Width; x++) + { + if (!expectedImage[x, y].Equals(actualImage[x, y])) + { + return false; + } + } + } + + return true; + }); + } + + private static PackedMemoryImage GenerateImage(Size size, Func createRandomColor) where TColor : struct + { + var image = new PackedMemoryImage(size.Width, size.Height); + for (var y = 0; y < image.Height; y++) + { + for (var x = 0; x < image.Width; x++) + { + image[x, y] = createRandomColor(); + } + } + return image; } } } diff --git a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs index 257fd860..9015a22d 100644 --- a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using SDL2Sharp.Video; +using SDL2Sharp.Video.Colors; using Xunit; namespace SDL2Sharp.Tests @@ -26,18 +27,22 @@ namespace SDL2Sharp.Tests public sealed class PlanarTextureTests { [Fact] - public void CreateYv12Texture() + public void WriteAndReadYV12() { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateYv12Texture", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(RendererFlags.Software); - using var texture = renderer.CreateYv12Texture(TextureAccess.Streaming, renderer.OutputSize); + using var window = videoSystem.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); + using var renderer = window.CreateRenderer(); + using var texture = renderer.CreateYuvTexture(TextureAccess.Streaming, renderer.OutputSize); + + var y = new Y8(255); + var u = new U8(128); + var v = new V8(128); texture.WithLock(pixels => { - pixels.Y.Fill(255); - pixels.U.Fill(255); - pixels.V.Fill(255); + pixels.Y.Fill(y); + pixels.U.Fill(u); + pixels.V.Fill(v); }); renderer.Copy(texture); renderer.Present(); diff --git a/tests/SDL2Sharp.Tests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/SurfaceTests.cs index 825fa287..424a043d 100644 --- a/tests/SDL2Sharp.Tests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/SurfaceTests.cs @@ -30,7 +30,7 @@ public sealed class SurfaceTests public void CreateSurface() { var color = new Argb8888(255, 255, 255, 255); - using var surface = new Surface(512, 512, PixelFormatEnum.ARGB8888); + using var surface = new Surface(512, 512, PixelFormat.ARGB8888); surface.WithLock(pixels => pixels.Fill(color)); } diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index 26fa64a2..e04ca55b 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -30,81 +30,104 @@ public sealed class TextureTests [Fact] public void CreateTextureOfArgb8888() { - var color = new Argb8888(255, 255, 255, 255); - - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateTextureOfArgb8888", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(PixelFormatEnum.ARGB8888, TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); + WithRenderer(renderer => + { + using var texture = renderer.CreateTexture(PixelFormat.ARGB8888, TextureAccess.Streaming, renderer.OutputSize); + using var packedTexture = texture.AsPacked(); + var color = new Argb8888(255, 255, 255, 255); + packedTexture.WithLock(pixels => pixels.Fill(color)); + renderer.Copy(texture); + renderer.Present(); + }); } [Fact] - public void CreateTextureOfYUY2() + public void CreateTextureOfIYUV() { - var color = new Yuy2(255, 255, 255, 255); - - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateTextureOfYUY2", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(PixelFormatEnum.YUY2, TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); + WithRenderer(renderer => + { + using var texture = renderer.CreateTexture(PixelFormat.IYUV, TextureAccess.Streaming, renderer.OutputSize); + using var planarTexture = texture.AsIYUV(); + var y = new Y8(255); + var u = new U8(128); + var v = new V8(128); + planarTexture.WithLock(pixels => + { + pixels.Y.Fill(y); + pixels.U.Fill(u); + pixels.V.Fill(v); + }); + renderer.Copy(texture); + renderer.Present(); + }); } [Fact] - public void CreateTextureOfYVYU() + public void CreateTextureOfNV12() { - var color = new Yvyu(255, 255, 255, 255); - - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateTextureOfYVYU", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(PixelFormatEnum.YVYU, TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); + WithRenderer(renderer => + { + using var texture = renderer.CreateTexture(PixelFormat.NV12, TextureAccess.Streaming, renderer.OutputSize); + using var planarTexture = texture.AsNV12(); + var y = new Y8(255); + var uv = new UV88(128, 128); + planarTexture.WithLock(pixels => + { + pixels.Y.Fill(y); + pixels.UV.Fill(uv); + }); + renderer.Copy(texture); + renderer.Present(); + }); } [Fact] - public void CreateTextureOfUYVY() + public void CreateTextureOfNV21() { - var color = new Uyvy(255, 255, 255, 255); - - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateTextureOfUYVY", 640, 480, WindowFlags.Hidden); - using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(PixelFormatEnum.UYVY, TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock(pixels => pixels.Fill(color)); - renderer.Copy(texture); - renderer.Present(); + WithRenderer(renderer => + { + using var texture = renderer.CreateTexture(PixelFormat.NV21, TextureAccess.Streaming, renderer.OutputSize); + using var planarTexture = texture.AsNV21(); + var y = new Y8(255); + var vu = new VU88(128, 128); + planarTexture.WithLock(pixels => + { + pixels.Y.Fill(y); + pixels.VU.Fill(vu); + }); + renderer.Copy(texture); + renderer.Present(); + }); } [Fact] public void CreateTextureOfYV12() { - var color = new Uyvy(255, 255, 255, 255); + WithRenderer(renderer => + { + using var texture = renderer.CreateTexture(PixelFormat.YV12, TextureAccess.Streaming, renderer.OutputSize); + using var planarTexture = texture.AsYV12(); + var y = new Y8(255); + var u = new U8(128); + var v = new V8(128); + planarTexture.WithLock(pixels => + { + pixels.Y.Fill(y); + pixels.V.Fill(v); + pixels.U.Fill(u); + }); + renderer.Copy(texture); + renderer.Present(); + }); + } + private static void WithRenderer(Action test) + { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("CreateTextureOfYV12", 640, 480, WindowFlags.Hidden); + using var window = videoSystem.CreateWindow("TextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateTexture(PixelFormatEnum.YV12, TextureAccess.Streaming, renderer.OutputSize); - texture.WithLock((Yv12Image pixels) => - { - pixels.Y.Fill(255); - pixels.U.Fill(255); - pixels.V.Fill(255); - }); - renderer.Copy(texture); - renderer.Present(); + test(renderer); } } } From 49f2bea46669fd24465385424542d11163e44c3d Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 24 Jul 2024 12:56:11 +0200 Subject: [PATCH 33/62] Support .NET 8.0 only (Remove support for multiple frameworks). --- samples/AverageFrameRate/AverageFrameRate.csproj | 2 +- samples/BitmapViewer/BitmapViewer.csproj | 2 +- samples/ParticleSystem/ParticleSystem.csproj | 2 +- samples/PlasmaFractal/PlasmaFractal.csproj | 2 +- samples/RayTracer/RayTracer.csproj | 2 +- samples/SwirlStars/SwirlStars.csproj | 2 +- samples/TunnelEffect/TunnelEffect.csproj | 2 +- samples/WavePlayer/WavePlayer.csproj | 2 +- sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj | 2 +- sources/SDL2Sharp/SDL2Sharp.csproj | 2 +- tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj | 2 +- tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/AverageFrameRate/AverageFrameRate.csproj b/samples/AverageFrameRate/AverageFrameRate.csproj index 7b1f32cf..2a8fa539 100644 --- a/samples/AverageFrameRate/AverageFrameRate.csproj +++ b/samples/AverageFrameRate/AverageFrameRate.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 AnyCPU false diff --git a/samples/BitmapViewer/BitmapViewer.csproj b/samples/BitmapViewer/BitmapViewer.csproj index 83ae8c91..0b46e178 100644 --- a/samples/BitmapViewer/BitmapViewer.csproj +++ b/samples/BitmapViewer/BitmapViewer.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 AnyCPU false diff --git a/samples/ParticleSystem/ParticleSystem.csproj b/samples/ParticleSystem/ParticleSystem.csproj index 441e3869..26956d4a 100644 --- a/samples/ParticleSystem/ParticleSystem.csproj +++ b/samples/ParticleSystem/ParticleSystem.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0 + net8.0 AnyCPU false diff --git a/samples/PlasmaFractal/PlasmaFractal.csproj b/samples/PlasmaFractal/PlasmaFractal.csproj index 441e3869..26956d4a 100644 --- a/samples/PlasmaFractal/PlasmaFractal.csproj +++ b/samples/PlasmaFractal/PlasmaFractal.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0 + net8.0 AnyCPU false diff --git a/samples/RayTracer/RayTracer.csproj b/samples/RayTracer/RayTracer.csproj index 90cfdefd..2a8fa539 100644 --- a/samples/RayTracer/RayTracer.csproj +++ b/samples/RayTracer/RayTracer.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0 + net8.0 AnyCPU false diff --git a/samples/SwirlStars/SwirlStars.csproj b/samples/SwirlStars/SwirlStars.csproj index 90cfdefd..2a8fa539 100644 --- a/samples/SwirlStars/SwirlStars.csproj +++ b/samples/SwirlStars/SwirlStars.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0 + net8.0 AnyCPU false diff --git a/samples/TunnelEffect/TunnelEffect.csproj b/samples/TunnelEffect/TunnelEffect.csproj index 964bbd2a..e40e39f7 100644 --- a/samples/TunnelEffect/TunnelEffect.csproj +++ b/samples/TunnelEffect/TunnelEffect.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 AnyCPU false diff --git a/samples/WavePlayer/WavePlayer.csproj b/samples/WavePlayer/WavePlayer.csproj index 17a6d817..4748c446 100644 --- a/samples/WavePlayer/WavePlayer.csproj +++ b/samples/WavePlayer/WavePlayer.csproj @@ -2,7 +2,7 @@ WinExe - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 AnyCPU false diff --git a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj index 6038f918..4bb1cb40 100644 --- a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj +++ b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net461 + net8.0 AnyCPU Provides SDL2 bindings written in C#. SDL2 diff --git a/sources/SDL2Sharp/SDL2Sharp.csproj b/sources/SDL2Sharp/SDL2Sharp.csproj index 6ac1254f..d8e6b882 100644 --- a/sources/SDL2Sharp/SDL2Sharp.csproj +++ b/sources/SDL2Sharp/SDL2Sharp.csproj @@ -9,7 +9,7 @@ - netstandard2.0;net461 + net8.0 AnyCPU Provides type safe wrappers for SDL2 bindings written in C#. SDL2 diff --git a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj index 4648d9fc..d0241604 100644 --- a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj +++ b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 false AnyCPU false diff --git a/tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj b/tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj index 5fb9dd4e..7378daf7 100644 --- a/tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj +++ b/tests/SDL2Sharp.Tests/SDL2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net7.0;net6.0;net462;net47;net471;net472;net48;net481 + net8.0 false AnyCPU false From b6a80d76d5cbe3497259f07a5da811ee8e314dff Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 24 Jul 2024 13:00:56 +0200 Subject: [PATCH 34/62] Generate interop code using latest codegen. --- build/Build/IGenerate.cs | 8 +- sources/SDL2Sharp.Interop/SDL.cs | 430 +++++++++--------- sources/SDL2Sharp.Interop/SDL_AudioCVT.cs | 27 +- sources/SDL2Sharp.Interop/SDL_AudioSpec.cs | 4 +- .../SDL_ControllerSensorEvent.cs | 12 +- sources/SDL2Sharp.Interop/SDL_Event.cs | 11 +- sources/SDL2Sharp.Interop/SDL_GUID.cs | 12 +- sources/SDL2Sharp.Interop/SDL_PixelFormat.cs | 10 +- sources/SDL2Sharp.Interop/SDL_RWops.cs | 17 +- .../SDL2Sharp.Interop/SDL_RendererFlags.cs | 5 +- sources/SDL2Sharp.Interop/SDL_RendererInfo.cs | 10 +- sources/SDL2Sharp.Interop/SDL_SensorEvent.cs | 12 +- .../SDL2Sharp.Interop/SDL_TextEditingEvent.cs | 12 +- .../SDL2Sharp.Interop/SDL_TextInputEvent.cs | 12 +- .../SDL2Sharp.Interop/SDL_TextureAccess.cs | 2 +- .../SDL_VirtualJoystickDesc.cs | 14 +- sources/SDL2Sharp/Audio/AudioDevice.cs | 20 +- sources/SDL2Sharp/Input/EventSubsystem.cs | 24 +- sources/SDL2Sharp/Video/Renderer.cs | 5 +- sources/SDL2Sharp/Video/Window.cs | 47 +- .../SDL_JoyBatteryEventTests.cs | 2 +- 21 files changed, 366 insertions(+), 330 deletions(-) diff --git a/build/Build/IGenerate.cs b/build/Build/IGenerate.cs index c1591965..af01bf2b 100644 --- a/build/Build/IGenerate.cs +++ b/build/Build/IGenerate.cs @@ -43,7 +43,7 @@ interface IGenerate : IBuild private void GenerateBindingsForSDL2() { - var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; + var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; @@ -58,7 +58,7 @@ private void GenerateBindingsForSDL2() ClangSharpPInvokeGenerator(settings => settings .SetConfig ( - compatible_codegen, + latest_codegen, generate_aggressive_inlining, generate_macro_bindings, generate_tests_xunit, @@ -334,7 +334,7 @@ private void GenerateBindingsForSDL2() private void GenerateBindingsForSDL2Image() { - var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; + var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; @@ -389,7 +389,7 @@ private void GenerateBindingsForSDL2Image() private void GenerateBindingsForSDL2TTF() { - var headerFile = RootDirectory / "sources" / "Build" / "Header.txt"; + var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; diff --git a/sources/SDL2Sharp.Interop/SDL.cs b/sources/SDL2Sharp.Interop/SDL.cs index ffe9f358..3812e4cc 100644 --- a/sources/SDL2Sharp.Interop/SDL.cs +++ b/sources/SDL2Sharp.Interop/SDL.cs @@ -330,19 +330,19 @@ public static unsafe partial class SDL public static extern int PushEvent(SDL_Event* @event); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetEventFilter", ExactSpelling = true)] - public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEventFilter", ExactSpelling = true)] - public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] IntPtr* filter, void** userdata); + public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]* filter, void** userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddEventWatch", ExactSpelling = true)] - public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelEventWatch", ExactSpelling = true)] - public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FilterEvents", ExactSpelling = true)] - public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EventState", ExactSpelling = true)] [return: NativeTypeName("Uint8")] @@ -402,535 +402,535 @@ public static unsafe partial class SDL public static extern SDL_bool GetHintBoolean([NativeTypeName("const char *")] sbyte* name, SDL_bool default_value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddHintCallback", ExactSpelling = true)] - public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); + public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelHintCallback", ExactSpelling = true)] - public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); + public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearHints", ExactSpelling = true)] public static extern void ClearHints(); [NativeTypeName("#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"SDL_ACCELEROMETER_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x4F, 0x4D, 0x45, 0x54, 0x45, 0x52, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => "SDL_ACCELEROMETER_AS_JOYSTICK"u8; [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x54, 0x41, 0x42, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x42, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"u8; [NativeTypeName("#define SDL_HINT_ALLOW_TOPMOST \"SDL_ALLOW_TOPMOST\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x4F, 0x50, 0x4D, 0x4F, 0x53, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => "SDL_ALLOW_TOPMOST"u8; [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x4D, 0x41, 0x49, 0x4E, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"u8; [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"u8; [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => "SDL_ANDROID_BLOCK_ON_PAUSE"u8; [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x00 }; + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"u8; [NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x54, 0x52, 0x41, 0x50, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => "SDL_ANDROID_TRAP_BACK_BUTTON"u8; [NativeTypeName("#define SDL_HINT_APP_NAME \"SDL_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_APP_NAME => "SDL_APP_NAME"u8; [NativeTypeName("#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS \"SDL_APPLE_TV_CONTROLLER_UI_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x49, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"u8; [NativeTypeName("#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION \"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x52, 0x4F, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"u8; [NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4F, 0x52, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => "SDL_AUDIO_CATEGORY"u8; [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"SDL_AUDIO_DEVICE_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => "SDL_AUDIO_DEVICE_APP_NAME"u8; [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"SDL_AUDIO_DEVICE_STREAM_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => "SDL_AUDIO_DEVICE_STREAM_NAME"u8; [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x52, 0x4F, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => "SDL_AUDIO_DEVICE_STREAM_ROLE"u8; [NativeTypeName("#define SDL_HINT_AUDIO_RESAMPLING_MODE \"SDL_AUDIO_RESAMPLING_MODE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x52, 0x45, 0x53, 0x41, 0x4D, 0x50, 0x4C, 0x49, 0x4E, 0x47, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => "SDL_AUDIO_RESAMPLING_MODE"u8; [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_JOYSTICKS \"SDL_AUTO_UPDATE_JOYSTICKS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => "SDL_AUTO_UPDATE_JOYSTICKS"u8; [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_SENSORS \"SDL_AUTO_UPDATE_SENSORS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x53, 0x45, 0x4E, 0x53, 0x4F, 0x52, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => "SDL_AUTO_UPDATE_SENSORS"u8; [NativeTypeName("#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT \"SDL_BMP_SAVE_LEGACY_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x42, 0x4D, 0x50, 0x5F, 0x53, 0x41, 0x56, 0x45, 0x5F, 0x4C, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => "SDL_BMP_SAVE_LEGACY_FORMAT"u8; [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] - public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x4C, 0x41, 0x59, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x4F, 0x55, 0x4E, 0x44, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => "SDL_DISPLAY_USABLE_BOUNDS"u8; [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x49, 0x46, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => "SDL_EMSCRIPTEN_ASYNCIFY"u8; [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x5F, 0x45, 0x4C, 0x45, 0x4D, 0x45, 0x4E, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"u8; [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => "SDL_ENABLE_SCREEN_KEYBOARD"u8; [NativeTypeName("#define SDL_HINT_ENABLE_STEAM_CONTROLLERS \"SDL_ENABLE_STEAM_CONTROLLERS\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => "SDL_ENABLE_STEAM_CONTROLLERS"u8; [NativeTypeName("#define SDL_HINT_EVENT_LOGGING \"SDL_EVENT_LOGGING\"")] - public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x5F, 0x4C, 0x4F, 0x47, 0x47, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => "SDL_EVENT_LOGGING"u8; [NativeTypeName("#define SDL_HINT_FORCE_RAISEWINDOW \"SDL_HINT_FORCE_RAISEWINDOW\"")] - public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x41, 0x49, 0x53, 0x45, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x00 }; + public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => "SDL_HINT_FORCE_RAISEWINDOW"u8; [NativeTypeName("#define SDL_HINT_FRAMEBUFFER_ACCELERATION \"SDL_FRAMEBUFFER_ACCELERATION\"")] - public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => "SDL_FRAMEBUFFER_ACCELERATION"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG \"SDL_GAMECONTROLLERCONFIG\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => "SDL_GAMECONTROLLERCONFIG"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"SDL_GAMECONTROLLERCONFIG_FILE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => "SDL_GAMECONTROLLERCONFIG_FILE"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLERTYPE \"SDL_GAMECONTROLLERTYPE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x54, 0x59, 0x50, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => "SDL_GAMECONTROLLERTYPE"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES \"SDL_GAMECONTROLLER_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => "SDL_GAMECONTROLLER_IGNORE_DEVICES"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT \"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x5F, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"u8; [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"SDL_GAMECONTROLLER_USE_BUTTON_LABELS\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"u8; [NativeTypeName("#define SDL_HINT_GRAB_KEYBOARD \"SDL_GRAB_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => "SDL_GRAB_KEYBOARD"u8; [NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => "SDL_HIDAPI_IGNORE_DEVICES"u8; [NativeTypeName("#define SDL_HINT_IDLE_TIMER_DISABLED \"SDL_IOS_IDLE_TIMER_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x49, 0x44, 0x4C, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => "SDL_IOS_IDLE_TIMER_DISABLED"u8; [NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")] - public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => "SDL_IME_INTERNAL_EDITING"u8; [NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")] - public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x5F, 0x55, 0x49, 0x00 }; + public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => "SDL_IME_SHOW_UI"u8; [NativeTypeName("#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"SDL_IME_SUPPORT_EXTENDED_TEXT\"")] - public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x55, 0x50, 0x50, 0x4F, 0x52, 0x54, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => "SDL_IME_SUPPORT_EXTENDED_TEXT"u8; [NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")] - public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x49, 0x43, 0x41, 0x54, 0x4F, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => "SDL_IOS_HIDE_HOME_INDICATOR"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS \"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI \"SDL_JOYSTICK_HIDAPI\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => "SDL_JOYSTICK_HIDAPI"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"SDL_JOYSTICK_HIDAPI_GAMECUBE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => "SDL_JOYSTICK_HIDAPI_GAMECUBE"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE \"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x52, 0x41, 0x4B, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS \"SDL_JOYSTICK_HIDAPI_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => "SDL_JOYSTICK_HIDAPI_JOY_CONS"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS \"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x43, 0x4F, 0x4D, 0x42, 0x49, 0x4E, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x56, 0x45, 0x52, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LUNA \"SDL_JOYSTICK_HIDAPI_LUNA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4C, 0x55, 0x4E, 0x41, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => "SDL_JOYSTICK_HIDAPI_LUNA"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC \"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4E, 0x49, 0x4E, 0x54, 0x45, 0x4E, 0x44, 0x4F, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x48, 0x49, 0x45, 0x4C, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => "SDL_JOYSTICK_HIDAPI_SHIELD"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS3 \"SDL_JOYSTICK_HIDAPI_PS3\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x33, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => "SDL_JOYSTICK_HIDAPI_PS3"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4 \"SDL_JOYSTICK_HIDAPI_PS4\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => "SDL_JOYSTICK_HIDAPI_PS4"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => "SDL_JOYSTICK_HIDAPI_PS5"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STADIA \"SDL_JOYSTICK_HIDAPI_STADIA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x41, 0x44, 0x49, 0x41, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => "SDL_JOYSTICK_HIDAPI_STADIA"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => "SDL_JOYSTICK_HIDAPI_STEAM"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => "SDL_JOYSTICK_HIDAPI_SWITCH"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED \"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x43, 0x4F, 0x4E, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII \"SDL_JOYSTICK_HIDAPI_WII\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => "SDL_JOYSTICK_HIDAPI_WII"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX \"SDL_JOYSTICK_HIDAPI_XBOX\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => "SDL_JOYSTICK_HIDAPI_XBOX"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 \"SDL_JOYSTICK_HIDAPI_XBOX_360\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => "SDL_JOYSTICK_HIDAPI_XBOX_360"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS \"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x57, 0x49, 0x52, 0x45, 0x4C, 0x45, 0x53, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE \"SDL_JOYSTICK_HIDAPI_XBOX_ONE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => "SDL_JOYSTICK_HIDAPI_XBOX_ONE"u8; [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED => "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT \"SDL_JOYSTICK_RAWINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => "SDL_JOYSTICK_RAWINPUT"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x43, 0x4F, 0x52, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"SDL_JOYSTICK_ROG_CHAKRAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x4F, 0x47, 0x5F, 0x43, 0x48, 0x41, 0x4B, 0x52, 0x41, 0x4D, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => "SDL_JOYSTICK_ROG_CHAKRAM"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_THREAD \"SDL_JOYSTICK_THREAD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => "SDL_JOYSTICK_THREAD"u8; [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5F, 0x44, 0x52, 0x4D, 0x5F, 0x4D, 0x41, 0x53, 0x54, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => "SDL_KMSDRM_REQUIRE_DRM_MASTER"u8; [NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => "SDL_JOYSTICK_DEVICE"u8; [NativeTypeName("#define SDL_HINT_LINUX_DIGITAL_HATS \"SDL_LINUX_DIGITAL_HATS\"")] - public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x54, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => "SDL_LINUX_DIGITAL_HATS"u8; [NativeTypeName("#define SDL_HINT_LINUX_HAT_DEADZONES \"SDL_LINUX_HAT_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x48, 0x41, 0x54, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => "SDL_LINUX_HAT_DEADZONES"u8; [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"SDL_LINUX_JOYSTICK_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => "SDL_LINUX_JOYSTICK_CLASSIC"u8; [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"SDL_LINUX_JOYSTICK_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => "SDL_LINUX_JOYSTICK_DEADZONES"u8; [NativeTypeName("#define SDL_HINT_MAC_BACKGROUND_APP \"SDL_MAC_BACKGROUND_APP\"")] - public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x41, 0x50, 0x50, 0x00 }; + public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => "SDL_MAC_BACKGROUND_APP"u8; [NativeTypeName("#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")] - public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x43, 0x54, 0x52, 0x4C, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x52, 0x49, 0x47, 0x48, 0x54, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x00 }; + public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"u8; [NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")] - public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x41, 0x54, 0x43, 0x48, 0x00 }; + public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => "SDL_MAC_OPENGL_ASYNC_DISPATCH"u8; [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"SDL_MOUSE_DOUBLE_CLICK_RADIUS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x44, 0x49, 0x55, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => "SDL_MOUSE_DOUBLE_CLICK_RADIUS"u8; [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => "SDL_MOUSE_DOUBLE_CLICK_TIME"u8; [NativeTypeName("#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH \"SDL_MOUSE_FOCUS_CLICKTHROUGH\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x54, 0x48, 0x52, 0x4F, 0x55, 0x47, 0x48, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => "SDL_MOUSE_FOCUS_CLICKTHROUGH"u8; [NativeTypeName("#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"SDL_MOUSE_NORMAL_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x4E, 0x4F, 0x52, 0x4D, 0x41, 0x4C, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => "SDL_MOUSE_NORMAL_SPEED_SCALE"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x43, 0x45, 0x4E, 0x54, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => "SDL_MOUSE_RELATIVE_MODE_CENTER"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => "SDL_MOUSE_RELATIVE_MODE_WARP"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SCALING \"SDL_MOUSE_RELATIVE_SCALING\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => "SDL_MOUSE_RELATIVE_SCALING"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => "SDL_MOUSE_RELATIVE_SPEED_SCALE"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE \"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => "SDL_MOUSE_RELATIVE_SYSTEM_SCALE"u8; [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x5F, 0x4D, 0x4F, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => "SDL_MOUSE_RELATIVE_WARP_MOTION"u8; [NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => "SDL_MOUSE_TOUCH_EVENTS"u8; [NativeTypeName("#define SDL_HINT_MOUSE_AUTO_CAPTURE \"SDL_MOUSE_AUTO_CAPTURE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => "SDL_MOUSE_AUTO_CAPTURE"u8; [NativeTypeName("#define SDL_HINT_NO_SIGNAL_HANDLERS \"SDL_NO_SIGNAL_HANDLERS\"")] - public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4E, 0x4F, 0x5F, 0x53, 0x49, 0x47, 0x4E, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => "SDL_NO_SIGNAL_HANDLERS"u8; [NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x45, 0x53, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => "SDL_OPENGL_ES_DRIVER"u8; [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_IOS_ORIENTATIONS\"")] - public static ReadOnlySpan SDL_HINT_ORIENTATIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_ORIENTATIONS => "SDL_IOS_ORIENTATIONS"u8; [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] - public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x4F, 0x4C, 0x4C, 0x5F, 0x53, 0x45, 0x4E, 0x54, 0x49, 0x4E, 0x45, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => "SDL_POLL_SENTINEL"u8; [NativeTypeName("#define SDL_HINT_PREFERRED_LOCALES \"SDL_PREFERRED_LOCALES\"")] - public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x52, 0x45, 0x44, 0x5F, 0x4C, 0x4F, 0x43, 0x41, 0x4C, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => "SDL_PREFERRED_LOCALES"u8; [NativeTypeName("#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION \"SDL_QTWAYLAND_CONTENT_ORIENTATION\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x4E, 0x54, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => "SDL_QTWAYLAND_CONTENT_ORIENTATION"u8; [NativeTypeName("#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS \"SDL_QTWAYLAND_WINDOW_FLAGS\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x4C, 0x41, 0x47, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => "SDL_QTWAYLAND_WINDOW_FLAGS"u8; [NativeTypeName("#define SDL_HINT_RENDER_BATCHING \"SDL_RENDER_BATCHING\"")] - public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x42, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => "SDL_RENDER_BATCHING"u8; [NativeTypeName("#define SDL_HINT_RENDER_LINE_METHOD \"SDL_RENDER_LINE_METHOD\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x4E, 0x45, 0x5F, 0x4D, 0x45, 0x54, 0x48, 0x4F, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => "SDL_RENDER_LINE_METHOD"u8; [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x31, 0x31, 0x5F, 0x44, 0x45, 0x42, 0x55, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => "SDL_RENDER_DIRECT3D11_DEBUG"u8; [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"SDL_RENDER_DIRECT3D_THREADSAFE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x53, 0x41, 0x46, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => "SDL_RENDER_DIRECT3D_THREADSAFE"u8; [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => "SDL_RENDER_DRIVER"u8; [NativeTypeName("#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"SDL_RENDER_LOGICAL_SIZE_MODE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => "SDL_RENDER_LOGICAL_SIZE_MODE"u8; [NativeTypeName("#define SDL_HINT_RENDER_OPENGL_SHADERS \"SDL_RENDER_OPENGL_SHADERS\"")] - public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => "SDL_RENDER_OPENGL_SHADERS"u8; [NativeTypeName("#define SDL_HINT_RENDER_SCALE_QUALITY \"SDL_RENDER_SCALE_QUALITY\"")] - public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x5F, 0x51, 0x55, 0x41, 0x4C, 0x49, 0x54, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => "SDL_RENDER_SCALE_QUALITY"u8; [NativeTypeName("#define SDL_HINT_RENDER_VSYNC \"SDL_RENDER_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => "SDL_RENDER_VSYNC"u8; [NativeTypeName("#define SDL_HINT_PS2_DYNAMIC_VSYNC \"SDL_PS2_DYNAMIC_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x53, 0x32, 0x5F, 0x44, 0x59, 0x4E, 0x41, 0x4D, 0x49, 0x43, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => "SDL_PS2_DYNAMIC_VSYNC"u8; [NativeTypeName("#define SDL_HINT_RETURN_KEY_HIDES_IME \"SDL_RETURN_KEY_HIDES_IME\"")] - public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x53, 0x5F, 0x49, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => "SDL_RETURN_KEY_HIDES_IME"u8; [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] - public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x50, 0x49, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => "SDL_RPI_VIDEO_LAYER"u8; [NativeTypeName("#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME\"")] - public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x5F, 0x49, 0x4E, 0x48, 0x49, 0x42, 0x49, 0x54, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"u8; [NativeTypeName("#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL\"")] - public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x45, 0x41, 0x4C, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"u8; [NativeTypeName("#define SDL_HINT_THREAD_PRIORITY_POLICY \"SDL_THREAD_PRIORITY_POLICY\"")] - public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x50, 0x52, 0x49, 0x4F, 0x52, 0x49, 0x54, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => "SDL_THREAD_PRIORITY_POLICY"u8; [NativeTypeName("#define SDL_HINT_THREAD_STACK_SIZE \"SDL_THREAD_STACK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x53, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => "SDL_THREAD_STACK_SIZE"u8; [NativeTypeName("#define SDL_HINT_TIMER_RESOLUTION \"SDL_TIMER_RESOLUTION\"")] - public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x52, 0x45, 0x53, 0x4F, 0x4C, 0x55, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => "SDL_TIMER_RESOLUTION"u8; [NativeTypeName("#define SDL_HINT_TOUCH_MOUSE_EVENTS \"SDL_TOUCH_MOUSE_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => "SDL_TOUCH_MOUSE_EVENTS"u8; [NativeTypeName("#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE \"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x56, 0x49, 0x54, 0x41, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"u8; [NativeTypeName("#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"SDL_TV_REMOTE_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => "SDL_TV_REMOTE_AS_JOYSTICK"u8; [NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => "SDL_VIDEO_ALLOW_SCREENSAVER"u8; [NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => "SDL_VIDEO_DOUBLE_BUFFER"u8; [NativeTypeName("#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x47, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x52, 0x41, 0x4E, 0x53, 0x50, 0x41, 0x52, 0x45, 0x4E, 0x43, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"u8; [NativeTypeName("#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT \"SDL_VIDEO_EXTERNAL_CONTEXT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x58, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => "SDL_VIDEO_EXTERNAL_CONTEXT"u8; [NativeTypeName("#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"SDL_VIDEO_HIGHDPI_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x48, 0x49, 0x47, 0x48, 0x44, 0x50, 0x49, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => "SDL_VIDEO_HIGHDPI_DISABLED"u8; [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x46, 0x55, 0x4C, 0x4C, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x53, 0x50, 0x41, 0x43, 0x45, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => "SDL_VIDEO_MAC_FULLSCREEN_SPACES"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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x49, 0x4E, 0x49, 0x4D, 0x49, 0x5A, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x4C, 0x4F, 0x53, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS => "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR \"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION \"SDL_VIDEO_WAYLAND_MODE_EMULATION\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => "SDL_VIDEO_WAYLAND_MODE_EMULATION"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP \"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5F, 0x50, 0x49, 0x58, 0x45, 0x4C, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"u8; [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"SDL_VIDEO_FOREIGN_WINDOW_OPENGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"u8; [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"SDL_VIDEO_FOREIGN_WINDOW_VULKAN\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x55, 0x4C, 0x4B, 0x41, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"u8; [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x5F, 0x44, 0x33, 0x44, 0x43, 0x4F, 0x4D, 0x50, 0x49, 0x4C, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => "SDL_VIDEO_WIN_D3DCOMPILER"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_FORCE_EGL \"SDL_VIDEO_X11_FORCE_EGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x45, 0x47, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => "SDL_VIDEO_X11_FORCE_EGL"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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x42, 0x59, 0x50, 0x41, 0x53, 0x53, 0x5F, 0x43, 0x4F, 0x4D, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x4F, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR => "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_PING \"SDL_VIDEO_X11_NET_WM_PING\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => "SDL_VIDEO_X11_NET_WM_PING"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"SDL_VIDEO_X11_WINDOW_VISUALID\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x49, 0x53, 0x55, 0x41, 0x4C, 0x49, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => "SDL_VIDEO_X11_WINDOW_VISUALID"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_XINERAMA \"SDL_VIDEO_X11_XINERAMA\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x49, 0x4E, 0x45, 0x52, 0x41, 0x4D, 0x41, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => "SDL_VIDEO_X11_XINERAMA"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_XRANDR \"SDL_VIDEO_X11_XRANDR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x52, 0x41, 0x4E, 0x44, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => "SDL_VIDEO_X11_XRANDR"u8; [NativeTypeName("#define SDL_HINT_VIDEO_X11_XVIDMODE \"SDL_VIDEO_X11_XVIDMODE\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x56, 0x49, 0x44, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => "SDL_VIDEO_X11_XVIDMODE"u8; [NativeTypeName("#define SDL_HINT_WAVE_FACT_CHUNK \"SDL_WAVE_FACT_CHUNK\"")] - public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x46, 0x41, 0x43, 0x54, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x00 }; + public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => "SDL_WAVE_FACT_CHUNK"u8; [NativeTypeName("#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE \"SDL_WAVE_RIFF_CHUNK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x52, 0x49, 0x46, 0x46, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => "SDL_WAVE_RIFF_CHUNK_SIZE"u8; [NativeTypeName("#define SDL_HINT_WAVE_TRUNCATION \"SDL_WAVE_TRUNCATION\"")] - public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x54, 0x52, 0x55, 0x4E, 0x43, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => "SDL_WAVE_TRUNCATION"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING \"SDL_WINDOWS_DISABLE_THREAD_NAMING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x4E, 0x41, 0x4D, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => "SDL_WINDOWS_DISABLE_THREAD_NAMING"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS \"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x4E, 0x55, 0x5F, 0x4D, 0x4E, 0x45, 0x4D, 0x4F, 0x4E, 0x49, 0x43, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => "SDL_WINDOWS_ENABLE_MENU_MNEMONICS"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x4C, 0x4F, 0x4F, 0x50, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => "SDL_WINDOWS_ENABLE_MESSAGELOOP"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS \"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4D, 0x55, 0x54, 0x45, 0x58, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x53, 0x45, 0x4D, 0x41, 0x50, 0x48, 0x4F, 0x52, 0x45, 0x5F, 0x4B, 0x45, 0x52, 0x4E, 0x45, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON \"SDL_WINDOWS_INTRESOURCE_ICON\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => "SDL_WINDOWS_INTRESOURCE_ICON"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"SDL_WINDOWS_INTRESOURCE_ICON_SMALL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x5F, 0x53, 0x4D, 0x41, 0x4C, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x4E, 0x4F, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x46, 0x34, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x33, 0x44, 0x39, 0x45, 0x58, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => "SDL_WINDOWS_USE_D3D9EX"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_AWARENESS \"SDL_WINDOWS_DPI_AWARENESS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x41, 0x57, 0x41, 0x52, 0x45, 0x4E, 0x45, 0x53, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => "SDL_WINDOWS_DPI_AWARENESS"u8; [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_SCALING \"SDL_WINDOWS_DPI_SCALING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => "SDL_WINDOWS_DPI_SCALING"u8; [NativeTypeName("#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x43, 0x55, 0x52, 0x53, 0x4F, 0x52, 0x5F, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"u8; [NativeTypeName("#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN \"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4E, 0x4F, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x5F, 0x57, 0x48, 0x45, 0x4E, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"u8; [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => "SDL_WINRT_HANDLE_BACK_BUTTON"u8; [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => "SDL_WINRT_PRIVACY_POLICY_LABEL"u8; [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x55, 0x52, 0x4C, 0x00 }; + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => "SDL_WINRT_PRIVACY_POLICY_URL"u8; [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] - public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x5F, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x00 }; + public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => "SDL_X11_FORCE_OVERRIDE_REDIRECT"u8; [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => "SDL_XINPUT_ENABLED"u8; [NativeTypeName("#define SDL_HINT_DIRECTINPUT_ENABLED \"SDL_DIRECTINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => "SDL_DIRECTINPUT_ENABLED"u8; [NativeTypeName("#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x4F, 0x4C, 0x44, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x4D, 0x41, 0x50, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"u8; [NativeTypeName("#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"SDL_AUDIO_INCLUDE_MONITORS\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x49, 0x4E, 0x43, 0x4C, 0x55, 0x44, 0x45, 0x5F, 0x4D, 0x4F, 0x4E, 0x49, 0x54, 0x4F, 0x52, 0x53, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => "SDL_AUDIO_INCLUDE_MONITORS"u8; [NativeTypeName("#define SDL_HINT_X11_WINDOW_TYPE \"SDL_X11_WINDOW_TYPE\"")] - public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => "SDL_X11_WINDOW_TYPE"u8; [NativeTypeName("#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"SDL_QUIT_ON_LAST_WINDOW_CLOSE\"")] - public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x55, 0x49, 0x54, 0x5F, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x53, 0x54, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x00 }; + public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => "SDL_QUIT_ON_LAST_WINDOW_CLOSE"u8; [NativeTypeName("#define SDL_HINT_VIDEODRIVER \"SDL_VIDEODRIVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_VIDEODRIVER => "SDL_VIDEODRIVER"u8; [NativeTypeName("#define SDL_HINT_AUDIODRIVER \"SDL_AUDIODRIVER\"")] - public static ReadOnlySpan SDL_HINT_AUDIODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + public static ReadOnlySpan SDL_HINT_AUDIODRIVER => "SDL_AUDIODRIVER"u8; [NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x45, 0x58, 0x00 }; + public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => "SDL_KMSDRM_DEVICE_INDEX"u8; [NativeTypeName("#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY \"SDL_TRACKPAD_IS_TOUCH_ONLY\"")] - public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x52, 0x41, 0x43, 0x4B, 0x50, 0x41, 0x44, 0x5F, 0x49, 0x53, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4F, 0x4E, 0x4C, 0x59, 0x00 }; + public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => "SDL_TRACKPAD_IS_TOUCH_ONLY"u8; [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockJoysticks", ExactSpelling = true)] public static extern void LockJoysticks(); @@ -1644,20 +1644,20 @@ public static unsafe partial class SDL [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWread", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr maxnum); + public static extern nuint RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint maxnum); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWwrite", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr num); + public static extern nuint RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint num); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWclose", ExactSpelling = true)] public static extern int RWclose(SDL_RWops* context); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile_RW", ExactSpelling = true)] - public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] UIntPtr* datasize, int freesrc); + public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] nuint* datasize, int freesrc); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile", ExactSpelling = true)] - public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] UIntPtr* datasize); + public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] nuint* datasize); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadU8", ExactSpelling = true)] [return: NativeTypeName("Uint8")] @@ -1689,31 +1689,31 @@ public static unsafe partial class SDL [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteU8", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); + public static extern nuint WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE16", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + public static extern nuint WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE16", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + public static extern nuint WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE32", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + public static extern nuint WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE32", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + public static extern nuint WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE64", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + public static extern nuint WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE64", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + public static extern nuint WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); [NativeTypeName("#define SDL_RWOPS_UNKNOWN 0U")] public const uint SDL_RWOPS_UNKNOWN = 0U; @@ -1743,25 +1743,25 @@ public static unsafe partial class SDL public const int RW_SEEK_END = 2; [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_malloc", ExactSpelling = true)] - public static extern void* malloc([NativeTypeName("size_t")] UIntPtr size); + public static extern void* malloc([NativeTypeName("size_t")] nuint size); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_calloc", ExactSpelling = true)] - public static extern void* calloc([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); + public static extern void* calloc([NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_realloc", ExactSpelling = true)] - public static extern void* realloc(void* mem, [NativeTypeName("size_t")] UIntPtr size); + public static extern void* realloc(void* mem, [NativeTypeName("size_t")] nuint size); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)] public static extern void free(void* mem); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetOriginalMemoryFunctions", ExactSpelling = true)] - public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); + public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMemoryFunctions", ExactSpelling = true)] - public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); + public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMemoryFunctions", ExactSpelling = true)] - public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] IntPtr malloc_func, [NativeTypeName("SDL_calloc_func")] IntPtr calloc_func, [NativeTypeName("SDL_realloc_func")] IntPtr realloc_func, [NativeTypeName("SDL_free_func")] IntPtr free_func); + public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl] malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl] calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl] realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl] free_func); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAllocations", ExactSpelling = true)] public static extern int GetNumAllocations(); @@ -1779,11 +1779,11 @@ public static unsafe partial class SDL [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv", ExactSpelling = true)] [return: NativeTypeName("size_t")] - public static extern UIntPtr iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] UIntPtr* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] UIntPtr* outbytesleft); + public static extern nuint iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] nuint* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] nuint* outbytesleft); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_string", ExactSpelling = true)] [return: NativeTypeName("char *")] - public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] UIntPtr inbytesleft); + public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] nuint inbytesleft); [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL; @@ -1840,43 +1840,43 @@ public static unsafe partial class SDL public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] - public static ReadOnlySpan SDL_PRIs64 => new byte[] { 0x49, 0x36, 0x34, 0x64, 0x00 }; + public static ReadOnlySpan SDL_PRIs64 => "I64d"u8; [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] - public static ReadOnlySpan SDL_PRIu64 => new byte[] { 0x49, 0x36, 0x34, 0x75, 0x00 }; + public static ReadOnlySpan SDL_PRIu64 => "I64u"u8; [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] - public static ReadOnlySpan SDL_PRIx64 => new byte[] { 0x49, 0x36, 0x34, 0x78, 0x00 }; + public static ReadOnlySpan SDL_PRIx64 => "I64x"u8; [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] - public static ReadOnlySpan SDL_PRIX64 => new byte[] { 0x49, 0x36, 0x34, 0x58, 0x00 }; + public static ReadOnlySpan SDL_PRIX64 => "I64X"u8; [NativeTypeName("#define SDL_PRIs32 \"d\"")] - public static ReadOnlySpan SDL_PRIs32 => new byte[] { 0x64, 0x00 }; + public static ReadOnlySpan SDL_PRIs32 => "d"u8; [NativeTypeName("#define SDL_PRIu32 \"u\"")] - public static ReadOnlySpan SDL_PRIu32 => new byte[] { 0x75, 0x00 }; + public static ReadOnlySpan SDL_PRIu32 => "u"u8; [NativeTypeName("#define SDL_PRIx32 \"x\"")] - public static ReadOnlySpan SDL_PRIx32 => new byte[] { 0x78, 0x00 }; + public static ReadOnlySpan SDL_PRIx32 => "x"u8; [NativeTypeName("#define SDL_PRIX32 \"X\"")] - public static ReadOnlySpan SDL_PRIX32 => new byte[] { 0x58, 0x00 }; + public static ReadOnlySpan SDL_PRIX32 => "X"u8; [NativeTypeName("#define M_PI 3.14159265358979323846264338327950288")] public const double M_PI = 3.14159265358979323846264338327950288; [NativeTypeName("#define SDL_ICONV_ERROR (size_t)-1")] - public static readonly UIntPtr SDL_ICONV_ERROR = unchecked((nuint)(-1)); + public static readonly nuint SDL_ICONV_ERROR = unchecked((nuint)(-1)); [NativeTypeName("#define SDL_ICONV_E2BIG (size_t)-2")] - public static readonly UIntPtr SDL_ICONV_E2BIG = unchecked((nuint)(-2)); + public static readonly nuint SDL_ICONV_E2BIG = unchecked((nuint)(-2)); [NativeTypeName("#define SDL_ICONV_EILSEQ (size_t)-3")] - public static readonly UIntPtr SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); + public static readonly nuint SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); [NativeTypeName("#define SDL_ICONV_EINVAL (size_t)-4")] - public static readonly UIntPtr SDL_ICONV_EINVAL = unchecked((nuint)(-4)); + public static readonly nuint SDL_ICONV_EINVAL = unchecked((nuint)(-4)); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurface", ExactSpelling = true)] public static extern SDL_Surface* CreateRGBSurface([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); @@ -2011,7 +2011,7 @@ public static unsafe partial class SDL public const int SDL_SIMD_ALIGNED = 0x00000008; [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowsMessageHook", ExactSpelling = true)] - public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] IntPtr callback, void* userdata); + public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Direct3D9GetAdapterIndex", ExactSpelling = true)] public static extern int Direct3D9GetAdapterIndex(int displayIndex); @@ -2138,7 +2138,7 @@ public static unsafe partial class SDL public static extern int GetWindowDisplayMode(SDL_Window* window, SDL_DisplayMode* mode); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowICCProfile", ExactSpelling = true)] - public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] UIntPtr* size); + public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] nuint* size); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPixelFormat", ExactSpelling = true)] [return: NativeTypeName("Uint32")] @@ -2305,7 +2305,7 @@ public static unsafe partial class SDL public static extern int GetWindowGammaRamp(SDL_Window* window, [NativeTypeName("Uint16 *")] ushort* red, [NativeTypeName("Uint16 *")] ushort* green, [NativeTypeName("Uint16 *")] ushort* blue); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowHitTest", ExactSpelling = true)] - public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] IntPtr callback, void* callback_data); + public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl] callback, void* callback_data); [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlashWindow", ExactSpelling = true)] public static extern int FlashWindow(SDL_Window* window, SDL_FlashOperation operation); diff --git a/sources/SDL2Sharp.Interop/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/SDL_AudioCVT.cs index 027f7f78..541c3ca4 100644 --- a/sources/SDL2Sharp.Interop/SDL_AudioCVT.cs +++ b/sources/SDL2Sharp.Interop/SDL_AudioCVT.cs @@ -18,7 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using System.Runtime.CompilerServices; namespace SDL2Sharp.Interop @@ -51,25 +50,25 @@ public unsafe partial struct SDL_AudioCVT public int filter_index; - public partial struct _filters_e__FixedBuffer + public unsafe partial struct _filters_e__FixedBuffer { - public IntPtr e0; - public IntPtr e1; - public IntPtr e2; - public IntPtr e3; - public IntPtr e4; - public IntPtr e5; - public IntPtr e6; - public IntPtr e7; - public IntPtr e8; - public IntPtr e9; + public delegate* unmanaged[Cdecl] e0; + public delegate* unmanaged[Cdecl] e1; + public delegate* unmanaged[Cdecl] e2; + public delegate* unmanaged[Cdecl] e3; + public delegate* unmanaged[Cdecl] e4; + public delegate* unmanaged[Cdecl] e5; + public delegate* unmanaged[Cdecl] e6; + public delegate* unmanaged[Cdecl] e7; + public delegate* unmanaged[Cdecl] e8; + public delegate* unmanaged[Cdecl] e9; - public unsafe ref IntPtr this[int index] + public ref delegate* unmanaged[Cdecl] this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - fixed (IntPtr* pThis = &e0) + fixed (delegate* unmanaged[Cdecl]* pThis = &e0) { return ref pThis[index]; } diff --git a/sources/SDL2Sharp.Interop/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/SDL_AudioSpec.cs index fe0e438e..17080911 100644 --- a/sources/SDL2Sharp.Interop/SDL_AudioSpec.cs +++ b/sources/SDL2Sharp.Interop/SDL_AudioSpec.cs @@ -18,8 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - namespace SDL2Sharp.Interop { public unsafe partial struct SDL_AudioSpec @@ -45,7 +43,7 @@ public unsafe partial struct SDL_AudioSpec public uint size; [NativeTypeName("SDL_AudioCallback")] - public IntPtr callback; + public delegate* unmanaged[Cdecl] callback; public void* userdata; } diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs index 2dfb1b42..56df83fc 100644 --- a/sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs +++ b/sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs @@ -18,9 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { - public unsafe partial struct SDL_ControllerSensorEvent + public partial struct SDL_ControllerSensorEvent { [NativeTypeName("Uint32")] public uint type; @@ -35,9 +37,15 @@ public unsafe partial struct SDL_ControllerSensorEvent public int sensor; [NativeTypeName("float[3]")] - public fixed float data[3]; + public _data_e__FixedBuffer data; [NativeTypeName("Uint64")] public ulong timestamp_us; + + [InlineArray(3)] + public partial struct _data_e__FixedBuffer + { + public float e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_Event.cs b/sources/SDL2Sharp.Interop/SDL_Event.cs index 7db609df..31467af9 100644 --- a/sources/SDL2Sharp.Interop/SDL_Event.cs +++ b/sources/SDL2Sharp.Interop/SDL_Event.cs @@ -18,12 +18,13 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace SDL2Sharp.Interop { [StructLayout(LayoutKind.Explicit)] - public unsafe partial struct SDL_Event + public partial struct SDL_Event { [FieldOffset(0)] [NativeTypeName("Uint32")] @@ -121,6 +122,12 @@ public unsafe partial struct SDL_Event [FieldOffset(0)] [NativeTypeName("Uint8[56]")] - public fixed byte padding[56]; + public _padding_e__FixedBuffer padding; + + [InlineArray(56)] + public partial struct _padding_e__FixedBuffer + { + public byte e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_GUID.cs b/sources/SDL2Sharp.Interop/SDL_GUID.cs index fb41ca1e..58ccdfac 100644 --- a/sources/SDL2Sharp.Interop/SDL_GUID.cs +++ b/sources/SDL2Sharp.Interop/SDL_GUID.cs @@ -18,11 +18,19 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { - public unsafe partial struct SDL_GUID + public partial struct SDL_GUID { [NativeTypeName("Uint8[16]")] - public fixed byte data[16]; + public _data_e__FixedBuffer data; + + [InlineArray(16)] + public partial struct _data_e__FixedBuffer + { + public byte e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/SDL_PixelFormat.cs index fa3c1100..00c49e68 100644 --- a/sources/SDL2Sharp.Interop/SDL_PixelFormat.cs +++ b/sources/SDL2Sharp.Interop/SDL_PixelFormat.cs @@ -18,6 +18,8 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { public unsafe partial struct SDL_PixelFormat @@ -34,7 +36,7 @@ public unsafe partial struct SDL_PixelFormat public byte BytesPerPixel; [NativeTypeName("Uint8[2]")] - public fixed byte padding[2]; + public _padding_e__FixedBuffer padding; [NativeTypeName("Uint32")] public uint Rmask; @@ -76,5 +78,11 @@ public unsafe partial struct SDL_PixelFormat [NativeTypeName("struct SDL_PixelFormat *")] public SDL_PixelFormat* next; + + [InlineArray(2)] + public partial struct _padding_e__FixedBuffer + { + public byte e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_RWops.cs b/sources/SDL2Sharp.Interop/SDL_RWops.cs index 54b9583d..945a6527 100644 --- a/sources/SDL2Sharp.Interop/SDL_RWops.cs +++ b/sources/SDL2Sharp.Interop/SDL_RWops.cs @@ -18,27 +18,26 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using System.Runtime.InteropServices; namespace SDL2Sharp.Interop { - public partial struct SDL_RWops + public unsafe partial struct SDL_RWops { [NativeTypeName("Sint64 (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public IntPtr size; + public delegate* unmanaged[Cdecl] size; [NativeTypeName("Sint64 (*)(struct SDL_RWops *, Sint64, int) __attribute__((cdecl))")] - public IntPtr seek; + public delegate* unmanaged[Cdecl] seek; [NativeTypeName("size_t (*)(struct SDL_RWops *, void *, size_t, size_t) __attribute__((cdecl))")] - public IntPtr read; + public delegate* unmanaged[Cdecl] read; [NativeTypeName("size_t (*)(struct SDL_RWops *, const void *, size_t, size_t) __attribute__((cdecl))")] - public IntPtr write; + public delegate* unmanaged[Cdecl] write; [NativeTypeName("int (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public IntPtr close; + public delegate* unmanaged[Cdecl] close; [NativeTypeName("Uint32")] public uint type; @@ -75,10 +74,10 @@ public unsafe partial struct _buffer_e__Struct public void* data; [NativeTypeName("size_t")] - public UIntPtr size; + public nuint size; [NativeTypeName("size_t")] - public UIntPtr left; + public nuint left; } } diff --git a/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs index e967e9a9..71b6202d 100644 --- a/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs +++ b/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,12 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - namespace SDL2Sharp.Interop { [NativeTypeName("int")] - [Flags] public enum SDL_RendererFlags : uint { SDL_RENDERER_SOFTWARE = 0x00000001, diff --git a/sources/SDL2Sharp.Interop/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/SDL_RendererInfo.cs index c21a4ba1..0bd45762 100644 --- a/sources/SDL2Sharp.Interop/SDL_RendererInfo.cs +++ b/sources/SDL2Sharp.Interop/SDL_RendererInfo.cs @@ -18,6 +18,8 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { public unsafe partial struct SDL_RendererInfo @@ -32,10 +34,16 @@ public unsafe partial struct SDL_RendererInfo public uint num_texture_formats; [NativeTypeName("Uint32[16]")] - public fixed uint texture_formats[16]; + public _texture_formats_e__FixedBuffer texture_formats; public int max_texture_width; public int max_texture_height; + + [InlineArray(16)] + public partial struct _texture_formats_e__FixedBuffer + { + public uint e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/SDL_SensorEvent.cs index ce329d9f..62e50ba4 100644 --- a/sources/SDL2Sharp.Interop/SDL_SensorEvent.cs +++ b/sources/SDL2Sharp.Interop/SDL_SensorEvent.cs @@ -18,9 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { - public unsafe partial struct SDL_SensorEvent + public partial struct SDL_SensorEvent { [NativeTypeName("Uint32")] public uint type; @@ -32,9 +34,15 @@ public unsafe partial struct SDL_SensorEvent public int which; [NativeTypeName("float[6]")] - public fixed float data[6]; + public _data_e__FixedBuffer data; [NativeTypeName("Uint64")] public ulong timestamp_us; + + [InlineArray(6)] + public partial struct _data_e__FixedBuffer + { + public float e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs index 40f05865..2265bade 100644 --- a/sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs +++ b/sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs @@ -18,9 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { - public unsafe partial struct SDL_TextEditingEvent + public partial struct SDL_TextEditingEvent { [NativeTypeName("Uint32")] public uint type; @@ -32,12 +34,18 @@ public unsafe partial struct SDL_TextEditingEvent public uint windowID; [NativeTypeName("char[32]")] - public fixed sbyte text[32]; + public _text_e__FixedBuffer text; [NativeTypeName("Sint32")] public int start; [NativeTypeName("Sint32")] public int length; + + [InlineArray(32)] + public partial struct _text_e__FixedBuffer + { + public sbyte e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs index 285e9416..f5f9bb1f 100644 --- a/sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs +++ b/sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs @@ -18,9 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Interop { - public unsafe partial struct SDL_TextInputEvent + public partial struct SDL_TextInputEvent { [NativeTypeName("Uint32")] public uint type; @@ -32,6 +34,12 @@ public unsafe partial struct SDL_TextInputEvent public uint windowID; [NativeTypeName("char[32]")] - public fixed sbyte text[32]; + public _text_e__FixedBuffer text; + + [InlineArray(32)] + public partial struct _text_e__FixedBuffer + { + public sbyte e0; + } } } diff --git a/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs index 26b1bbd5..adadc839 100644 --- a/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs +++ b/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs index 34a9ad27..4a75f501 100644 --- a/sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs +++ b/sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs @@ -18,8 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - namespace SDL2Sharp.Interop { public unsafe partial struct SDL_VirtualJoystickDesc @@ -60,21 +58,21 @@ public unsafe partial struct SDL_VirtualJoystickDesc public void* userdata; [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] - public IntPtr Update; + public delegate* unmanaged[Cdecl] Update; [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] - public IntPtr SetPlayerIndex; + public delegate* unmanaged[Cdecl] SetPlayerIndex; [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public IntPtr Rumble; + public delegate* unmanaged[Cdecl] Rumble; [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public IntPtr RumbleTriggers; + public delegate* unmanaged[Cdecl] RumbleTriggers; [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] - public IntPtr SetLED; + public delegate* unmanaged[Cdecl] SetLED; [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] - public IntPtr SendEffect; + public delegate* unmanaged[Cdecl] SendEffect; } } diff --git a/sources/SDL2Sharp/Audio/AudioDevice.cs b/sources/SDL2Sharp/Audio/AudioDevice.cs index b3b943be..244dd6b5 100644 --- a/sources/SDL2Sharp/Audio/AudioDevice.cs +++ b/sources/SDL2Sharp/Audio/AudioDevice.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL2Sharp.Interop; @@ -30,8 +31,6 @@ public sealed unsafe class AudioDevice : IDisposable private AudioDeviceCallback _callback = null!; - private AudioDeviceCallbackDelegate _callbackDelegate = null!; - private GCHandle _callbackUserData = default; private bool _disposed = false; @@ -144,8 +143,7 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe { _callback = callback; _callbackUserData = GCHandle.Alloc(this, GCHandleType.Normal); - _callbackDelegate = new AudioDeviceCallbackDelegate(OnAudioDeviceCallback); - desiredSpec.callback = Marshal.GetFunctionPointerForDelegate(_callbackDelegate); + desiredSpec.callback = &OnAudioDeviceCallback; desiredSpec.userdata = (void*)(IntPtr)_callbackUserData; } @@ -176,11 +174,8 @@ public void Close() if (_deviceID != 0) { SDL.CloseAudioDevice(_deviceID); - _deviceID = 0; _callback = null!; - _callbackDelegate = null!; - if (_callbackUserData.IsAllocated) { _callbackUserData.Free(); @@ -246,15 +241,10 @@ private void ThrowIfClosed() private void ThrowIfDisposed() { - if (IsDisposed) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(IsDisposed, this); } - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void AudioDeviceCallbackDelegate(void* userdata, byte* stream, int len); - + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] private static void OnAudioDeviceCallback(void* userdata, byte* stream, int len) { var audioDeviceHandle = GCHandle.FromIntPtr((IntPtr)userdata); diff --git a/sources/SDL2Sharp/Input/EventSubsystem.cs b/sources/SDL2Sharp/Input/EventSubsystem.cs index 210578f2..4a68d7cb 100644 --- a/sources/SDL2Sharp/Input/EventSubsystem.cs +++ b/sources/SDL2Sharp/Input/EventSubsystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL2Sharp.Interop; @@ -32,29 +33,25 @@ public sealed unsafe class EventSubsystem : IDisposable private const uint InitSubsystemFlags = SDL.SDL_INIT_EVENTS; - private readonly EventWatchCallbackDelegate _watchCallback = null!; - private GCHandle _watchCallbackUserData = default; - private readonly HashSet> _watchCallbacks = new(); + private readonly HashSet> _watchCallbacks = []; public EventSubsystem() { - SDL.InitSubSystem(InitSubsystemFlags); + Error.ThrowOnFailure( + SDL.InitSubSystem(InitSubsystemFlags) + ); _watchCallbackUserData = GCHandle.Alloc(this, GCHandleType.Normal); var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; - _watchCallback = new EventWatchCallbackDelegate(OnEventWatchCallback); - var watchCallbackPointer = Marshal.GetFunctionPointerForDelegate(_watchCallback); - - SDL.AddEventWatch(watchCallbackPointer, watchUserDataPointer); + SDL.AddEventWatch(&OnEventWatchCallback, watchUserDataPointer); } public void Dispose() { var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; - var watchCallbackPointer = Marshal.GetFunctionPointerForDelegate(_watchCallback); - SDL.DelEventWatch(watchCallbackPointer, watchUserDataPointer); + SDL.DelEventWatch(&OnEventWatchCallback, watchUserDataPointer); if (_watchCallbackUserData.IsAllocated) { @@ -64,7 +61,9 @@ public void Dispose() SDL.QuitSubSystem(InitSubsystemFlags); } +#pragma warning disable CA1822 // Mark members as static public Event? PollEvent() +#pragma warning restore CA1822 // Mark members as static { var @event = new SDL_Event(); if (SDL.PollEvent(&@event) == 0) @@ -74,7 +73,9 @@ public void Dispose() return WrapEvent(@event); } +#pragma warning disable CA1822 // Mark members as static public void PushEvent(Event @event) +#pragma warning restore CA1822 // Mark members as static { var eventHandle = @event.Handle; var result = SDL.PushEvent(&@eventHandle); @@ -262,6 +263,7 @@ private void OnEventWatchCallback(Event @event) } } + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] private static int OnEventWatchCallback(void* userdata, SDL_Event* @event) { var eventSubsystemHandle = GCHandle.FromIntPtr((IntPtr)userdata); diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index f4e6f330..3405b80b 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -447,10 +447,7 @@ public PackedMemoryImage ReadPixels(Rect private void ThrowWhenDisposed() { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_handle is null, this); } } } diff --git a/sources/SDL2Sharp/Video/Window.cs b/sources/SDL2Sharp/Video/Window.cs index d637d0ab..c9f2df23 100644 --- a/sources/SDL2Sharp/Video/Window.cs +++ b/sources/SDL2Sharp/Video/Window.cs @@ -22,6 +22,7 @@ using SDL2Sharp.Internals; using SDL2Sharp.Interop; using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; namespace SDL2Sharp.Video { @@ -29,8 +30,6 @@ public sealed unsafe class Window : IDisposable { private SDL_Window* _handle; - private readonly HitTestCallbackDelegate _hitTestCallback; - public uint Id { get @@ -301,16 +300,10 @@ private Window(string title, int x, int y, int width, int height, uint flags) if (!IsBordered) { - _hitTestCallback = new HitTestCallbackDelegate(HitTestCallback); - var hitTestCallback = Marshal.GetFunctionPointerForDelegate(_hitTestCallback); Error.ThrowOnFailure( - SDL.SetWindowHitTest(_handle, hitTestCallback, null) + SDL.SetWindowHitTest(_handle, &HitTestCallback, null) ); } - else - { - _hitTestCallback = null!; - } } ~Window() @@ -440,35 +433,35 @@ private bool HasWindowFlag(SDL_WindowFlags flag) private void ThrowWhenDisposed() { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_handle is null, this); } - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate SDL_HitTestResult HitTestCallbackDelegate(SDL_Window* win, SDL_Point* area, void* data); - + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] private static unsafe SDL_HitTestResult HitTestCallback(SDL_Window* win, SDL_Point* area, void* data) { - int x = area->x; - int y = area->y; + var x = area->x; + var y = area->y; int windowWidth = 0, windowHeight = 0; SDL.GetWindowSize(win, &windowWidth, &windowHeight); - int windowTop = 0; - int windowLeft = 0; - int windowBottom = windowTop + windowHeight; - int windowRight = windowLeft + windowWidth; + var windowTop = 0; + var windowLeft = 0; + var windowBottom = windowTop + windowHeight; + var windowRight = windowLeft + windowWidth; - int borderTop = 0, borderLeft = 0, borderBottom = 0, borderRight = 0; + var borderTop = 0; + var borderLeft = 0; + var borderBottom = 0; + var borderRight = 0; +#pragma warning disable CA1806 // Do not ignore method results SDL.GetWindowBordersSize(win, &borderTop, &borderLeft, &borderBottom, &borderRight); +#pragma warning restore CA1806 // Do not ignore method results - int clientAreaTop = windowTop + borderTop; - int clientAreaLeft = windowLeft + borderLeft; - int clientAreaBottom = windowBottom - borderBottom; - int clientAreaRight = windowRight - borderRight; + var clientAreaTop = windowTop + borderTop; + var clientAreaLeft = windowLeft + borderLeft; + var clientAreaBottom = windowBottom - borderBottom; + var clientAreaRight = windowRight - borderRight; if (y > windowTop && y < clientAreaTop) { diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs index baf6c8fd..e7767356 100644 --- a/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs +++ b/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // From fade7bb3a1a72670981399e1fe7aeb85b1481eb7 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Wed, 24 Jul 2024 13:08:51 +0200 Subject: [PATCH 35/62] Replace attributes with static interface members. --- sources/SDL2Sharp/Video/Colors/Abgr1555.cs | 16 +-- sources/SDL2Sharp/Video/Colors/Abgr4444.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Abgr8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Argb1555.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Argb2101010.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Argb4444.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Argb8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Bgr24.cs | 3 +- sources/SDL2Sharp/Video/Colors/Bgr565.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Bgra4444.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Bgra5551.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Bgra8888.cs | 22 ++-- sources/SDL2Sharp/Video/Colors/Bgrx8888.cs | 17 +-- .../{IYuvFormat.cs => Colors/IPackedPixel.cs} | 25 ++--- sources/SDL2Sharp/Video/Colors/IYuvPixel.cs | 51 +++++++++ sources/SDL2Sharp/Video/{ => Colors}/Iyuv.cs | 31 ++--- sources/SDL2Sharp/Video/Colors/Rgb24.cs | 1 - sources/SDL2Sharp/Video/Colors/Rgb332.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Rgb565.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Rgba4444.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Rgba5551.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Rgba8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Rgbx8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Uyvy.cs | 1 - sources/SDL2Sharp/Video/Colors/Xbgr1555.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Xbgr4444.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Xbgr8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Xrgb1555.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Xrgb4444.cs | 15 +-- sources/SDL2Sharp/Video/Colors/Xrgb8888.cs | 17 +-- sources/SDL2Sharp/Video/Colors/Yuy2.cs | 1 - sources/SDL2Sharp/Video/{ => Colors}/Yv12.cs | 31 ++--- sources/SDL2Sharp/Video/Colors/Yvyu.cs | 1 - sources/SDL2Sharp/Video/ImageMemoryPlane.cs | 14 +-- sources/SDL2Sharp/Video/ImagePlane.cs | 14 +-- sources/SDL2Sharp/Video/PackedImage.cs | 14 +-- sources/SDL2Sharp/Video/PackedTexture.cs | 38 +++---- .../SDL2Sharp/Video/PixelFormatAttribute.cs | 47 -------- sources/SDL2Sharp/Video/Renderer.cs | 19 ++-- sources/SDL2Sharp/Video/RendererExtensions.cs | 106 +++++------------- sources/SDL2Sharp/Video/Surface.cs | 8 +- sources/SDL2Sharp/Video/Surface{T}.cs | 36 +++--- sources/SDL2Sharp/Video/TextureExtensions.cs | 7 +- sources/SDL2Sharp/Video/YuvImage.cs | 28 +++-- sources/SDL2Sharp/Video/YuvTexture.cs | 2 +- tests/SDL2Sharp.Tests/PackedTextureTests.cs | 2 +- tests/SDL2Sharp.Tests/SurfaceTests.cs | 18 --- 47 files changed, 416 insertions(+), 466 deletions(-) rename sources/SDL2Sharp/Video/{IYuvFormat.cs => Colors/IPackedPixel.cs} (58%) create mode 100644 sources/SDL2Sharp/Video/Colors/IYuvPixel.cs rename sources/SDL2Sharp/Video/{ => Colors}/Iyuv.cs (67%) rename sources/SDL2Sharp/Video/{ => Colors}/Yv12.cs (67%) delete mode 100644 sources/SDL2Sharp/Video/PixelFormatAttribute.cs diff --git a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs index fd4f24ba..bfb76f0e 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr1555.cs @@ -22,22 +22,24 @@ namespace SDL2Sharp.Video.Colors { + [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.ABGR1555)] - public readonly record struct Abgr1555 + public readonly record struct Abgr1555 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR1555); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR1555); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Abgr1555 FromRGB(byte r, byte g, byte b) { - return new Abgr1555((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Abgr1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Abgr1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Abgr1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Abgr1555(ushort value) @@ -47,12 +49,12 @@ private Abgr1555(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs index 848d3a01..5e2b8190 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr4444.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.ABGR4444)] - public readonly record struct Abgr4444 + public readonly record struct Abgr4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR4444); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Abgr4444 FromRGB(byte r, byte g, byte b) { - return new Abgr4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Abgr4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Abgr4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Abgr4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Abgr4444(ushort value) @@ -47,12 +48,12 @@ private Abgr4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs index 7f3a9588..eabc2ed2 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Abgr8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.ABGR8888)] - public readonly record struct Abgr8888 + public readonly record struct Abgr8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ABGR8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Abgr8888 FromRGB(byte r, byte g, byte b) { - return new Abgr8888(_pixelFormat.MapRGB(r, g, b)); + return new Abgr8888(_formatDescriptor.MapRGB(r, g, b)); } public static Abgr8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Abgr8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Abgr8888(byte a, byte b, byte g, byte r) - : this(_pixelFormat.MapRGBA(r, g, b, a)) + : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } private Abgr8888(uint value) @@ -51,12 +52,12 @@ private Abgr8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb1555.cs b/sources/SDL2Sharp/Video/Colors/Argb1555.cs index e45df234..14493b69 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb1555.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.ARGB1555)] - public readonly record struct Argb1555 + public readonly record struct Argb1555 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB1555); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB1555); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Argb1555 FromRGB(byte r, byte g, byte b) { - return new Argb1555((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Argb1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Argb1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Argb1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Argb1555(ushort value) @@ -47,12 +48,12 @@ private Argb1555(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs index 3130400a..6ad2b141 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb2101010.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.ARGB2101010)] - public readonly record struct Argb2101010 + public readonly record struct Argb2101010 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB2101010); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB2101010); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Argb2101010 FromRGB(byte r, byte g, byte b) { - return new Argb2101010(_pixelFormat.MapRGB(r, g, b)); + return new Argb2101010(_formatDescriptor.MapRGB(r, g, b)); } public static Argb2101010 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb2101010(_pixelFormat.MapRGBA(r, g, b, a)); + return new Argb2101010(_formatDescriptor.MapRGBA(r, g, b, a)); } private Argb2101010(uint value) @@ -47,12 +48,12 @@ private Argb2101010(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb4444.cs b/sources/SDL2Sharp/Video/Colors/Argb4444.cs index 705b7cbe..2409a3fc 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb4444.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.ARGB4444)] - public readonly record struct Argb4444 + public readonly record struct Argb4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB4444); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Argb4444 FromRGB(byte r, byte g, byte b) { - return new Argb4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Argb4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Argb4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Argb4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Argb4444(ushort value) @@ -47,12 +48,12 @@ private Argb4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Argb8888.cs b/sources/SDL2Sharp/Video/Colors/Argb8888.cs index 23824542..3851cfa7 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Argb8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.ARGB8888)] - public readonly record struct Argb8888 + public readonly record struct Argb8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.ARGB8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Argb8888 FromRGB(byte r, byte g, byte b) { - return new Argb8888(_pixelFormat.MapRGB(r, g, b)); + return new Argb8888(_formatDescriptor.MapRGB(r, g, b)); } public static Argb8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Argb8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Argb8888(byte a, byte r, byte g, byte b) - : this(_pixelFormat.MapRGBA(r, g, b, a)) + : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } private Argb8888(uint value) @@ -51,12 +52,12 @@ private Argb8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgr24.cs b/sources/SDL2Sharp/Video/Colors/Bgr24.cs index a1251cc0..4927ff99 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr24.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr24.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -23,7 +23,6 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PixelFormat(PixelFormat.BGR24)] public readonly record struct Bgr24 { private readonly byte _r, _g, _b; diff --git a/sources/SDL2Sharp/Video/Colors/Bgr565.cs b/sources/SDL2Sharp/Video/Colors/Bgr565.cs index 21745d81..1cdc8197 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgr565.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.BGR565)] - public readonly record struct Bgr565 + public readonly record struct Bgr565 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGR565); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGR565); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Bgr565 FromRGB(byte r, byte g, byte b) { - return new Bgr565((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Bgr565((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Bgr565 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgr565((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Bgr565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Bgr565(ushort value) @@ -47,12 +48,12 @@ private Bgr565(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs index a95b9614..1921f91f 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra4444.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.BGRA4444)] - public readonly record struct Bgra4444 + public readonly record struct Bgra4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA4444); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Bgra4444 FromRGB(byte r, byte g, byte b) { - return new Bgra4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Bgra4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Bgra4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Bgra4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Bgra4444(ushort value) @@ -47,12 +48,12 @@ private Bgra4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs index 79472a89..3e2005b4 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra5551.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.BGRA5551)] - public readonly record struct Bgra5551 + public readonly record struct Bgra5551 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA5551); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA5551); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Bgra5551 FromRGB(byte r, byte g, byte b) { - return new Bgra5551((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Bgra5551((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Bgra5551 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra5551((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Bgra5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Bgra5551(ushort value) @@ -47,12 +48,12 @@ private Bgra5551(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs index 0b4aa613..80435cb9 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgra8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.BGRA8888)] - public readonly record struct Bgra8888 + public readonly record struct Bgra8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRA8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Bgra8888 FromRGBA(byte r, byte g, byte b) { - return new Bgra8888(_pixelFormat.MapRGB(r, g, b)); + return new Bgra8888(_formatDescriptor.MapRGB(r, g, b)); } public static Bgra8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Bgra8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Bgra8888(byte b, byte g, byte r, byte a) - : this(_pixelFormat.MapRGBA(r, g, b, a)) + : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } private Bgra8888(uint value) @@ -51,12 +52,17 @@ private Bgra8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); + } + + public static Bgra8888 FromRGB(byte r, byte g, byte b) + { + throw new System.NotImplementedException(); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs index 25ac952d..83fdf29a 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.BGRX8888)] - public readonly record struct Bgrx8888 + public readonly record struct Bgrx8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.BGRX8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRX8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Bgrx8888 FromRGB(byte r, byte g, byte b) { - return new Bgrx8888(_pixelFormat.MapRGB(r, g, b)); + return new Bgrx8888(_formatDescriptor.MapRGB(r, g, b)); } public static Bgrx8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgrx8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Bgrx8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Bgrx8888(byte b, byte g, byte r) - : this(_pixelFormat.MapRGB(r, g, b)) + : this(_formatDescriptor.MapRGB(r, g, b)) { } private Bgrx8888(uint value) @@ -51,12 +52,12 @@ private Bgrx8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/IYuvFormat.cs b/sources/SDL2Sharp/Video/Colors/IPackedPixel.cs similarity index 58% rename from sources/SDL2Sharp/Video/IYuvFormat.cs rename to sources/SDL2Sharp/Video/Colors/IPackedPixel.cs index a14cf8b5..4997ea50 100644 --- a/sources/SDL2Sharp/Video/IYuvFormat.cs +++ b/sources/SDL2Sharp/Video/Colors/IPackedPixel.cs @@ -18,21 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp.Video.Colors { - public interface IYuvPixelFormat + public interface IPackedPixel where TPackedPixel : struct { - int GetYPlaneWidth(int imageWidth); - int GetYPlaneHeight(int imageHeight); - int GetYPlanePitch(int imagePitch); - int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch); - int GetUPlaneWidth(int imageWidth); - int GetUPlaneHeight(int imageHeight); - int GetUPlanePitch(int imagePitch); - int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch); - int GetVPlaneWidth(int imageWidth); - int GetVPlaneHeight(int imageHeight); - int GetVPlanePitch(int imagePitch); - int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + public static abstract PixelFormat Format { get; } + + public static abstract TPackedPixel FromRGB(byte r, byte g, byte b); + + public static abstract TPackedPixel FromRGBA(byte r, byte g, byte b, byte a); + + public abstract (byte r, byte g, byte b) ToRGB(); + + public abstract (byte r, byte g, byte b, byte a) ToRGBA(); } } diff --git a/sources/SDL2Sharp/Video/Colors/IYuvPixel.cs b/sources/SDL2Sharp/Video/Colors/IYuvPixel.cs new file mode 100644 index 00000000..e409d404 --- /dev/null +++ b/sources/SDL2Sharp/Video/Colors/IYuvPixel.cs @@ -0,0 +1,51 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Video.Colors +{ + public interface IYuvPixel + { + static abstract PixelFormat Format { get; } + + static abstract int GetYPlaneWidth(int imageWidth); + + static abstract int GetYPlaneHeight(int imageHeight); + + static abstract int GetYPlanePitch(int imagePitch); + + static abstract int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + + static abstract int GetUPlaneWidth(int imageWidth); + + static abstract int GetUPlaneHeight(int imageHeight); + + static abstract int GetUPlanePitch(int imagePitch); + + static abstract int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + + static abstract int GetVPlaneWidth(int imageWidth); + + static abstract int GetVPlaneHeight(int imageHeight); + + static abstract int GetVPlanePitch(int imagePitch); + + static abstract int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + } +} diff --git a/sources/SDL2Sharp/Video/Iyuv.cs b/sources/SDL2Sharp/Video/Colors/Iyuv.cs similarity index 67% rename from sources/SDL2Sharp/Video/Iyuv.cs rename to sources/SDL2Sharp/Video/Colors/Iyuv.cs index 0096104e..183087c4 100644 --- a/sources/SDL2Sharp/Video/Iyuv.cs +++ b/sources/SDL2Sharp/Video/Colors/Iyuv.cs @@ -18,68 +18,69 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp.Video.Colors { - [PixelFormat(PixelFormat.IYUV)] - public readonly struct Iyuv : IYuvPixelFormat + public readonly struct Iyuv : IYuvPixel { - public int GetYPlaneWidth(int imageWidth) + public static PixelFormat Format => PixelFormat.IYUV; + + public static int GetYPlaneWidth(int imageWidth) { return imageWidth; } - public int GetYPlaneHeight(int imageHeight) + public static int GetYPlaneHeight(int imageHeight) { return imageHeight; } - public int GetYPlanePitch(int imagePitch) + public static int GetYPlanePitch(int imagePitch) { return imagePitch; } - public int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return 0; } - public int GetUPlaneWidth(int imageWidth) + public static int GetUPlaneWidth(int imageWidth) { return GetYPlaneWidth(imageWidth) / 2; } - public int GetUPlaneHeight(int imageHeight) + public static int GetUPlaneHeight(int imageHeight) { return GetYPlaneHeight(imageHeight) / 2; } - public int GetUPlanePitch(int imagePitch) + public static int GetUPlanePitch(int imagePitch) { return GetYPlanePitch(imagePitch) / 2; } - public int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); } - public int GetVPlaneWidth(int imageWidth) + public static int GetVPlaneWidth(int imageWidth) { return GetUPlaneHeight(imageWidth); } - public int GetVPlaneHeight(int imageHeight) + public static int GetVPlaneHeight(int imageHeight) { return GetUPlaneHeight(imageHeight); } - public int GetVPlanePitch(int imagePitch) + public static int GetVPlanePitch(int imagePitch) { return GetUPlaneHeight(imagePitch); } - public int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return GetUPlaneOffset(imageWidth, imageHeight, imagePitch) + GetUPlaneHeight(imageHeight) * GetUPlanePitch(imagePitch); diff --git a/sources/SDL2Sharp/Video/Colors/Rgb24.cs b/sources/SDL2Sharp/Video/Colors/Rgb24.cs index d722562c..b0bc339d 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb24.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb24.cs @@ -23,7 +23,6 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - [PixelFormat(PixelFormat.RGB24)] public readonly record struct Rgb24 { private readonly byte _b, _g, _r; diff --git a/sources/SDL2Sharp/Video/Colors/Rgb332.cs b/sources/SDL2Sharp/Video/Colors/Rgb332.cs index 26fabc4b..f1498e14 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb332.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb332.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - [PixelFormat(PixelFormat.RGB332)] - public readonly record struct Rgb332 + public readonly record struct Rgb332 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGB332); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGB332); private readonly byte _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Rgb332 FromRGB(byte r, byte g, byte b) { - return new Rgb332((byte)_pixelFormat.MapRGB(r, g, b)); + return new Rgb332((byte)_formatDescriptor.MapRGB(r, g, b)); } public static Rgb332 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgb332((byte)_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgb332((byte)_formatDescriptor.MapRGBA(r, g, b, a)); } private Rgb332(byte value) @@ -47,12 +48,12 @@ private Rgb332(byte value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb565.cs b/sources/SDL2Sharp/Video/Colors/Rgb565.cs index a8a6fe09..701e5d1d 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgb565.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.RGB565)] - public readonly record struct Rgb565 + public readonly record struct Rgb565 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGB565); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGB565); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Rgb565 FromRGB(byte r, byte g, byte b) { - return new Rgb565((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Rgb565((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Rgb565 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgb565((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgb565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Rgb565(ushort value) @@ -47,12 +48,12 @@ private Rgb565(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs index 3a6d2f51..c56b27d9 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba4444.cs @@ -23,23 +23,24 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.RGBA4444)] - public readonly record struct Rgba4444 + public readonly record struct Rgba4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA4444); - private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; public static Rgba4444 FromRGB(byte r, byte g, byte b) { - return new Rgba4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Rgba4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Rgba4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgba4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } + private readonly ushort _value; + private Rgba4444(ushort value) { _value = value; @@ -47,12 +48,12 @@ private Rgba4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs index a4a12290..6909398f 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba5551.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.RGBA5551)] - public readonly record struct Rgba5551 + public readonly record struct Rgba5551 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA5551); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA5551); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Rgba5551 FromRGB(byte r, byte g, byte b) { - return new Rgba5551((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Rgba5551((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Rgba5551 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba5551((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgba5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Rgba5551(ushort value) @@ -47,12 +48,12 @@ private Rgba5551(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs index 30b2f819..6a8ad5ac 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgba8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.RGBA8888)] - public readonly record struct Rgba8888 + public readonly record struct Rgba8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBA8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Rgba8888 FromRGB(byte r, byte g, byte b) { - return new Rgba8888(_pixelFormat.MapRGB(r, g, b)); + return new Rgba8888(_formatDescriptor.MapRGB(r, g, b)); } public static Rgba8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgba8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Rgba8888(byte r, byte g, byte b, byte a) - : this(_pixelFormat.MapRGBA(r, g, b, a)) + : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } private Rgba8888(uint value) @@ -51,12 +52,12 @@ private Rgba8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs index 566b1a10..0a99c9d2 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.RGBX8888)] - public readonly record struct Rgbx8888 + public readonly record struct Rgbx8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.RGBX8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBX8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Rgbx8888 FromRGB(byte r, byte g, byte b) { - return new Rgbx8888(_pixelFormat.MapRGB(r, g, b)); + return new Rgbx8888(_formatDescriptor.MapRGB(r, g, b)); } public static Rgbx8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgbx8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Rgbx8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Rgbx8888(byte r, byte g, byte b) - : this(_pixelFormat.MapRGB(r, g, b)) + : this(_formatDescriptor.MapRGB(r, g, b)) { } private Rgbx8888(uint value) @@ -51,12 +52,12 @@ private Rgbx8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Uyvy.cs b/sources/SDL2Sharp/Video/Colors/Uyvy.cs index 11b3219a..1509e75e 100644 --- a/sources/SDL2Sharp/Video/Colors/Uyvy.cs +++ b/sources/SDL2Sharp/Video/Colors/Uyvy.cs @@ -23,7 +23,6 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.UYVY)] public readonly record struct Uyvy { private readonly uint _value; diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs index 6954c11b..373ffcda 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.XBGR1555)] - public readonly record struct Xbgr1555 + public readonly record struct Xbgr1555 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR1555); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR1555); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xbgr1555 FromRGB(byte r, byte g, byte b) { - return new Xbgr1555((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Xbgr1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Xbgr1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Xbgr1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Xbgr1555(ushort value) @@ -47,12 +48,12 @@ private Xbgr1555(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs index 78b064ba..e6ae0ef7 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.XBGR4444)] - public readonly record struct Xbgr4444 + public readonly record struct Xbgr4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR4444); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xbgr4444 FromRGB(byte r, byte g, byte b) { - return new Xbgr4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Xbgr4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Xbgr4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Xbgr4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Xbgr4444(ushort value) @@ -47,12 +48,12 @@ private Xbgr4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs index 077a9153..3aa17835 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.XBGR8888)] - public readonly record struct Xbgr8888 + public readonly record struct Xbgr8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XBGR8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xbgr8888 FromRGB(byte r, byte g, byte b) { - return new Xbgr8888(_pixelFormat.MapRGB(r, g, b)); + return new Xbgr8888(_formatDescriptor.MapRGB(r, g, b)); } public static Xbgr8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Xbgr8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Xbgr8888(byte b, byte g, byte r) - : this(_pixelFormat.MapRGB(r, g, b)) + : this(_formatDescriptor.MapRGB(r, g, b)) { } private Xbgr8888(uint value) @@ -51,12 +52,12 @@ private Xbgr8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs index 4b723794..c54b4b03 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.XRGB1555)] - public readonly record struct Xrgb1555 + public readonly record struct Xrgb1555 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB1555); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB1555); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xrgb1555 FromRGB(byte r, byte g, byte b) { - return new Xrgb1555((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Xrgb1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Xrgb1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb1555((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Xrgb1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Xrgb1555(ushort value) @@ -47,12 +48,12 @@ private Xrgb1555(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs index 806ffdb9..ec973709 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs @@ -23,21 +23,22 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - [PixelFormat(PixelFormat.XRGB4444)] - public readonly record struct Xrgb4444 + public readonly record struct Xrgb4444 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB4444); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB4444); private readonly ushort _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xrgb4444 FromRGB(byte r, byte g, byte b) { - return new Xrgb4444((ushort)_pixelFormat.MapRGB(r, g, b)); + return new Xrgb4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } public static Xrgb4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb4444((ushort)_pixelFormat.MapRGBA(r, g, b, a)); + return new Xrgb4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private Xrgb4444(ushort value) @@ -47,12 +48,12 @@ private Xrgb4444(ushort value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs index a54baffd..fcb531eb 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs +++ b/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs @@ -23,25 +23,26 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.XRGB8888)] - public readonly record struct Xrgb8888 + public readonly record struct Xrgb8888 : IPackedPixel { - private static readonly PixelFormatDescriptor _pixelFormat = new(PixelFormat.XRGB8888); + private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB8888); private readonly uint _value; + public static PixelFormat Format => _formatDescriptor.Format; + public static Xrgb8888 FromRGB(byte r, byte g, byte b) { - return new Xrgb8888(_pixelFormat.MapRGB(r, g, b)); + return new Xrgb8888(_formatDescriptor.MapRGB(r, g, b)); } public static Xrgb8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb8888(_pixelFormat.MapRGBA(r, g, b, a)); + return new Xrgb8888(_formatDescriptor.MapRGBA(r, g, b, a)); } public Xrgb8888(byte r, byte g, byte b) - : this(_pixelFormat.MapRGB(r, g, b)) + : this(_formatDescriptor.MapRGB(r, g, b)) { } private Xrgb8888(uint value) @@ -51,12 +52,12 @@ private Xrgb8888(uint value) public (byte r, byte g, byte b) ToRGB() { - return _pixelFormat.GetRGB(_value); + return _formatDescriptor.GetRGB(_value); } public (byte r, byte g, byte b, byte a) ToRGBA() { - return _pixelFormat.GetRGBA(_value); + return _formatDescriptor.GetRGBA(_value); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Yuy2.cs b/sources/SDL2Sharp/Video/Colors/Yuy2.cs index 78e099c4..ddfc0c71 100644 --- a/sources/SDL2Sharp/Video/Colors/Yuy2.cs +++ b/sources/SDL2Sharp/Video/Colors/Yuy2.cs @@ -23,7 +23,6 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.YUY2)] public readonly record struct Yuy2 { private readonly uint _value; diff --git a/sources/SDL2Sharp/Video/Yv12.cs b/sources/SDL2Sharp/Video/Colors/Yv12.cs similarity index 67% rename from sources/SDL2Sharp/Video/Yv12.cs rename to sources/SDL2Sharp/Video/Colors/Yv12.cs index 5877341e..5d08f608 100644 --- a/sources/SDL2Sharp/Video/Yv12.cs +++ b/sources/SDL2Sharp/Video/Colors/Yv12.cs @@ -18,68 +18,69 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp.Video.Colors { - [PixelFormat(PixelFormat.YV12)] - public readonly struct Yv12 : IYuvPixelFormat + public readonly struct Yv12 : IYuvPixel { - public int GetYPlaneWidth(int imageWidth) + public static PixelFormat Format => PixelFormat.YV12; + + public static int GetYPlaneWidth(int imageWidth) { return imageWidth; } - public int GetYPlaneHeight(int imageHeight) + public static int GetYPlaneHeight(int imageHeight) { return imageHeight; } - public int GetYPlanePitch(int imagePitch) + public static int GetYPlanePitch(int imagePitch) { return imagePitch; } - public int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return 0; } - public int GetVPlaneWidth(int imageWidth) + public static int GetVPlaneWidth(int imageWidth) { return GetYPlaneHeight(imageWidth) / 2; } - public int GetVPlaneHeight(int imageHeight) + public static int GetVPlaneHeight(int imageHeight) { return GetYPlaneHeight(imageHeight) / 2; } - public int GetVPlanePitch(int imagePitch) + public static int GetVPlanePitch(int imagePitch) { return GetYPlanePitch(imagePitch) / 2; } - public int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); } - public int GetUPlaneWidth(int imageWidth) + public static int GetUPlaneWidth(int imageWidth) { return GetVPlaneWidth(imageWidth); } - public int GetUPlaneHeight(int imageHeight) + public static int GetUPlaneHeight(int imageHeight) { return GetVPlaneHeight(imageHeight); } - public int GetUPlanePitch(int imagePitch) + public static int GetUPlanePitch(int imagePitch) { return GetVPlanePitch(imagePitch); } - public int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) { return GetVPlaneOffset(imageWidth, imageHeight, imagePitch) + GetVPlaneHeight(imageHeight) * GetVPlanePitch(imagePitch); diff --git a/sources/SDL2Sharp/Video/Colors/Yvyu.cs b/sources/SDL2Sharp/Video/Colors/Yvyu.cs index 93072d04..781a5ba5 100644 --- a/sources/SDL2Sharp/Video/Colors/Yvyu.cs +++ b/sources/SDL2Sharp/Video/Colors/Yvyu.cs @@ -23,7 +23,6 @@ namespace SDL2Sharp.Video.Colors { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - [PixelFormat(PixelFormat.YVYU)] public readonly record struct Yvyu { private readonly uint _value; diff --git a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs index 8febcf01..aef285d6 100644 --- a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs +++ b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs @@ -23,13 +23,13 @@ namespace SDL2Sharp.Video { - public sealed class ImageMemoryPlane where TPackedPixelFormat : struct + public sealed class ImageMemoryPlane where TPackedPixel : struct { private readonly int _width; private readonly int _height; - private readonly TPackedPixelFormat[] _pixels; + private readonly TPackedPixel[] _pixels; public int Width => _width; @@ -37,7 +37,7 @@ public sealed class ImageMemoryPlane where TPackedPixelForma public Size Size => new(_width, _height); - public TPackedPixelFormat this[int x, int y] + public TPackedPixel this[int x, int y] { get { @@ -69,14 +69,14 @@ public ImageMemoryPlane(int width, int height) _width = width; _height = height; - _pixels = new TPackedPixelFormat[_height * _width]; + _pixels = new TPackedPixel[_height * _width]; } public ImageMemoryPlane(Size size) : this(size.Width, size.Height) { } - public ImageMemoryPlane Crop(int top, int left, int bottom, int right) + public ImageMemoryPlane Crop(int top, int left, int bottom, int right) { if (top < 0) { @@ -126,7 +126,7 @@ public ImageMemoryPlane Crop(int top, int left, int bottom, "The right of the crop rectangle cannot be less than or equal to the left of the crop rectangle."); } - var croppedImage = new ImageMemoryPlane(right - left, bottom - top); + var croppedImage = new ImageMemoryPlane(right - left, bottom - top); for (var y = 0; y < croppedImage.Height; ++y) { for (var x = 0; x < croppedImage.Width; ++x) @@ -137,7 +137,7 @@ public ImageMemoryPlane Crop(int top, int left, int bottom, return croppedImage; } - public ref TPackedPixelFormat DangerousGetReference() + public ref TPackedPixel DangerousGetReference() { return ref _pixels.DangerousGetReference(); } diff --git a/sources/SDL2Sharp/Video/ImagePlane.cs b/sources/SDL2Sharp/Video/ImagePlane.cs index eda497e2..2d049bfa 100644 --- a/sources/SDL2Sharp/Video/ImagePlane.cs +++ b/sources/SDL2Sharp/Video/ImagePlane.cs @@ -25,9 +25,9 @@ namespace SDL2Sharp.Video { - public readonly ref struct ImagePlane where TPackedPixelFormat : struct + public readonly ref struct ImagePlane where TPackedPixel : struct { - private readonly Span _pixels; + private readonly Span _pixels; private readonly int _width; @@ -53,7 +53,7 @@ public Size Size get => new(_width, _height); } - public ref TPackedPixelFormat this[int x, int y] + public ref TPackedPixel this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get @@ -120,7 +120,7 @@ public unsafe ImagePlane(void* pixels, int width, int height, int pitch) "pitch cannot be less than zero"); } - _pixels = new Span(pixels, height * pitch); + _pixels = new Span(pixels, height * pitch); _height = height; _width = width; _pitch = pitch; @@ -128,7 +128,7 @@ public unsafe ImagePlane(void* pixels, int width, int height, int pitch) [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ref TPackedPixelFormat DangerousGetReference() + public readonly ref TPackedPixel DangerousGetReference() { ref var r0 = ref MemoryMarshal.GetReference(_pixels); const int index = 0; @@ -137,7 +137,7 @@ public readonly ref TPackedPixelFormat DangerousGetReference() [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ref TPackedPixelFormat DangerousGetReferenceAt(int x, int y) + public readonly ref TPackedPixel DangerousGetReferenceAt(int x, int y) { ref var r0 = ref MemoryMarshal.GetReference(_pixels); var index = y * _pitch + x; @@ -145,7 +145,7 @@ public readonly ref TPackedPixelFormat DangerousGetReferenceAt(int x, int y) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly void Fill(TPackedPixelFormat value) + public readonly void Fill(TPackedPixel value) { _pixels.Fill(value); } diff --git a/sources/SDL2Sharp/Video/PackedImage.cs b/sources/SDL2Sharp/Video/PackedImage.cs index 35818d6f..1b7bfff2 100644 --- a/sources/SDL2Sharp/Video/PackedImage.cs +++ b/sources/SDL2Sharp/Video/PackedImage.cs @@ -23,9 +23,9 @@ namespace SDL2Sharp.Video { - public readonly ref struct PackedImage where TPackedPixelFormat : struct + public readonly ref struct PackedImage where TPackedPixel : struct { - private readonly ImagePlane _plane; + private readonly ImagePlane _plane; public int Width { @@ -45,7 +45,7 @@ public Size Size get => _plane.Size; } - public ref TPackedPixelFormat this[int x, int y] + public ref TPackedPixel this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => ref _plane[x, y]; @@ -53,25 +53,25 @@ public Size Size public unsafe PackedImage(void* pixels, int width, int height, int pitch) { - _plane = new ImagePlane(pixels, width, height, pitch); + _plane = new ImagePlane(pixels, width, height, pitch); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref TPackedPixelFormat DangerousGetReference() + public ref TPackedPixel DangerousGetReference() { return ref _plane.DangerousGetReference(); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref TPackedPixelFormat DangerousGetReferenceAt(int x, int y) + public ref TPackedPixel DangerousGetReferenceAt(int x, int y) { return ref _plane.DangerousGetReferenceAt(x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Fill(TPackedPixelFormat value) + public void Fill(TPackedPixel value) { _plane.Fill(value); } diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index 7fcbd9c6..a5cb2503 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -23,14 +23,16 @@ using System.Runtime.InteropServices; using Microsoft.Toolkit.HighPerformance; using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public sealed unsafe class PackedTexture : IDisposable where TPackedPixelFormat : struct + public sealed unsafe class PackedTexture : IDisposable + where TPackedPixel : struct, IPackedPixel { - public delegate void LockCallback(PackedImage pixels); + public delegate void LockCallback(PackedImage pixels); - public delegate void LockToSurfaceCallback(Surface surface); + public delegate void LockToSurfaceCallback(Surface surface); private Texture _texture; @@ -102,9 +104,9 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture, &rect, &pixels, &pitchInBytes) ); - var bytesPerPixel = Marshal.SizeOf(); + var bytesPerPixel = Marshal.SizeOf(); var pitch = pitchInBytes / bytesPerPixel; - var image = new PackedImage(pixels, width, height, pitch); + var image = new PackedImage(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture); } @@ -128,36 +130,36 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback Error.ThrowOnFailure( SDL.LockTextureToSurface(_texture, &rect, &surfaceHandle) ); - var surface = new Surface(surfaceHandle, false); + var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); SDL.UnlockTexture(_texture); } - public void Update(PackedMemoryImage image) + public void Update(PackedMemoryImage image) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref image.DangerousGetReference()); - var pitch = image.Width * Marshal.SizeOf(); + var pitch = image.Width * Marshal.SizeOf(); Update(null, pointer, pitch); } - public void Update(PackedImage pixels) + public void Update(PackedImage pixels) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); - var pitch = pixels.Width * Marshal.SizeOf(); + var pitch = pixels.Width * Marshal.SizeOf(); Update(null, pointer, pitch); } - public void Update(TPackedPixelFormat[,] pixels) + public void Update(TPackedPixel[,] pixels) { ThrowWhenDisposed(); var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); var width = pixels.GetLength(1); - var pitch = width * Marshal.SizeOf(); + var pitch = width * Marshal.SizeOf(); Update(null, pointer, pitch); } @@ -170,18 +172,12 @@ private void Update(SDL_Rect* rect, void* pixels, int pitch) private void ThrowWhenDisposed() { - if (_texture is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(PackedTexture texture) + public static implicit operator Texture(PackedTexture texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } + ArgumentNullException.ThrowIfNull(texture); return texture._texture; } diff --git a/sources/SDL2Sharp/Video/PixelFormatAttribute.cs b/sources/SDL2Sharp/Video/PixelFormatAttribute.cs deleted file mode 100644 index cbd7d95d..00000000 --- a/sources/SDL2Sharp/Video/PixelFormatAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Reflection; - -namespace SDL2Sharp.Video -{ - [AttributeUsage(AttributeTargets.Struct)] - internal sealed class PixelFormatAttribute : Attribute - { - public PixelFormat PixelFormat { get; } - - public PixelFormatAttribute(PixelFormat pixelFormat) - { - PixelFormat = pixelFormat; - } - - public static PixelFormat GetPixelFormatOf() - { - var pixelFormatType = typeof(TPackedPixelFormat); - var pixelFormatAttribute = pixelFormatType.GetCustomAttribute(); - if (pixelFormatAttribute == null) - { - throw new NotSupportedException($"The type {pixelFormatType} does not have a {nameof(PixelFormatAttribute)}."); - } - return pixelFormatAttribute.PixelFormat; - } - } -} diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index 3405b80b..f8ea827b 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -22,6 +22,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { @@ -415,30 +416,30 @@ public void Present() SDL.RenderPresent(_handle); } - public PackedMemoryImage ReadPixels() - where TPackedPixelFormat : struct + public PackedMemoryImage ReadPixels() + where TPackedPixel : struct, IPackedPixel { ThrowWhenDisposed(); - return ReadPixels( + return ReadPixels( new Rectangle(0, 0, OutputWidth, OutputHeight) ); } - public PackedMemoryImage ReadPixels(Rectangle rectangle) - where TPackedPixelFormat : struct + public PackedMemoryImage ReadPixels(Rectangle rectangle) + where TPackedPixel : struct, IPackedPixel { ThrowWhenDisposed(); var rect = new SDL_Rect { x = rectangle.X, y = rectangle.Y, w = rectangle.Width, h = rectangle.Height }; - var format = PixelFormatAttribute.GetPixelFormatOf(); - var image = new PackedMemoryImage(rectangle.Width, rectangle.Height); + var format = (uint)TPackedPixel.Format; + var image = new PackedMemoryImage(rectangle.Width, rectangle.Height); var pixels = Unsafe.AsPointer(ref image.DangerousGetReference()); - var pitch = rectangle.Width * Marshal.SizeOf(); + var pitch = rectangle.Width * Marshal.SizeOf(); Error.ThrowOnFailure( SDL.RenderReadPixels(_handle, &rect, - (uint)format, + format, pixels, pitch) ); diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index e5b9d4ff..5e6a1cb5 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -20,79 +20,62 @@ using System; using SDL2Sharp.Fonts; +using SDL2Sharp.Video.Colors; using static System.Math; namespace SDL2Sharp.Video { public static class RendererExtensions { - public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, Size size) - where TPackedPixelFormat : struct + public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, Size size) + where TPackedPixel : struct, IPackedPixel { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); - return renderer.CreatePackedTexture(access, size.Width, size.Height); + return renderer.CreatePackedTexture(access, size.Width, size.Height); } - public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TPackedPixelFormat : struct + public static PackedTexture CreatePackedTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TPackedPixel : struct, IPackedPixel { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); - var pixelFormat = PixelFormatAttribute.GetPixelFormatOf(); - var texture = renderer.CreateTexture((PixelFormat)pixelFormat, access, width, height); - return new PackedTexture(texture); + var pixelFormat = TPackedPixel.Format; + var texture = renderer.CreateTexture(pixelFormat, access, width, height); + return new PackedTexture(texture); } public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, Size size) - where TYuvPixelFormat : IYuvPixelFormat, new() + where TYuvPixelFormat : IYuvPixel, new() { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); return renderer.CreateYuvTexture(access, size.Width, size.Height); } public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TYuvPixelFormat : IYuvPixelFormat, new() + where TYuvPixelFormat : IYuvPixel, new() { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); - var pixelFormat = PixelFormatAttribute.GetPixelFormatOf(); + var pixelFormat = TYuvPixelFormat.Format; var texture = renderer.CreateTexture(pixelFormat, access, width, height); return new YuvTexture(texture); } - public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) - where TPackedPixelFormat : struct + public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) + where TPackedPixel : struct, IPackedPixel { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); var texture = renderer.CreateTextureFromSurface(surface); - var packedTexture = new PackedTexture(texture); + var packedTexture = new PackedTexture(texture); return packedTexture; } public static Texture CreateTextureFromBitmap(this Renderer renderer, string filename) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); if (string.IsNullOrWhiteSpace(filename)) { @@ -106,10 +89,7 @@ public static Texture CreateTextureFromBitmap(this Renderer renderer, string fil public static void DrawCircle(this Renderer renderer, int centerX, int centerY, int radius) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); if (radius < 0) { @@ -157,10 +137,7 @@ public static void DrawEllipse(this Renderer renderer, int centerX, int centerY, // // See: http://enchantia.com/software/graphapp/doc/tech/ellipses.html - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); if (radiusX < 0) { @@ -242,10 +219,7 @@ public static void FillEllipse(this Renderer renderer, int centerX, int centerY, // // See: http://enchantia.com/software/graphapp/doc/tech/ellipses.html - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); if (radiusX < 0) { @@ -358,20 +332,8 @@ void IncrementY() public static void DrawTextBlended(this Renderer renderer, int x, int y, Font font, string text) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } - - if (font is null) - { - throw new ArgumentNullException(nameof(font)); - } - - if (text is null) - { - throw new ArgumentNullException(nameof(text)); - } + ArgumentNullException.ThrowIfNull(renderer); + ArgumentNullException.ThrowIfNull(text); using var surface = font.RenderBlended(text, renderer.DrawColor); using var texture = renderer.CreateTextureFromSurface(surface); @@ -381,20 +343,8 @@ public static void DrawTextBlended(this Renderer renderer, int x, int y, Font fo } public static void DrawTextBlendedCentered(this Renderer renderer, Font font, string text) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } - - if (font is null) - { - throw new ArgumentNullException(nameof(font)); - } - - if (text is null) - { - throw new ArgumentNullException(nameof(text)); - } + ArgumentNullException.ThrowIfNull(renderer); + ArgumentNullException.ThrowIfNull(text); using var surface = font.RenderBlended(text, renderer.DrawColor); using var texture = renderer.CreateTextureFromSurface(surface); diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs index 1e4f514e..e44c5639 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -139,8 +139,8 @@ public void FillRect(uint color) ); } - public void WithLock(SurfaceLockCallback callback) - where TPackedPixelFormat : struct + public void WithLock(SurfaceLockCallback callback) + where TPackedPixel : struct { ThrowWhenDisposed(); @@ -152,10 +152,10 @@ public void WithLock(SurfaceLockCallback ); } - var bytesPerPixel = Marshal.SizeOf(); + var bytesPerPixel = Marshal.SizeOf(); var pitchInBytes = _handle->pitch; var pitch = pitchInBytes / bytesPerPixel; - var pixels = new PackedImage(_handle->pixels, _handle->h, _handle->w, pitch); + var pixels = new PackedImage(_handle->pixels, _handle->h, _handle->w, pitch); callback.Invoke(pixels); diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs index 1aece11b..eb228011 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -21,10 +21,12 @@ using System; using System.Collections.Generic; using SDL2Sharp.Interop; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public sealed class Surface : IDisposable where TPackedPixelFormat : struct + public sealed class Surface : IDisposable + where TPackedPixel : struct, IPackedPixel { private Surface _surface; @@ -39,7 +41,7 @@ public sealed class Surface : IDisposable where TPackedPixel public IEnumerable? Size { get; internal set; } public Surface(int width, int height) - : this(new Surface(width, height, (PixelFormat)PixelFormatAttribute.GetPixelFormatOf())) + : this(new Surface(width, height, TPackedPixel.Format)) { } internal unsafe Surface(SDL_Surface* surface) @@ -73,25 +75,23 @@ private void Dispose(bool _) _surface = null!; } - public void Blit(Surface surface) + public void Blit(Surface surface) { ThrowWhenDisposed(); - if (surface is null) - { - throw new ArgumentNullException(nameof(surface)); - } + ArgumentNullException.ThrowIfNull(surface); _surface.Blit(surface._surface); } - public Surface Convert() where TTargetColor : struct + public Surface Convert() + where TTargetPackedPixel : struct, IPackedPixel { ThrowWhenDisposed(); - var targetPixelFormat = PixelFormatAttribute.GetPixelFormatOf(); - var targetSurface = _surface.ConvertTo((PixelFormat)targetPixelFormat); - return new Surface(targetSurface); + var targetPixelFormat = TTargetPackedPixel.Format; + var targetSurface = _surface.ConvertTo(targetPixelFormat); + return new Surface(targetSurface); } public void FillRect(uint color) @@ -101,25 +101,19 @@ public void FillRect(uint color) _surface.FillRect(color); } - public void WithLock(SurfaceLockCallback callback) + public void WithLock(SurfaceLockCallback callback) { _surface.WithLock(callback); } private void ThrowWhenDisposed() { - if (_surface is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_surface is null, this); } - public static implicit operator Surface(Surface surface) + public static implicit operator Surface(Surface surface) { - if (surface is null) - { - throw new ArgumentNullException(nameof(surface)); - } + ArgumentNullException.ThrowIfNull(surface); return surface._surface; } diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index 32bffe96..3bcf73c6 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -19,15 +19,16 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { public static class TextureExtensions { - public static PackedTexture AsPacked(this Texture texture) - where TPacketColor : struct + public static PackedTexture AsPacked(this Texture texture) + where TPackedPixel : struct, IPackedPixel { - return new PackedTexture(texture); + return new PackedTexture(texture); } public static YuvTexture AsIYUV(this Texture texture) diff --git a/sources/SDL2Sharp/Video/YuvImage.cs b/sources/SDL2Sharp/Video/YuvImage.cs index 3ef28be7..7b71b8dc 100644 --- a/sources/SDL2Sharp/Video/YuvImage.cs +++ b/sources/SDL2Sharp/Video/YuvImage.cs @@ -24,10 +24,8 @@ namespace SDL2Sharp.Video { - public readonly ref struct YuvImage where TYuvPixelFormat : IYuvPixelFormat, new() + public readonly ref struct YuvImage where TYuvPixelFormat : IYuvPixel, new() { - private static readonly TYuvPixelFormat _format = new(); - private readonly ImagePlane _yPlane; private readonly ImagePlane _uPlane; @@ -78,24 +76,24 @@ public unsafe YuvImage(void* pixels, int width, int height, int pitch) "pitch cannot be less than zero"); } - var yPlaneHeight = _format.GetYPlaneHeight(height); - var yPlaneWidth = _format.GetYPlaneWidth(width); - var yPlanePitch = _format.GetYPlanePitch(pitch); - var yPlaneOffset = _format.GetYPlaneOffset(width, height, pitch); + var yPlaneHeight = TYuvPixelFormat.GetYPlaneHeight(height); + var yPlaneWidth = TYuvPixelFormat.GetYPlaneWidth(width); + var yPlanePitch = TYuvPixelFormat.GetYPlanePitch(pitch); + var yPlaneOffset = TYuvPixelFormat.GetYPlaneOffset(width, height, pitch); var yPlanePixels = Unsafe.Add(pixels, yPlaneOffset); _yPlane = new ImagePlane(yPlanePixels, yPlaneWidth, yPlaneHeight, yPlanePitch); - var uPlaneHeight = _format.GetUPlaneHeight(height); - var uPlaneWidth = _format.GetUPlaneWidth(width); - var uPlanePitch = _format.GetUPlanePitch(pitch); - var uPlaneOffset = _format.GetUPlaneOffset(width, height, pitch); + var uPlaneHeight = TYuvPixelFormat.GetUPlaneHeight(height); + var uPlaneWidth = TYuvPixelFormat.GetUPlaneWidth(width); + var uPlanePitch = TYuvPixelFormat.GetUPlanePitch(pitch); + var uPlaneOffset = TYuvPixelFormat.GetUPlaneOffset(width, height, pitch); var uPlanePixels = Unsafe.Add(pixels, uPlaneOffset); _uPlane = new ImagePlane(uPlanePixels, uPlaneWidth, uPlaneHeight, uPlanePitch); - var vPlaneHeight = _format.GetVPlaneHeight(height); - var vPlaneWidth = _format.GetVPlaneWidth(width); - var vPlanePitch = _format.GetVPlanePitch(pitch); - var vPlaneOffset = _format.GetVPlaneOffset(width, height, pitch); + var vPlaneHeight = TYuvPixelFormat.GetVPlaneHeight(height); + var vPlaneWidth = TYuvPixelFormat.GetVPlaneWidth(width); + var vPlanePitch = TYuvPixelFormat.GetVPlanePitch(pitch); + var vPlaneOffset = TYuvPixelFormat.GetVPlaneOffset(width, height, pitch); var vPlanePixels = Unsafe.Add(pixels, vPlaneOffset); _vPlane = new ImagePlane(vPlanePixels, vPlaneWidth, vPlaneHeight, vPlanePitch); } diff --git a/sources/SDL2Sharp/Video/YuvTexture.cs b/sources/SDL2Sharp/Video/YuvTexture.cs index 64025d13..f166383c 100644 --- a/sources/SDL2Sharp/Video/YuvTexture.cs +++ b/sources/SDL2Sharp/Video/YuvTexture.cs @@ -26,7 +26,7 @@ namespace SDL2Sharp.Video { - public sealed unsafe partial class YuvTexture : IDisposable where TYuvPixelFormat : IYuvPixelFormat, new() + public sealed unsafe partial class YuvTexture : IDisposable where TYuvPixelFormat : IYuvPixel, new() { public delegate void LockCallback(YuvImage pixels); diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs index 24234985..27ad3a7c 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -173,7 +173,7 @@ public static void WriteAndReadRgb565() => WriteAndRead( ); private static void WriteAndRead(Func colorGenerator) - where TPackedPixelFormat : struct, IEquatable + where TPackedPixelFormat : struct, IPackedPixel { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); diff --git a/tests/SDL2Sharp.Tests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/SurfaceTests.cs index 424a043d..c648a8e9 100644 --- a/tests/SDL2Sharp.Tests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/SurfaceTests.cs @@ -41,23 +41,5 @@ public void CreateSurfaceOfArgb8888() using var surface = new Surface(512, 512); surface.WithLock(pixels => pixels.Fill(color)); } - - [Fact] - public void CreateSurfaceOfYuy2() - { - Assert.Throws(() => new Surface(512, 512)); - } - - [Fact] - public void CreateSurfaceOfYvyu() - { - Assert.Throws(() => new Surface(512, 512)); - } - - [Fact] - public void CreateSurfaceOfUyvy() - { - Assert.Throws(() => new Surface(512, 512)); - } } } From dc5e9212e90a69a26cf60393758c02f62cf84bf0 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 25 Jul 2024 11:39:52 +0200 Subject: [PATCH 36/62] Disable DotNet analyzer rules CA1401 and SYLIB1054. CA1401: P/Invoke method '*' should not be visible. SYSLIB1054: Mark the method '*' with 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time. --- .editorconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.editorconfig b/.editorconfig index 519f49d2..f9cfe594 100644 --- a/.editorconfig +++ b/.editorconfig @@ -321,3 +321,12 @@ dotnet_diagnostic.IDE2004.severity = warning # Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858 # Additionally, there is a risk of accidentally breaking an internal API that partners rely on though IVT. dotnet_diagnostic.CA1822.severity = suggestion + +############################################################################### +# Set dotnet analyzer rules to: +# disable CA1401: P/Invoke method '*' should not be visible +# disable SYSLIB1054: Mark the method '*' with 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time +############################################################################### +[*.cs] +dotnet_diagnostic.CA1401.severity = silent +dotnet_diagnostic.SYSLIB1054.severity = silent From b933a24c075005bd1aa6a307e5d681f5e22a8d87 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 25 Jul 2024 12:13:07 +0200 Subject: [PATCH 37/62] Refactor error handling. --- samples/ParticleSystem/Particle.cs | 5 +- samples/ParticleSystem/ParticleEmitter.cs | 5 +- samples/RayTracer/Camera.cs | 5 +- sources/SDL2Sharp/Audio/AudioDevice.cs | 4 +- sources/SDL2Sharp/Audio/AudioSubsystem.cs | 6 +- .../SDL2Sharp/Audio/ReadOnlySpanExtensions.cs | 12 +--- sources/SDL2Sharp/Audio/WaveFile.cs | 6 +- sources/SDL2Sharp/Error.cs | 53 +++++++------- sources/SDL2Sharp/Fonts/Font.cs | 23 ++----- sources/SDL2Sharp/Fonts/FontError.cs | 55 +++++++-------- sources/SDL2Sharp/Fonts/FontSubsystem.cs | 6 +- sources/SDL2Sharp/Input/EventSubsystem.cs | 4 +- sources/SDL2Sharp/MainSystem.cs | 6 +- sources/SDL2Sharp/ThreadExtensions.cs | 5 +- sources/SDL2Sharp/Video/Cursor.cs | 6 +- sources/SDL2Sharp/Video/Display.cs | 10 +-- sources/SDL2Sharp/Video/Nv12Texture.cs | 28 ++++---- sources/SDL2Sharp/Video/Nv21Texture.cs | 24 +++---- sources/SDL2Sharp/Video/PackedTexture.cs | 16 ++--- .../SDL2Sharp/Video/PixelFormatDescriptor.cs | 20 ++---- sources/SDL2Sharp/Video/Renderer.cs | 69 +++++++++---------- sources/SDL2Sharp/Video/RendererExtensions.cs | 8 +-- sources/SDL2Sharp/Video/Surface.cs | 40 ++++------- sources/SDL2Sharp/Video/Texture.cs | 38 ++++------ sources/SDL2Sharp/Video/VideoSubsystem.cs | 4 +- sources/SDL2Sharp/Video/Window.cs | 23 +++---- sources/SDL2Sharp/Video/YuvTexture.cs | 20 +++--- 27 files changed, 208 insertions(+), 293 deletions(-) diff --git a/samples/ParticleSystem/Particle.cs b/samples/ParticleSystem/Particle.cs index b25d77d8..5afcbfad 100644 --- a/samples/ParticleSystem/Particle.cs +++ b/samples/ParticleSystem/Particle.cs @@ -65,10 +65,7 @@ public void Update(TimeSpan elapsedTime) public void Render(Renderer renderer) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); renderer.DrawColor = Color; renderer.BlendMode = BlendMode.Blend; diff --git a/samples/ParticleSystem/ParticleEmitter.cs b/samples/ParticleSystem/ParticleEmitter.cs index 60b75bb8..54afd9fd 100644 --- a/samples/ParticleSystem/ParticleEmitter.cs +++ b/samples/ParticleSystem/ParticleEmitter.cs @@ -73,10 +73,7 @@ public void Update(TimeSpan elapsedTime) public void Render(Renderer renderer) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); foreach (var particle in Particles) { diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index ea22d19f..135d9b11 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -124,10 +124,7 @@ public void Roll(float radians) public PackedMemoryImage TakeSnapshot(World world) { - if (world is null) - { - throw new ArgumentNullException(nameof(world)); - } + ArgumentNullException.ThrowIfNull(world); var rotationMatrix = Matrix4x4.CreateFromQuaternion(Quaternion.Inverse(_orientation)); var translationMatrix = Matrix4x4.CreateTranslation(-_position); diff --git a/sources/SDL2Sharp/Audio/AudioDevice.cs b/sources/SDL2Sharp/Audio/AudioDevice.cs index 244dd6b5..3d5bd964 100644 --- a/sources/SDL2Sharp/Audio/AudioDevice.cs +++ b/sources/SDL2Sharp/Audio/AudioDevice.cs @@ -151,7 +151,7 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe _deviceID = SDL.OpenAudioDevice(null, 0, &desiredSpec, &obtainedSpec, (int)allowedChanges); if (_deviceID == 0) { - error = new Error(new string(SDL.GetError())); + error = Error.GetLastError(); return false; } else @@ -217,7 +217,7 @@ public void Queue(Span buffer) ThrowIfClosed(); fixed (void* data = &buffer[0]) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.QueueAudio(_deviceID, data, (uint)buffer.Length) ); } diff --git a/sources/SDL2Sharp/Audio/AudioSubsystem.cs b/sources/SDL2Sharp/Audio/AudioSubsystem.cs index 21070615..88101ca0 100644 --- a/sources/SDL2Sharp/Audio/AudioSubsystem.cs +++ b/sources/SDL2Sharp/Audio/AudioSubsystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -31,7 +31,9 @@ public sealed class AudioSubsystem : IDisposable public AudioSubsystem() { - SDL.InitSubSystem(InitSubsystemFlags); + Error.ThrowLastErrorIfNegative( + SDL.InitSubSystem(InitSubsystemFlags) + ); } public void Dispose() diff --git a/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs b/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs index 21588eb5..8830b1fe 100644 --- a/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs +++ b/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -26,11 +26,6 @@ public static class ReadOnlySpanExtensions { public static unsafe short ToInt16(this ReadOnlySpan bytes, int sampleOffset, bool isLittleEndian) { - if (bytes == null) - { - throw new ArgumentNullException(nameof(bytes)); - } - if (sampleOffset < 0) { throw new ArgumentOutOfRangeException(nameof(sampleOffset), sampleOffset, "startIndex cannot be less than zero"); @@ -65,11 +60,6 @@ public static unsafe ushort ToUInt16(this ReadOnlySpan bytes, int sampleOf public static unsafe int ToInt32(this ReadOnlySpan bytes, int sampleOffset, bool isLittleEndian) { - if (bytes == null) - { - throw new ArgumentNullException(nameof(bytes)); - } - if (sampleOffset < 0) { throw new ArgumentOutOfRangeException(nameof(sampleOffset), sampleOffset, "startIndex cannot be less than zero"); diff --git a/sources/SDL2Sharp/Audio/WaveFile.cs b/sources/SDL2Sharp/Audio/WaveFile.cs index 61939a81..cd594afd 100644 --- a/sources/SDL2Sharp/Audio/WaveFile.cs +++ b/sources/SDL2Sharp/Audio/WaveFile.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -52,7 +52,7 @@ internal WaveFile(string filename) { using var unmanagedFilename = new MarshaledString(filename); using var unmanagedMode = new MarshaledString("rb"); - var fileStream = Error.ReturnOrThrowOnFailure( + var fileStream = Error.ThrowLastErrorIfNull( SDL.RWFromFile(unmanagedFilename, unmanagedMode) ); @@ -60,7 +60,7 @@ internal WaveFile(string filename) fixed (byte** waveBuffer = &_waveBuffer) fixed (uint* waveLength = &_waveLength) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNull( SDL.LoadWAV_RW(fileStream, 1, waveSpec, waveBuffer, waveLength) ); } diff --git a/sources/SDL2Sharp/Error.cs b/sources/SDL2Sharp/Error.cs index 00b1e83d..58414b3f 100644 --- a/sources/SDL2Sharp/Error.cs +++ b/sources/SDL2Sharp/Error.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.Serialization; using SDL2Sharp.Interop; namespace SDL2Sharp @@ -32,54 +31,50 @@ public Error(string message) : base(message) { } - public Error(SerializationInfo info, StreamingContext context) - : base(info, context) - { } - public Error(string message, Exception innerException) : base(message, innerException) { } - internal static unsafe void ThrowOnFailure(void* pointer) + public static unsafe Error GetLastError() { - if (pointer is null) - { - throw new Error(new string(SDL.GetError())); - } + return new Error(new string(SDL.GetError())); } - internal static unsafe void ThrowOnFailure(int returnCode) + public static void ThrowLastError() { - if (returnCode < 0) - { - throw new Error(new string(SDL.GetError())); - } + throw GetLastError(); } - internal static unsafe void ThrowOnFailure(uint returnCode) + public static void ThrowLastErrorIf(bool condition) { - if (returnCode == 0) + if (condition) { - throw new Error(new string(SDL.GetError())); + ThrowLastError(); } } - internal static unsafe uint ReturnOrThrowOnFailure(uint returnCode) + public static unsafe void* ThrowLastErrorIfNull(void* pointer) { - if (returnCode == 0) - { - throw new Error(new string(SDL.GetError())); - } - return returnCode; + ThrowLastErrorIf(pointer is null); + + return pointer; } - internal static unsafe T* ReturnOrThrowOnFailure(T* pointer) where T : unmanaged + public static unsafe T* ThrowLastErrorIfNull(T* pointer) where T : unmanaged { - if (pointer is null) - { - throw new Error(new string(SDL.GetError())); - } + ThrowLastErrorIf(pointer is null); + return pointer; } + + public static void ThrowLastErrorIfNegative(int returnCode) + { + ThrowLastErrorIf(returnCode < 0); + } + + public static void ThrowLastErrorIfZero(uint returnCode) + { + ThrowLastErrorIf(returnCode == 0); + } } } diff --git a/sources/SDL2Sharp/Fonts/Font.cs b/sources/SDL2Sharp/Fonts/Font.cs index 1a555e46..2fcb7931 100644 --- a/sources/SDL2Sharp/Fonts/Font.cs +++ b/sources/SDL2Sharp/Fonts/Font.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -30,11 +30,13 @@ public sealed unsafe class Font : IDisposable { private _TTF_Font* _handle; + internal _TTF_Font* Handle => _handle; + internal Font(string path, int pointSize) { using var marshaledPath = new MarshaledString(path); var handle = TTF.OpenFont(marshaledPath, pointSize); - FontError.ThrowOnFailure(handle); + FontError.ThrowLastErrorIfNull(handle); _handle = handle; } @@ -59,6 +61,7 @@ private void Dispose(bool _) public Surface RenderSolid(string text, Color color) { ThrowWhenDisposed(); + using var marshaledText = new MarshaledString(text); var surfaceHandle = TTF.RenderText_Solid(_handle, marshaledText, color); return new Surface(surfaceHandle); @@ -67,27 +70,15 @@ public Surface RenderSolid(string text, Color color) public Surface RenderBlended(string text, Color color) { ThrowWhenDisposed(); + using var marshaledText = new MarshaledString(text); var surfaceHandle = TTF.RenderText_Blended(_handle, marshaledText, color); return new Surface(surfaceHandle); } - public static implicit operator _TTF_Font*(Font font) - { - if (font is null) - { - throw new ArgumentNullException(nameof(font)); - } - - return font._handle; - } - private void ThrowWhenDisposed() { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_handle is null, this); } } } diff --git a/sources/SDL2Sharp/Fonts/FontError.cs b/sources/SDL2Sharp/Fonts/FontError.cs index 6678e77d..9995872b 100644 --- a/sources/SDL2Sharp/Fonts/FontError.cs +++ b/sources/SDL2Sharp/Fonts/FontError.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.Serialization; using SDL2Sharp.Interop; namespace SDL2Sharp.Fonts @@ -32,54 +31,52 @@ public FontError(string message) : base(message) { } - public FontError(SerializationInfo info, StreamingContext context) - : base(info, context) - { } - public FontError(string message, Exception innerException) : base(message, innerException) { } - internal static unsafe void ThrowOnFailure(void* pointer) + public static unsafe FontError GetLastError() { - if (pointer is null) - { - throw new FontError(new string(TTF.GetError())); - } + return new FontError(new string(TTF.GetError())); } - internal static unsafe void ThrowOnFailure(int returnCode) + public static void ThrowLastError() { - if (returnCode < 0) - { - throw new Error(new string(TTF.GetError())); - } + throw GetLastError(); } - internal static unsafe void ThrowOnFailure(uint returnCode) + public static void ThrowLastErrorIf(bool condition) { - if (returnCode == 0) + if (condition) { - throw new Error(new string(TTF.GetError())); + ThrowLastError(); } } - internal static unsafe uint ReturnOrThrowOnFailure(uint returnCode) + public static unsafe void* ThrowLastErrorIfNull(void* pointer) { - if (returnCode == 0) - { - throw new Error(new string(TTF.GetError())); - } - return returnCode; + ThrowLastErrorIf(pointer is null); + + return pointer; + } + + public static void ThrowLastErrorIfNegative(int returnCode) + { + ThrowLastErrorIf(returnCode < 0); } - internal static unsafe T* ReturnOrThrowOnFailure(T* pointer) where T : unmanaged + public static void ThrowLastErrorIfZero(uint returnCode) { - if (pointer is null) + ThrowLastErrorIf(returnCode == 0); + } + + internal static uint ReturnOrThrowOnFailure(uint returnCode) + { + if (returnCode == 0) { - throw new Error(new string(TTF.GetError())); + ThrowLastError(); } - return pointer; + return returnCode; } } } diff --git a/sources/SDL2Sharp/Fonts/FontSubsystem.cs b/sources/SDL2Sharp/Fonts/FontSubsystem.cs index 7667bad1..dc69dafd 100644 --- a/sources/SDL2Sharp/Fonts/FontSubsystem.cs +++ b/sources/SDL2Sharp/Fonts/FontSubsystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -27,7 +27,9 @@ public sealed class FontSubsystem : IDisposable { public FontSubsystem() { - TTF.Init(); + Error.ThrowLastErrorIfNegative( + TTF.Init() + ); } public void Dispose() diff --git a/sources/SDL2Sharp/Input/EventSubsystem.cs b/sources/SDL2Sharp/Input/EventSubsystem.cs index 4a68d7cb..45bf9680 100644 --- a/sources/SDL2Sharp/Input/EventSubsystem.cs +++ b/sources/SDL2Sharp/Input/EventSubsystem.cs @@ -39,7 +39,7 @@ public sealed unsafe class EventSubsystem : IDisposable public EventSubsystem() { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.InitSubSystem(InitSubsystemFlags) ); @@ -79,7 +79,7 @@ public void PushEvent(Event @event) { var eventHandle = @event.Handle; var result = SDL.PushEvent(&@eventHandle); - Error.ThrowOnFailure(result); + Error.ThrowLastErrorIfNegative(result); } diff --git a/sources/SDL2Sharp/MainSystem.cs b/sources/SDL2Sharp/MainSystem.cs index 52d59d3b..c0b6e206 100644 --- a/sources/SDL2Sharp/MainSystem.cs +++ b/sources/SDL2Sharp/MainSystem.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -27,7 +27,9 @@ public sealed class MainSystem : IDisposable { public MainSystem() { - SDL.Init(0); + Error.ThrowLastErrorIfNegative( + SDL.Init(0) + ); } public void Dispose() diff --git a/sources/SDL2Sharp/ThreadExtensions.cs b/sources/SDL2Sharp/ThreadExtensions.cs index aa7dd3ff..642e59e9 100644 --- a/sources/SDL2Sharp/ThreadExtensions.cs +++ b/sources/SDL2Sharp/ThreadExtensions.cs @@ -27,10 +27,7 @@ public static class ThreadExtensions { public static void SafeJoin(this Thread thread) { - if (thread is null) - { - throw new ArgumentNullException(nameof(thread)); - } + ArgumentNullException.ThrowIfNull(thread); if (thread.ThreadState != ThreadState.Unstarted) { diff --git a/sources/SDL2Sharp/Video/Cursor.cs b/sources/SDL2Sharp/Video/Cursor.cs index 120f0de8..6899c388 100644 --- a/sources/SDL2Sharp/Video/Cursor.cs +++ b/sources/SDL2Sharp/Video/Cursor.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -31,14 +31,14 @@ public static class Cursor public static bool Show() { var result = SDL.ShowCursor(SDL.SDL_ENABLE); - Error.ThrowOnFailure(result); + Error.ThrowLastErrorIfNegative(result); return result == SDL.SDL_ENABLE; } public static bool Hide() { var result = SDL.ShowCursor(SDL.SDL_DISABLE); - Error.ThrowOnFailure(result); + Error.ThrowLastErrorIfNegative(result); return result == SDL.SDL_DISABLE; } } diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/Video/Display.cs index 2b03a971..94340da7 100644 --- a/sources/SDL2Sharp/Video/Display.cs +++ b/sources/SDL2Sharp/Video/Display.cs @@ -32,7 +32,7 @@ public string Name get { return new string( - Error.ReturnOrThrowOnFailure( + Error.ThrowLastErrorIfNull( SDL.GetDisplayName(_displayIndex) ) ); @@ -44,7 +44,7 @@ public Rectangle Bounds get { var rect = new SDL_Rect(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetDisplayBounds(_displayIndex, &rect) ); return new Rectangle(rect.x, rect.y, rect.w, rect.h); @@ -56,7 +56,7 @@ public DisplayMode CurrentMode get { var displayMode = new SDL_DisplayMode(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetCurrentDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( @@ -72,7 +72,7 @@ public DisplayMode DesktopMode get { var displayMode = new SDL_DisplayMode(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetDesktopDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( @@ -92,7 +92,7 @@ public IReadOnlyList Modes for (var modeIndex = 0; modeIndex < modeCount; modeIndex++) { var displayMode = new SDL_DisplayMode(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetDisplayMode(_displayIndex, modeIndex, &displayMode) ); modes.Add(new DisplayMode( diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/Nv12Texture.cs index 1e44562b..bee8f991 100644 --- a/sources/SDL2Sharp/Video/Nv12Texture.cs +++ b/sources/SDL2Sharp/Video/Nv12Texture.cs @@ -84,18 +84,20 @@ public void WithLock(Rectangle rectangle, LockCallback callback) public void WithLock(int x, int y, int width, int height, LockCallback callback) { + ArgumentNullException.ThrowIfNull(callback); + ThrowWhenDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; int pitch; - Error.ThrowOnFailure( - SDL.LockTexture(_texture, &rect, &pixels, &pitch) + Error.ThrowLastErrorIfNegative( + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new Nv12Image(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture); + SDL.UnlockTexture(_texture.Handle); } public void Update(Nv12Image image) @@ -104,32 +106,32 @@ public void Update(Nv12Image image) var yPitch = image.Y.Width * Marshal.SizeOf(); var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); var uvPitch = image.UV.Width * Marshal.SizeOf(); - SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + ); } public void Update(Nv12MemoryImage image) { + ArgumentNullException.ThrowIfNull(image); + var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); var yPitch = image.Y.Width * Marshal.SizeOf(); var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); var uvPitch = image.UV.Width * Marshal.SizeOf(); - SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + ); } private void ThrowWhenDisposed() { - if (_texture is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_texture is null, this); } public static implicit operator Texture(Nv12Texture texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } + ArgumentNullException.ThrowIfNull(texture); return texture._texture; } diff --git a/sources/SDL2Sharp/Video/Nv21Texture.cs b/sources/SDL2Sharp/Video/Nv21Texture.cs index a9ebaa6e..805a20c8 100644 --- a/sources/SDL2Sharp/Video/Nv21Texture.cs +++ b/sources/SDL2Sharp/Video/Nv21Texture.cs @@ -89,13 +89,13 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; int pitch; - Error.ThrowOnFailure( - SDL.LockTexture(_texture, &rect, &pixels, &pitch) + Error.ThrowLastErrorIfNegative( + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new Nv21Image(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture); + SDL.UnlockTexture(_texture.Handle); } public void Update(Nv21Image image) @@ -104,7 +104,9 @@ public void Update(Nv21Image image) var yPitch = image.Y.Width * Marshal.SizeOf(); var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); var uvPitch = image.VU.Width * Marshal.SizeOf(); - SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + ); } public void Update(Nv21MemoryImage image) @@ -113,23 +115,19 @@ public void Update(Nv21MemoryImage image) var yPitch = image.Y.Width * Marshal.SizeOf(); var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); var uvPitch = image.VU.Width * Marshal.SizeOf(); - SDL.UpdateNVTexture(_texture, null, yPlane, yPitch, uvPlane, uvPitch); + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + ); } private void ThrowWhenDisposed() { - if (_texture is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_texture is null, this); } public static implicit operator Texture(Nv21Texture texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } + ArgumentNullException.ThrowIfNull(texture); return texture._texture; } diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index a5cb2503..6143e144 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -100,15 +100,15 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; int pitchInBytes; - Error.ThrowOnFailure( - SDL.LockTexture(_texture, &rect, &pixels, &pitchInBytes) + Error.ThrowLastErrorIfNegative( + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitchInBytes) ); var bytesPerPixel = Marshal.SizeOf(); var pitch = pitchInBytes / bytesPerPixel; var image = new PackedImage(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture); + SDL.UnlockTexture(_texture.Handle); } public void WithLock(LockToSurfaceCallback callback) @@ -127,12 +127,12 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; - Error.ThrowOnFailure( - SDL.LockTextureToSurface(_texture, &rect, &surfaceHandle) + Error.ThrowLastErrorIfNegative( + SDL.LockTextureToSurface(_texture.Handle, &rect, &surfaceHandle) ); var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); - SDL.UnlockTexture(_texture); + SDL.UnlockTexture(_texture.Handle); } public void Update(PackedMemoryImage image) @@ -165,8 +165,8 @@ public void Update(TPackedPixel[,] pixels) private void Update(SDL_Rect* rect, void* pixels, int pitch) { - Error.ThrowOnFailure( - SDL.UpdateTexture(_texture, rect, pixels, pitch) + Error.ThrowLastErrorIfNegative( + SDL.UpdateTexture(_texture.Handle, rect, pixels, pitch) ); } diff --git a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs index b57ccd1b..0b2fa814 100644 --- a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs +++ b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs @@ -29,6 +29,8 @@ public sealed unsafe class PixelFormatDescriptor : IDisposable private readonly bool _ownsHandle; + internal SDL_PixelFormat* Handle => _handle; + public PixelFormat Format => (PixelFormat)_handle->format; public byte BitsPerPixel => _handle->BitsPerPixel; @@ -61,17 +63,13 @@ public sealed unsafe class PixelFormatDescriptor : IDisposable internal PixelFormatDescriptor(SDL_PixelFormat* handle, bool ownsHandle) { - if (handle == null) - { - throw new ArgumentNullException(nameof(handle)); - } - + ArgumentNullException.ThrowIfNull(handle); _handle = handle; _ownsHandle = ownsHandle; } public PixelFormatDescriptor(PixelFormat pixelFormat) - : this(Error.ReturnOrThrowOnFailure(SDL.AllocFormat((uint)pixelFormat)), true) + : this(Error.ThrowLastErrorIfNull(SDL.AllocFormat((uint)pixelFormat)), true) { } ~PixelFormatDescriptor() @@ -114,15 +112,5 @@ public uint MapRGBA(byte r, byte g, byte b, byte a) SDL.GetRGBA(value, _handle, &r, &g, &b, &a); return (r, g, b, a); } - - public static implicit operator SDL_PixelFormat*(PixelFormatDescriptor pixelFormat) - { - if (pixelFormat is null) - { - throw new ArgumentNullException(nameof(pixelFormat)); - } - - return pixelFormat._handle; - } } } diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index f8ea827b..bfcbdc10 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -39,7 +39,7 @@ public RendererInfo Info ThrowWhenDisposed(); var rendererInfo = new SDL_RendererInfo(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRendererInfo(_handle, &rendererInfo) ); return new RendererInfo(rendererInfo); @@ -53,7 +53,7 @@ public Size OutputSize ThrowWhenDisposed(); int width, height; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRendererOutputSize(_handle, &width, &height) ); return new Size(width, height); @@ -67,7 +67,7 @@ public int OutputWidth ThrowWhenDisposed(); int width; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRendererOutputSize(_handle, &width, null) ); return width; @@ -81,7 +81,7 @@ public int OutputHeight ThrowWhenDisposed(); int height; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRendererOutputSize(_handle, null, &height) ); return height; @@ -95,7 +95,7 @@ public Color DrawColor ThrowWhenDisposed(); byte r, g, b, a; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRenderDrawColor(_handle, &r, &g, &b, &a) ); return new Color(r, g, b, a); @@ -104,7 +104,7 @@ public Color DrawColor { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetRenderDrawColor(_handle, value.R, value.G, value.B, value.A) ); } @@ -117,7 +117,7 @@ public BlendMode BlendMode ThrowWhenDisposed(); SDL_BlendMode blendMode; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetRenderDrawBlendMode(_handle, &blendMode) ); return (BlendMode)blendMode; @@ -126,7 +126,7 @@ public BlendMode BlendMode { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetRenderDrawBlendMode(_handle, (SDL_BlendMode)value) ); } @@ -146,7 +146,7 @@ public Size LogicalViewSize { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderSetLogicalSize(_handle, value.Width, value.Height) ); } @@ -167,7 +167,7 @@ public Scale Scale { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderSetScale(_handle, value.X, value.Y) ); } @@ -188,7 +188,7 @@ public Rectangle ViewPort ThrowWhenDisposed(); var rect = new SDL_Rect { x = value.X, y = value.Y, w = value.Width, h = value.Height }; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderSetViewport(_handle, &rect) ); } @@ -208,14 +208,14 @@ public Texture? Target if (value is null) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetRenderTarget(_handle, null) ); } else { - Error.ThrowOnFailure( - SDL.SetRenderTarget(_handle, value) + Error.ThrowLastErrorIfNegative( + SDL.SetRenderTarget(_handle, value.Handle) ); } @@ -225,10 +225,7 @@ public Texture? Target internal Renderer(SDL_Renderer* renderer) { - if (renderer is null) - { - throw new ArgumentNullException(nameof(renderer)); - } + ArgumentNullException.ThrowIfNull(renderer); _handle = renderer; } @@ -261,7 +258,7 @@ public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, int ThrowWhenDisposed(); var texture = SDL.CreateTexture(_handle, (uint)pixelFormat, (int)access, width, height); - Error.ThrowOnFailure(texture); + Error.ThrowLastErrorIfNull(texture); return new Texture(texture); } @@ -269,8 +266,8 @@ public Texture CreateTextureFromSurface(Surface surface) { ThrowWhenDisposed(); - var texture = SDL.CreateTextureFromSurface(_handle, surface); - Error.ThrowOnFailure(texture); + var texture = SDL.CreateTextureFromSurface(_handle, surface.Handle); + Error.ThrowLastErrorIfNull(texture); return new Texture(texture); } @@ -278,7 +275,7 @@ public void Clear() { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderClear(_handle) ); } @@ -287,8 +284,8 @@ public void Copy(Texture texture) { ThrowWhenDisposed(); - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, null, null) + Error.ThrowLastErrorIfNegative( + SDL.RenderCopy(_handle, texture.Handle, null, null) ); } @@ -304,8 +301,8 @@ public void Copy(Texture texture, Rectangle destination) h = destination.Height }; - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, null, &dest) + Error.ThrowLastErrorIfNegative( + SDL.RenderCopy(_handle, texture.Handle, null, &dest) ); } @@ -329,8 +326,8 @@ public void Copy(Texture texture, Rectangle source, Rectangle destination) h = destination.Height }; - Error.ThrowOnFailure( - SDL.RenderCopy(_handle, texture, &src, &dest) + Error.ThrowLastErrorIfNegative( + SDL.RenderCopy(_handle, texture.Handle, &src, &dest) ); } @@ -338,7 +335,7 @@ public void DrawLine(int x1, int y1, int x2, int y2) { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawLine(_handle, x1, y1, x2, y2) ); } @@ -349,7 +346,7 @@ public void DrawLines(Point[] points) fixed (Point* point = &points[0]) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawLines(_handle, (SDL_Point*)point, points.Length) ); } @@ -359,7 +356,7 @@ public void DrawLine(float x1, float y1, float x2, float y2) { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawLineF(_handle, x1, y1, x2, y2) ); } @@ -368,7 +365,7 @@ public void DrawPoint(int x, int y) { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawPoint(_handle, x, y) ); } @@ -377,7 +374,7 @@ public void DrawPoint(float x, float y) { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawPointF(_handle, x, y) ); } @@ -388,7 +385,7 @@ public void DrawPoints(Point[] points) fixed (Point* point = &points[0]) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderDrawPoints(_handle, (SDL_Point*)point, points.Length) ); } @@ -399,7 +396,7 @@ public void FillRect(int x, int y, int width, int height) ThrowWhenDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderFillRect(_handle, &rect) ); } @@ -436,7 +433,7 @@ public PackedMemoryImage ReadPixels(Rectangle rectan var image = new PackedMemoryImage(rectangle.Width, rectangle.Height); var pixels = Unsafe.AsPointer(ref image.DangerousGetReference()); var pitch = rectangle.Width * Marshal.SizeOf(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.RenderReadPixels(_handle, &rect, format, diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index 5e6a1cb5..3ef6518e 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -76,11 +76,7 @@ public static PackedTexture CreateTextureFromSurface public static Texture CreateTextureFromBitmap(this Renderer renderer, string filename) { ArgumentNullException.ThrowIfNull(renderer); - - if (string.IsNullOrWhiteSpace(filename)) - { - throw new ArgumentException($"'{nameof(filename)}' cannot be null or whitespace.", nameof(filename)); - } + ArgumentException.ThrowIfNullOrWhiteSpace(filename, nameof(filename)); using var surface = Surface.LoadBitmap(filename); var texture = renderer.CreateTextureFromSurface(surface); @@ -333,6 +329,7 @@ void IncrementY() public static void DrawTextBlended(this Renderer renderer, int x, int y, Font font, string text) { ArgumentNullException.ThrowIfNull(renderer); + ArgumentNullException.ThrowIfNull(font); ArgumentNullException.ThrowIfNull(text); using var surface = font.RenderBlended(text, renderer.DrawColor); @@ -344,6 +341,7 @@ public static void DrawTextBlended(this Renderer renderer, int x, int y, Font fo public static void DrawTextBlendedCentered(this Renderer renderer, Font font, string text) { ArgumentNullException.ThrowIfNull(renderer); + ArgumentNullException.ThrowIfNull(font); ArgumentNullException.ThrowIfNull(text); using var surface = font.RenderBlended(text, renderer.DrawColor); diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs index e44c5639..062a8aac 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -31,6 +31,8 @@ public sealed unsafe class Surface : IDisposable private readonly bool _freeHandle; + internal SDL_Surface* Handle => _handle; + public PixelFormatDescriptor Format => new(_handle->format, false); public int Width => _handle->w; @@ -46,9 +48,9 @@ public static Surface LoadBitmap(string filename) using var file = new MarshaledString(filename); using var mode = new MarshaledString("rb"); var source = SDL.RWFromFile(file, mode); - Error.ThrowOnFailure(source); + Error.ThrowLastErrorIfNull(source); var bitmap = SDL.LoadBMP_RW(source, 1); - Error.ThrowOnFailure(bitmap); + Error.ThrowLastErrorIfNull(bitmap); return new Surface(bitmap); } @@ -68,19 +70,19 @@ internal Surface(SDL_Surface* handle, bool freeHandle) } public Surface(int width, int height, PixelFormat format) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) + : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) { } public Surface(int width, int height, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) + : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) { } public Surface(void* pixels, int width, int height, int pitch, PixelFormat format) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) + : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) { } public Surface(void* pixels, int width, int height, int pitch, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ReturnOrThrowOnFailure(SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) + : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) { } ~Surface() @@ -113,12 +115,9 @@ public void Blit(Surface surface) { ThrowWhenDisposed(); - if (surface is null) - { - throw new ArgumentNullException(nameof(surface)); - } + ArgumentNullException.ThrowIfNull(surface); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.Blit(_handle, null, surface._handle, null) ); } @@ -134,7 +133,7 @@ public void FillRect(uint color) { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.FillRect(_handle, null, color) ); } @@ -147,7 +146,7 @@ public void WithLock(SurfaceLockCallback callback) var mustLock = MustLock; if (mustLock) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.LockSurface(_handle) ); } @@ -167,20 +166,7 @@ public void WithLock(SurfaceLockCallback callback) private void ThrowWhenDisposed() { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } - } - - public static implicit operator SDL_Surface*(Surface surface) - { - if (surface is null) - { - throw new ArgumentNullException(nameof(surface)); - } - - return surface._handle; + ObjectDisposedException.ThrowIf(_handle is null, this); } } } diff --git a/sources/SDL2Sharp/Video/Texture.cs b/sources/SDL2Sharp/Video/Texture.cs index 43212d0a..13ba74b7 100644 --- a/sources/SDL2Sharp/Video/Texture.cs +++ b/sources/SDL2Sharp/Video/Texture.cs @@ -29,12 +29,14 @@ public sealed unsafe class Texture : IDisposable private SDL_Texture* _handle; + internal SDL_Texture* Handle => _handle; + public PixelFormat Format { get { uint format; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, &format, null, null, null)); + Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, &format, null, null, null)); return (PixelFormat)format; } } @@ -44,7 +46,7 @@ public TextureAccess Access get { int access; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, &access, null, null)); + Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, &access, null, null)); return (TextureAccess)access; } } @@ -54,7 +56,7 @@ public int Width get { int width; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, &width, null)); + Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, &width, null)); return width; } } @@ -64,7 +66,7 @@ public int Height get { int height; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, null, &height)); + Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, null, &height)); return height; } } @@ -74,7 +76,7 @@ public Size Size get { int width, height; - Error.ThrowOnFailure(SDL.QueryTexture(_handle, null, null, &width, &height)); + Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, &width, &height)); return new Size(width, height); } } @@ -84,14 +86,14 @@ public BlendMode BlendMode get { SDL_BlendMode blendMode; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetTextureBlendMode(_handle, &blendMode) ); return (BlendMode)blendMode; } set { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) ); } @@ -101,10 +103,7 @@ public BlendMode BlendMode internal Texture(SDL_Texture* texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } + ArgumentNullException.ThrowIfNull(texture); _handle = texture; } @@ -143,7 +142,7 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) ); var surface = new Surface(surfaceHandle, false); @@ -153,20 +152,7 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback private void ThrowWhenDisposed() { - if (_handle is null) - { - throw new ObjectDisposedException(GetType().FullName); - } - } - - public static implicit operator SDL_Texture*(Texture texture) - { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } - - return texture._handle; + ObjectDisposedException.ThrowIf(_handle is null, this); } } } diff --git a/sources/SDL2Sharp/Video/VideoSubsystem.cs b/sources/SDL2Sharp/Video/VideoSubsystem.cs index dfd053e0..ee41a9ca 100644 --- a/sources/SDL2Sharp/Video/VideoSubsystem.cs +++ b/sources/SDL2Sharp/Video/VideoSubsystem.cs @@ -44,7 +44,9 @@ public IReadOnlyList Displays public VideoSubsystem() { - SDL.InitSubSystem(InitSubsystemFlags); + Error.ThrowLastErrorIfNegative( + SDL.InitSubSystem(InitSubsystemFlags) + ); } public void Dispose() diff --git a/sources/SDL2Sharp/Video/Window.cs b/sources/SDL2Sharp/Video/Window.cs index c9f2df23..0ede912a 100644 --- a/sources/SDL2Sharp/Video/Window.cs +++ b/sources/SDL2Sharp/Video/Window.cs @@ -160,7 +160,7 @@ public Size ClientSize ThrowWhenDisposed(); int borderTop, borderLeft, borderBottom, borderRight; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.GetWindowBordersSize(_handle, &borderTop, &borderLeft, &borderBottom, &borderRight) ); int windowWidth, windowHeight; @@ -178,7 +178,7 @@ public PixelFormat PixelFormat ThrowWhenDisposed(); var pixelFormat = SDL.GetWindowPixelFormat(_handle); - Error.ThrowOnFailure(pixelFormat); + Error.ThrowLastErrorIfZero(pixelFormat); return (PixelFormat)pixelFormat; } } @@ -190,7 +190,7 @@ public Surface Surface ThrowWhenDisposed(); var surfaceHandle = SDL.GetWindowSurface(_handle); - Error.ThrowOnFailure(surfaceHandle); + Error.ThrowLastErrorIfNull(surfaceHandle); return new Surface(surfaceHandle, false); } } @@ -240,7 +240,7 @@ public bool IsFullScreen ThrowWhenDisposed(); var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN : 0; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetWindowFullscreen(_handle, (uint)flags) ); } @@ -259,7 +259,7 @@ public bool IsFullScreenDesktop ThrowWhenDisposed(); var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP : 0; - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetWindowFullscreen(_handle, (uint)flags) ); } @@ -294,13 +294,13 @@ internal Window(string title, int x, int y, int width, int height, WindowFlags f private Window(string title, int x, int y, int width, int height, uint flags) { using var marshaledTitle = new MarshaledString(title); - _handle = Error.ReturnOrThrowOnFailure( + _handle = Error.ThrowLastErrorIfNull( SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) ); if (!IsBordered) { - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.SetWindowHitTest(_handle, &HitTestCallback, null) ); } @@ -319,13 +319,8 @@ public void Dispose() private void Dispose(bool _) { - if (_handle is null) - { - return; - } - + if (_handle is null) return; SDL.DestroyWindow(_handle); - _handle = null; } @@ -419,7 +414,7 @@ public void UpdateSurface() { ThrowWhenDisposed(); - Error.ThrowOnFailure( + Error.ThrowLastErrorIfNegative( SDL.UpdateWindowSurface(_handle) ); } diff --git a/sources/SDL2Sharp/Video/YuvTexture.cs b/sources/SDL2Sharp/Video/YuvTexture.cs index f166383c..34b0bc2e 100644 --- a/sources/SDL2Sharp/Video/YuvTexture.cs +++ b/sources/SDL2Sharp/Video/YuvTexture.cs @@ -89,13 +89,13 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; int pitch; - Error.ThrowOnFailure( - SDL.LockTexture(_texture, &rect, &pixels, &pitch) + Error.ThrowLastErrorIfNegative( + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new YuvImage(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture); + SDL.UnlockTexture(_texture.Handle); } public void Update(YuvImage image) @@ -106,23 +106,19 @@ public void Update(YuvImage image) var uPitch = image.U.Width * Marshal.SizeOf(); var vPlane = (byte*)Unsafe.AsPointer(ref image.V.DangerousGetReference()); var vPitch = image.V.Width * Marshal.SizeOf(); - SDL.UpdateYUVTexture(_texture, null, yPlane, yPitch, uPlane, uPitch, vPlane, vPitch); + Error.ThrowLastErrorIfNegative( + SDL.UpdateYUVTexture(_texture.Handle, null, yPlane, yPitch, uPlane, uPitch, vPlane, vPitch) + ); } private void ThrowWhenDisposed() { - if (_texture is null) - { - throw new ObjectDisposedException(GetType().FullName); - } + ObjectDisposedException.ThrowIf(_texture is null, this); } public static implicit operator Texture(YuvTexture texture) { - if (texture is null) - { - throw new ArgumentNullException(nameof(texture)); - } + ArgumentNullException.ThrowIfNull(texture); return texture._texture; } From 4e3d83834cd5fb6c2ba46328718e5e0fa4db4d23 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 25 Jul 2024 12:54:05 +0200 Subject: [PATCH 38/62] Minor code cleanup and fixes. --- build/Build/IBuild.cs | 4 +- samples/RayTracer/RayExtensions.cs | 4 -- samples/RayTracer/World.cs | 4 +- sources/SDL2Sharp.Interop/SDL.cs | 2 +- sources/SDL2Sharp/Audio/AudioFormat.cs | 4 +- sources/SDL2Sharp/Input/Keyboard.cs | 24 +--------- sources/SDL2Sharp/Input/KeyboardState.cs | 44 +++++++++++++++++++ .../SDL2Sharp/Internals/MarshaledString.cs | 6 +-- sources/SDL2Sharp/Video/BlendMode.cs | 16 +++---- sources/SDL2Sharp/Video/PixelFormat.cs | 2 + .../SDL2Sharp/Video/PixelFormatDescriptor.cs | 1 + sources/SDL2Sharp/Video/Point.cs | 2 +- 12 files changed, 69 insertions(+), 44 deletions(-) create mode 100644 sources/SDL2Sharp/Input/KeyboardState.cs diff --git a/build/Build/IBuild.cs b/build/Build/IBuild.cs index b6c6f715..b0ef1ffb 100644 --- a/build/Build/IBuild.cs +++ b/build/Build/IBuild.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -39,7 +39,7 @@ partial interface IBuild : INukeBuild [GitVersion] public GitVersion GitVersion => TryGetValue(() => GitVersion); - + [Parameter("Configuration to build. Default is 'Debug' (local) or 'Release' (server).")] public Configuration Configuration => TryGetValue(() => Configuration) ?? GetDefaultConfiguration(); diff --git a/samples/RayTracer/RayExtensions.cs b/samples/RayTracer/RayExtensions.cs index 1a721f6d..c4024dc8 100644 --- a/samples/RayTracer/RayExtensions.cs +++ b/samples/RayTracer/RayExtensions.cs @@ -23,10 +23,6 @@ internal static class RayExtensions { - private static readonly Comparer _distanceComparer = - Comparer.Create( - (a, b) => a.Distance.CompareTo(b.Distance)); - public static Intersection? Intersect(this Ray ray, IEnumerable objects) { return objects diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index eafe8bb0..0ad6e4a3 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -27,9 +27,9 @@ internal sealed class World { public Rgb96f Ambient { get; set; } - public ICollection Objects { get; } = new List(); + public ICollection Objects { get; } = []; - public ICollection Lights { get; } = new List(); + public ICollection Lights { get; } = []; public Rgb96f Trace(Ray ray, int level, float weight) { diff --git a/sources/SDL2Sharp.Interop/SDL.cs b/sources/SDL2Sharp.Interop/SDL.cs index 3812e4cc..0d0b98b7 100644 --- a/sources/SDL2Sharp.Interop/SDL.cs +++ b/sources/SDL2Sharp.Interop/SDL.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp/Audio/AudioFormat.cs b/sources/SDL2Sharp/Audio/AudioFormat.cs index 798ddc65..cfc2d3fc 100644 --- a/sources/SDL2Sharp/Audio/AudioFormat.cs +++ b/sources/SDL2Sharp/Audio/AudioFormat.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -24,6 +24,7 @@ namespace SDL2Sharp.Audio { public enum AudioFormat : ushort { +#pragma warning disable CA1069 // Enums values should not be duplicated U8 = SDL.AUDIO_U8, S8 = SDL.AUDIO_S8, U16LSB = SDL.AUDIO_U16LSB, @@ -42,5 +43,6 @@ public enum AudioFormat : ushort S16SYS = SDL.AUDIO_S16SYS, S32SYS = SDL.AUDIO_S32SYS, F32SYS = SDL.AUDIO_F32SYS +#pragma warning restore CA1069 // Enums values should not be duplicated } } diff --git a/sources/SDL2Sharp/Input/Keyboard.cs b/sources/SDL2Sharp/Input/Keyboard.cs index 1d70dd1f..eb6d6eb0 100644 --- a/sources/SDL2Sharp/Input/Keyboard.cs +++ b/sources/SDL2Sharp/Input/Keyboard.cs @@ -23,9 +23,9 @@ namespace SDL2Sharp.Input { - public static unsafe class Keyboard + public static class Keyboard { - public static KeyboardState State + public unsafe static KeyboardState State { get { @@ -35,24 +35,4 @@ public static KeyboardState State } } } - - public readonly ref struct KeyboardState - { - private readonly ReadOnlySpan _keyStates; - - public KeyboardState(Span keyStates) - { - _keyStates = keyStates; - } - - public bool IsPressed(Scancode scanCode) - { - return _keyStates[(int)scanCode] == 1; - } - - public bool IsReleased(Scancode scanCode) - { - return _keyStates[(int)scanCode] == 0; - } - } } diff --git a/sources/SDL2Sharp/Input/KeyboardState.cs b/sources/SDL2Sharp/Input/KeyboardState.cs new file mode 100644 index 00000000..6bde7166 --- /dev/null +++ b/sources/SDL2Sharp/Input/KeyboardState.cs @@ -0,0 +1,44 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Input +{ + public readonly ref struct KeyboardState + { + private readonly ReadOnlySpan _keyStates; + + public KeyboardState(Span keyStates) + { + _keyStates = keyStates; + } + + public bool IsPressed(Scancode scanCode) + { + return _keyStates[(int)scanCode] == 1; + } + + public bool IsReleased(Scancode scanCode) + { + return _keyStates[(int)scanCode] == 0; + } + } +} diff --git a/sources/SDL2Sharp/Internals/MarshaledString.cs b/sources/SDL2Sharp/Internals/MarshaledString.cs index a4287d3a..ba5b27c9 100644 --- a/sources/SDL2Sharp/Internals/MarshaledString.cs +++ b/sources/SDL2Sharp/Internals/MarshaledString.cs @@ -38,7 +38,7 @@ public MarshaledString(string input) } else { - var valueBytes = (input.Length != 0) ? Encoding.UTF8.GetBytes(input) : Array.Empty(); + var valueBytes = (input.Length != 0) ? Encoding.UTF8.GetBytes(input) : []; length = valueBytes.Length; value = Marshal.AllocHGlobal(length + 1); Marshal.Copy(valueBytes, 0, value, length); @@ -49,7 +49,7 @@ public MarshaledString(string input) Value = (sbyte*)value; } - public ReadOnlySpan AsSpan() => new(Value, Length); + public readonly ReadOnlySpan AsSpan() => new(Value, Length); public int Length { get; private set; } @@ -67,7 +67,7 @@ public void Dispose() public static implicit operator sbyte*(in MarshaledString value) => value.Value; - public override string ToString() + public override readonly string ToString() { var span = new ReadOnlySpan(Value, Length); return span.AsString(); diff --git a/sources/SDL2Sharp/Video/BlendMode.cs b/sources/SDL2Sharp/Video/BlendMode.cs index 754da371..b1831507 100644 --- a/sources/SDL2Sharp/Video/BlendMode.cs +++ b/sources/SDL2Sharp/Video/BlendMode.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -18,17 +18,17 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Interop; +using static SDL2Sharp.Interop.SDL_BlendMode; namespace SDL2Sharp.Video { public enum BlendMode { - None = SDL_BlendMode.SDL_BLENDMODE_NONE, - Blend = SDL_BlendMode.SDL_BLENDMODE_BLEND, - Add = SDL_BlendMode.SDL_BLENDMODE_ADD, - Mod = SDL_BlendMode.SDL_BLENDMODE_MOD, - Mul = SDL_BlendMode.SDL_BLENDMODE_MUL, - Invalid = SDL_BlendMode.SDL_BLENDMODE_INVALID, + None = SDL_BLENDMODE_NONE, + Blend = SDL_BLENDMODE_BLEND, + Add = SDL_BLENDMODE_ADD, + Mod = SDL_BLENDMODE_MOD, + Mul = SDL_BLENDMODE_MUL, + Invalid = SDL_BLENDMODE_INVALID, } } diff --git a/sources/SDL2Sharp/Video/PixelFormat.cs b/sources/SDL2Sharp/Video/PixelFormat.cs index 475bf276..bc569116 100644 --- a/sources/SDL2Sharp/Video/PixelFormat.cs +++ b/sources/SDL2Sharp/Video/PixelFormat.cs @@ -24,6 +24,7 @@ namespace SDL2Sharp.Video { public enum PixelFormat : uint { +#pragma warning disable CA1069 // Enums values should not be duplicated Unknown = SDL_PIXELFORMAT_UNKNOWN, Index1LSB = SDL_PIXELFORMAT_INDEX1LSB, Index1MSB = SDL_PIXELFORMAT_INDEX1MSB, @@ -74,5 +75,6 @@ public enum PixelFormat : uint NV12 = SDL_PIXELFORMAT_NV12, NV21 = SDL_PIXELFORMAT_NV21, ExternalOES = SDL_PIXELFORMAT_EXTERNAL_OES, +#pragma warning restore CA1069 // Enums values should not be duplicated } } diff --git a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs index 0b2fa814..3cf39c00 100644 --- a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs +++ b/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs @@ -79,6 +79,7 @@ public PixelFormatDescriptor(PixelFormat pixelFormat) public void Dispose() { + GC.SuppressFinalize(this); Dispose(true); } diff --git a/sources/SDL2Sharp/Video/Point.cs b/sources/SDL2Sharp/Video/Point.cs index af6a3620..5ff328b9 100644 --- a/sources/SDL2Sharp/Video/Point.cs +++ b/sources/SDL2Sharp/Video/Point.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // From 1a946a262d9ed43437711f554addff7281a47969 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Thu, 25 Jul 2024 23:35:18 +0200 Subject: [PATCH 39/62] Yet another mayor overhaul. --- .../Colors/{IYuvPixel.cs => IYuvFormat.cs} | 28 +--- sources/SDL2Sharp/Video/Colors/Iyuv.cs | 75 +++------- sources/SDL2Sharp/Video/Colors/Yv12.cs | 75 +++------- sources/SDL2Sharp/Video/ImageMemoryPlane.cs | 8 ++ sources/SDL2Sharp/Video/ImagePlane.cs | 37 +++-- sources/SDL2Sharp/Video/Nv12Image.cs | 80 ----------- sources/SDL2Sharp/Video/Nv21Texture.cs | 135 ------------------ .../Video/{Nv21Image.cs => NvImage.cs} | 12 +- .../{Nv21MemoryImage.cs => NvMemoryImage.cs} | 10 +- .../Video/{Nv12Texture.cs => NvTexture.cs} | 36 ++--- sources/SDL2Sharp/Video/PackedImage.cs | 11 ++ sources/SDL2Sharp/Video/PackedMemoryImage.cs | 24 ++-- sources/SDL2Sharp/Video/PackedTexture.cs | 18 +-- sources/SDL2Sharp/Video/RendererExtensions.cs | 14 +- sources/SDL2Sharp/Video/TextureExtensions.cs | 8 +- sources/SDL2Sharp/Video/YuvImage.cs | 25 +--- .../{Nv12MemoryImage.cs => YuvMemoryImage.cs} | 15 +- sources/SDL2Sharp/Video/YuvTexture.cs | 35 +++-- tests/SDL2Sharp.Tests/PlanarTextureTests.cs | 12 +- tests/SDL2Sharp.Tests/TextureTests.cs | 2 +- 20 files changed, 194 insertions(+), 466 deletions(-) rename sources/SDL2Sharp/Video/Colors/{IYuvPixel.cs => IYuvFormat.cs} (52%) delete mode 100644 sources/SDL2Sharp/Video/Nv12Image.cs delete mode 100644 sources/SDL2Sharp/Video/Nv21Texture.cs rename sources/SDL2Sharp/Video/{Nv21Image.cs => NvImage.cs} (84%) rename sources/SDL2Sharp/Video/{Nv21MemoryImage.cs => NvMemoryImage.cs} (86%) rename sources/SDL2Sharp/Video/{Nv12Texture.cs => NvTexture.cs} (70%) rename sources/SDL2Sharp/Video/{Nv12MemoryImage.cs => YuvMemoryImage.cs} (81%) diff --git a/sources/SDL2Sharp/Video/Colors/IYuvPixel.cs b/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs similarity index 52% rename from sources/SDL2Sharp/Video/Colors/IYuvPixel.cs rename to sources/SDL2Sharp/Video/Colors/IYuvFormat.cs index e409d404..ad8baff6 100644 --- a/sources/SDL2Sharp/Video/Colors/IYuvPixel.cs +++ b/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs @@ -20,32 +20,14 @@ namespace SDL2Sharp.Video.Colors { - public interface IYuvPixel + public interface IYuvFormat { - static abstract PixelFormat Format { get; } + static abstract PixelFormat PixelFormat { get; } - static abstract int GetYPlaneWidth(int imageWidth); + static unsafe abstract ImagePlane CreateYPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); - static abstract int GetYPlaneHeight(int imageHeight); + static unsafe abstract ImagePlane CreateUPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); - static abstract int GetYPlanePitch(int imagePitch); - - static abstract int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch); - - static abstract int GetUPlaneWidth(int imageWidth); - - static abstract int GetUPlaneHeight(int imageHeight); - - static abstract int GetUPlanePitch(int imagePitch); - - static abstract int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch); - - static abstract int GetVPlaneWidth(int imageWidth); - - static abstract int GetVPlaneHeight(int imageHeight); - - static abstract int GetVPlanePitch(int imagePitch); - - static abstract int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch); + static unsafe abstract ImagePlane CreateVPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); } } diff --git a/sources/SDL2Sharp/Video/Colors/Iyuv.cs b/sources/SDL2Sharp/Video/Colors/Iyuv.cs index 183087c4..1c045137 100644 --- a/sources/SDL2Sharp/Video/Colors/Iyuv.cs +++ b/sources/SDL2Sharp/Video/Colors/Iyuv.cs @@ -18,72 +18,37 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Video.Colors { - public readonly struct Iyuv : IYuvPixel + public readonly struct Iyuv : IYuvFormat { - public static PixelFormat Format => PixelFormat.IYUV; - - public static int GetYPlaneWidth(int imageWidth) - { - return imageWidth; - } - - public static int GetYPlaneHeight(int imageHeight) - { - return imageHeight; - } - - public static int GetYPlanePitch(int imagePitch) - { - return imagePitch; - } - - public static int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) - { - return 0; - } - - public static int GetUPlaneWidth(int imageWidth) - { - return GetYPlaneWidth(imageWidth) / 2; - } - - public static int GetUPlaneHeight(int imageHeight) - { - return GetYPlaneHeight(imageHeight) / 2; - } - - public static int GetUPlanePitch(int imagePitch) - { - return GetYPlanePitch(imagePitch) / 2; - } - - public static int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) - { - return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) - + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); - } - - public static int GetVPlaneWidth(int imageWidth) - { - return GetUPlaneHeight(imageWidth); - } + public static PixelFormat PixelFormat => PixelFormat.IYUV; - public static int GetVPlaneHeight(int imageHeight) + public static unsafe ImagePlane CreateYPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetUPlaneHeight(imageHeight); + return new ImagePlane(pixels, imageWidth, imageHeight, imagePitch); } - public static int GetVPlanePitch(int imagePitch) + public static unsafe ImagePlane CreateUPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetUPlaneHeight(imagePitch); + var uPlaneWidth = imageWidth / 2; + var uPlaneHeight = imageHeight / 2; + var uPlanePitch = imagePitch / 2; + var uPlaneOffset = imageHeight * imagePitch; + var uPlanePixels = Unsafe.Add(pixels, uPlaneOffset); + return new ImagePlane(uPlanePixels, uPlaneWidth, uPlaneHeight, uPlanePitch); } - public static int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static unsafe ImagePlane CreateVPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetUPlaneOffset(imageWidth, imageHeight, imagePitch) - + GetUPlaneHeight(imageHeight) * GetUPlanePitch(imagePitch); + var vPlaneWidth = imageWidth / 2; + var vPlaneHeight = imageHeight / 2; + var vPlanePitch = imagePitch / 2; + var vPlaneOffset = imageHeight * imagePitch + imageHeight * imagePitch / 4; + var vPlanePixels = Unsafe.Add(pixels, vPlaneOffset); + return new ImagePlane(vPlanePixels, vPlaneWidth, vPlaneHeight, vPlanePitch); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Yv12.cs b/sources/SDL2Sharp/Video/Colors/Yv12.cs index 5d08f608..76c60df2 100644 --- a/sources/SDL2Sharp/Video/Colors/Yv12.cs +++ b/sources/SDL2Sharp/Video/Colors/Yv12.cs @@ -18,72 +18,37 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Runtime.CompilerServices; + namespace SDL2Sharp.Video.Colors { - public readonly struct Yv12 : IYuvPixel + public readonly struct Yv12 : IYuvFormat { - public static PixelFormat Format => PixelFormat.YV12; - - public static int GetYPlaneWidth(int imageWidth) - { - return imageWidth; - } - - public static int GetYPlaneHeight(int imageHeight) - { - return imageHeight; - } - - public static int GetYPlanePitch(int imagePitch) - { - return imagePitch; - } - - public static int GetYPlaneOffset(int imageWidth, int imageHeight, int imagePitch) - { - return 0; - } - - public static int GetVPlaneWidth(int imageWidth) - { - return GetYPlaneHeight(imageWidth) / 2; - } - - public static int GetVPlaneHeight(int imageHeight) - { - return GetYPlaneHeight(imageHeight) / 2; - } - - public static int GetVPlanePitch(int imagePitch) - { - return GetYPlanePitch(imagePitch) / 2; - } - - public static int GetVPlaneOffset(int imageWidth, int imageHeight, int imagePitch) - { - return GetYPlaneOffset(imageWidth, imageHeight, imagePitch) - + GetYPlaneHeight(imageHeight) * GetYPlanePitch(imagePitch); - } - - public static int GetUPlaneWidth(int imageWidth) - { - return GetVPlaneWidth(imageWidth); - } + public static PixelFormat PixelFormat => PixelFormat.YV12; - public static int GetUPlaneHeight(int imageHeight) + public static unsafe ImagePlane CreateYPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetVPlaneHeight(imageHeight); + return new ImagePlane(pixels, imageWidth, imageHeight, imagePitch); } - public static int GetUPlanePitch(int imagePitch) + public static unsafe ImagePlane CreateUPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetVPlanePitch(imagePitch); + var uPlaneWidth = imageWidth / 2; + var uPlaneHeight = imageHeight / 2; + var uPlanePitch = imagePitch / 2; + var uPlaneOffset = imageHeight * imagePitch + imageHeight * imagePitch / 4; + var uPlanePixels = Unsafe.Add(pixels, uPlaneOffset); + return new ImagePlane(uPlanePixels, uPlaneWidth, uPlaneHeight, uPlanePitch); } - public static int GetUPlaneOffset(int imageWidth, int imageHeight, int imagePitch) + public static unsafe ImagePlane CreateVPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch) { - return GetVPlaneOffset(imageWidth, imageHeight, imagePitch) - + GetVPlaneHeight(imageHeight) * GetVPlanePitch(imagePitch); + var vPlaneWidth = imageWidth / 2; + var vPlaneHeight = imageHeight / 2; + var vPlanePitch = imagePitch / 2; + var vPlaneOffset = imageHeight * imagePitch; + var vPlanePixels = Unsafe.Add(pixels, vPlaneOffset); + return new ImagePlane(vPlanePixels, vPlaneWidth, vPlaneHeight, vPlanePitch); } } } diff --git a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs index aef285d6..ade5a256 100644 --- a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs +++ b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs @@ -19,6 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.InteropServices; using Microsoft.Toolkit.HighPerformance; namespace SDL2Sharp.Video @@ -37,6 +38,8 @@ public sealed class ImageMemoryPlane where TPackedPixel : struct public Size Size => new(_width, _height); + public int Pitch => _width * Marshal.SizeOf(); + public TPackedPixel this[int x, int y] { get @@ -141,5 +144,10 @@ public ref TPackedPixel DangerousGetReference() { return ref _pixels.DangerousGetReference(); } + + public static unsafe explicit operator void*(ImageMemoryPlane imagePlane) + { + return (void*)imagePlane; + } } } diff --git a/sources/SDL2Sharp/Video/ImagePlane.cs b/sources/SDL2Sharp/Video/ImagePlane.cs index 2d049bfa..0024af41 100644 --- a/sources/SDL2Sharp/Video/ImagePlane.cs +++ b/sources/SDL2Sharp/Video/ImagePlane.cs @@ -25,9 +25,9 @@ namespace SDL2Sharp.Video { - public readonly ref struct ImagePlane where TPackedPixel : struct + public unsafe readonly ref struct ImagePlane where TPackedPixel : struct { - private readonly Span _pixels; + private readonly void* _pixels; private readonly int _width; @@ -53,6 +53,12 @@ public Size Size get => new(_width, _height); } + public readonly int Pitch + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _pitch; + } + public ref TPackedPixel this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -94,7 +100,7 @@ public Size Size } } - public unsafe ImagePlane(void* pixels, int width, int height, int pitch) + public ImagePlane(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -120,7 +126,7 @@ public unsafe ImagePlane(void* pixels, int width, int height, int pitch) "pitch cannot be less than zero"); } - _pixels = new Span(pixels, height * pitch); + _pixels = pixels; _height = height; _width = width; _pitch = pitch; @@ -130,24 +136,33 @@ public unsafe ImagePlane(void* pixels, int width, int height, int pitch) [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly ref TPackedPixel DangerousGetReference() { - ref var r0 = ref MemoryMarshal.GetReference(_pixels); - const int index = 0; - return ref Unsafe.Add(ref r0, index); + return ref Unsafe.AsRef(_pixels); } [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly ref TPackedPixel DangerousGetReferenceAt(int x, int y) { - ref var r0 = ref MemoryMarshal.GetReference(_pixels); - var index = y * _pitch + x; - return ref Unsafe.Add(ref r0, index); + ref var r0 = ref Unsafe.AsRef(_pixels); + var index = y * _pitch + x * Marshal.SizeOf(); + return ref Unsafe.AddByteOffset(ref r0, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void Fill(TPackedPixel value) { - _pixels.Fill(value); + for (var y = 0; y < _height; y++) + { + for (var x = 0; x < _width; x++) + { + this[x, y] = value; + } + } + } + + public static explicit operator void*(ImagePlane imagePlane) + { + return imagePlane._pixels; } } } diff --git a/sources/SDL2Sharp/Video/Nv12Image.cs b/sources/SDL2Sharp/Video/Nv12Image.cs deleted file mode 100644 index 54db3bb9..00000000 --- a/sources/SDL2Sharp/Video/Nv12Image.cs +++ /dev/null @@ -1,80 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; - -namespace SDL2Sharp.Video -{ - public readonly ref struct Nv12Image - { - private readonly ImagePlane _yPlane; - - private readonly ImagePlane _uvPlane; - - public ImagePlane Y => _yPlane; - - public ImagePlane UV => _uvPlane; - - public readonly int Width - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _yPlane.Width; - } - - public readonly int Height - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _yPlane.Height; - } - - public unsafe Nv12Image(void* pixels, int width, int height, int pitch) - { - if (height < 0) - { - throw new ArgumentOutOfRangeException( - nameof(height), - height, - "height cannot be less than zero"); - } - - if (width < 0) - { - throw new ArgumentOutOfRangeException( - nameof(width), - width, - "height cannot be less than zero"); - } - - if (pitch < 0) - { - throw new ArgumentOutOfRangeException( - nameof(pitch), - pitch, - "pitch cannot be less than zero"); - } - - _yPlane = new ImagePlane(pixels, width, height, pitch); - var uPlanePixels = Unsafe.Add(pixels, height * pitch); - _uvPlane = new ImagePlane(uPlanePixels, width / 2, height / 2, pitch / 2); - } - } -} diff --git a/sources/SDL2Sharp/Video/Nv21Texture.cs b/sources/SDL2Sharp/Video/Nv21Texture.cs deleted file mode 100644 index 805a20c8..00000000 --- a/sources/SDL2Sharp/Video/Nv21Texture.cs +++ /dev/null @@ -1,135 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; - -namespace SDL2Sharp.Video -{ - public sealed unsafe partial class Nv21Texture : IDisposable - { - public delegate void LockCallback(Nv21Image pixels); - - private Texture _texture; - - public PixelFormat Format => _texture.Format; - - public TextureAccess Access => _texture.Access; - - public int Width => _texture.Width; - - public int Height => _texture.Height; - - public BlendMode BlendMode - { - get => _texture.BlendMode; - - set => _texture.BlendMode = value; - } - - public bool IsValid => _texture.IsValid; - - internal Nv21Texture(Texture texture) - { - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); - } - - ~Nv21Texture() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) - { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; - } - - public void WithLock(LockCallback callback) - { - WithLock(0, 0, Width, Height, callback); - } - - public void WithLock(Rectangle rectangle, LockCallback callback) - { - WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); - } - - public void WithLock(int x, int y, int width, int height, LockCallback callback) - { - ThrowWhenDisposed(); - - var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; - void* pixels; - int pitch; - Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) - ); - - var image = new Nv21Image(pixels, width, height, pitch); - callback.Invoke(image); - SDL.UnlockTexture(_texture.Handle); - } - - public void Update(Nv21Image image) - { - var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); - var yPitch = image.Y.Width * Marshal.SizeOf(); - var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); - var uvPitch = image.VU.Width * Marshal.SizeOf(); - Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) - ); - } - - public void Update(Nv21MemoryImage image) - { - var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); - var yPitch = image.Y.Width * Marshal.SizeOf(); - var uvPlane = (byte*)Unsafe.AsPointer(ref image.VU.DangerousGetReference()); - var uvPitch = image.VU.Width * Marshal.SizeOf(); - Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) - ); - } - - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_texture is null, this); - } - - public static implicit operator Texture(Nv21Texture texture) - { - ArgumentNullException.ThrowIfNull(texture); - - return texture._texture; - } - } -} diff --git a/sources/SDL2Sharp/Video/Nv21Image.cs b/sources/SDL2Sharp/Video/NvImage.cs similarity index 84% rename from sources/SDL2Sharp/Video/Nv21Image.cs rename to sources/SDL2Sharp/Video/NvImage.cs index 962fc483..c2f04ed1 100644 --- a/sources/SDL2Sharp/Video/Nv21Image.cs +++ b/sources/SDL2Sharp/Video/NvImage.cs @@ -24,15 +24,15 @@ namespace SDL2Sharp.Video { - public readonly ref struct Nv21Image + public readonly ref struct NvImage where TUvPixel : struct { private readonly ImagePlane _yPlane; - private readonly ImagePlane _vuPlane; + private readonly ImagePlane _uvPlane; public ImagePlane Y => _yPlane; - public ImagePlane VU => _vuPlane; + public ImagePlane UV => _uvPlane; public readonly int Width { @@ -46,7 +46,7 @@ public readonly int Height get => _yPlane.Height; } - public unsafe Nv21Image(void* pixels, int width, int height, int pitch) + public unsafe NvImage(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -73,8 +73,8 @@ public unsafe Nv21Image(void* pixels, int width, int height, int pitch) } _yPlane = new ImagePlane(pixels, width, height, pitch); - var vuPlanePixels = Unsafe.Add(pixels, height * pitch); - _vuPlane = new ImagePlane(vuPlanePixels, width / 2, height / 2, pitch / 2); + var uvPlanePixels = Unsafe.Add(pixels, height * pitch); + _uvPlane = new ImagePlane(uvPlanePixels, width / 2, height / 2, pitch / 2); } } } diff --git a/sources/SDL2Sharp/Video/Nv21MemoryImage.cs b/sources/SDL2Sharp/Video/NvMemoryImage.cs similarity index 86% rename from sources/SDL2Sharp/Video/Nv21MemoryImage.cs rename to sources/SDL2Sharp/Video/NvMemoryImage.cs index 9985012a..7313c042 100644 --- a/sources/SDL2Sharp/Video/Nv21MemoryImage.cs +++ b/sources/SDL2Sharp/Video/NvMemoryImage.cs @@ -24,15 +24,15 @@ namespace SDL2Sharp.Video { - public sealed class Nv21MemoryImage + public sealed class NvMemoryImage where TUVPixel : struct { private readonly ImageMemoryPlane _yPlane; - private readonly ImageMemoryPlane _uvPlane; + private readonly ImageMemoryPlane _uvPlane; public ImageMemoryPlane Y => _yPlane; - public ImageMemoryPlane VU => _uvPlane; + public ImageMemoryPlane UV => _uvPlane; public int Width { @@ -46,7 +46,7 @@ public int Height get => _yPlane.Height; } - public unsafe Nv21MemoryImage(int width, int height) + public NvMemoryImage(int width, int height) { if (width < 0) { @@ -65,7 +65,7 @@ public unsafe Nv21MemoryImage(int width, int height) } _yPlane = new ImageMemoryPlane(width, height); - _uvPlane = new ImageMemoryPlane(width / 2, height / 2); + _uvPlane = new ImageMemoryPlane(width / 2, height / 2); } } } diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/NvTexture.cs similarity index 70% rename from sources/SDL2Sharp/Video/Nv12Texture.cs rename to sources/SDL2Sharp/Video/NvTexture.cs index bee8f991..909dfa7a 100644 --- a/sources/SDL2Sharp/Video/Nv12Texture.cs +++ b/sources/SDL2Sharp/Video/NvTexture.cs @@ -19,16 +19,13 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public unsafe sealed class Nv12Texture : IDisposable + public unsafe sealed class NvTexture : IDisposable where TUVPixel : struct { - public delegate void LockCallback(Nv12Image pixels); + public delegate void LockCallback(NvImage pixels); private Texture _texture; @@ -49,12 +46,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal Nv12Texture(Texture texture) + internal NvTexture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~Nv12Texture() + ~NvTexture() { Dispose(false); } @@ -95,32 +92,29 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new Nv12Image(pixels, width, height, pitch); + var image = new NvImage(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(Nv12Image image) + public void Update(NvImage image) { - var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); - var yPitch = image.Y.Width * Marshal.SizeOf(); - var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); - var uvPitch = image.UV.Width * Marshal.SizeOf(); Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + SDL.UpdateNVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.UV, image.UV.Pitch) ); } - public void Update(Nv12MemoryImage image) + public void Update(NvMemoryImage image) { ArgumentNullException.ThrowIfNull(image); - var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); - var yPitch = image.Y.Width * Marshal.SizeOf(); - var uvPlane = (byte*)Unsafe.AsPointer(ref image.UV.DangerousGetReference()); - var uvPitch = image.UV.Width * Marshal.SizeOf(); Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, yPlane, yPitch, uvPlane, uvPitch) + SDL.UpdateNVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.UV, image.UV.Pitch + ) ); } @@ -129,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(Nv12Texture texture) + public static implicit operator Texture(NvTexture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/Video/PackedImage.cs b/sources/SDL2Sharp/Video/PackedImage.cs index 1b7bfff2..c60f1ce7 100644 --- a/sources/SDL2Sharp/Video/PackedImage.cs +++ b/sources/SDL2Sharp/Video/PackedImage.cs @@ -45,6 +45,12 @@ public Size Size get => _plane.Size; } + public int Pitch + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _plane.Pitch; + } + public ref TPackedPixel this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -75,5 +81,10 @@ public void Fill(TPackedPixel value) { _plane.Fill(value); } + + public static unsafe explicit operator void*(PackedImage image) + { + return (void*)image; + } } } diff --git a/sources/SDL2Sharp/Video/PackedMemoryImage.cs b/sources/SDL2Sharp/Video/PackedMemoryImage.cs index cfd7e7df..f866d959 100644 --- a/sources/SDL2Sharp/Video/PackedMemoryImage.cs +++ b/sources/SDL2Sharp/Video/PackedMemoryImage.cs @@ -19,12 +19,13 @@ // 3. This notice may not be removed or altered from any source distribution. using System; +using System.Runtime.CompilerServices; namespace SDL2Sharp.Video { - public sealed class PackedMemoryImage where TColor : struct + public sealed class PackedMemoryImage where TPackedPixel : struct { - private readonly ImageMemoryPlane _plane; + private readonly ImageMemoryPlane _plane; public int Width => _plane.Width; @@ -32,7 +33,9 @@ public sealed class PackedMemoryImage where TColor : struct public Size Size => _plane.Size; - public TColor this[int x, int y] + public int Pitch => _plane.Pitch; + + public TPackedPixel this[int x, int y] { get { @@ -49,24 +52,29 @@ public PackedMemoryImage(Size size) { } public PackedMemoryImage(int width, int height) - : this(new ImageMemoryPlane(width, height)) + : this(new ImageMemoryPlane(width, height)) { } - private PackedMemoryImage(ImageMemoryPlane plane) + private PackedMemoryImage(ImageMemoryPlane plane) { _plane = plane ?? throw new ArgumentNullException(nameof(plane)); } - public PackedMemoryImage Crop(int top, int left, int bottom, int right) + public PackedMemoryImage Crop(int top, int left, int bottom, int right) { var croppedPlane = _plane.Crop(top, left, bottom, right); - var croppedImage = new PackedMemoryImage(croppedPlane); + var croppedImage = new PackedMemoryImage(croppedPlane); return croppedImage; } - public ref TColor DangerousGetReference() + public ref TPackedPixel DangerousGetReference() { return ref _plane.DangerousGetReference(); } + + public static unsafe explicit operator void*(PackedMemoryImage image) + { + return Unsafe.AsPointer(ref image.DangerousGetReference()); + } } } diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index 6143e144..daf917b5 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -99,13 +99,11 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; - int pitchInBytes; + int pitch; Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitchInBytes) + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var bytesPerPixel = Marshal.SizeOf(); - var pitch = pitchInBytes / bytesPerPixel; var image = new PackedImage(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); @@ -135,22 +133,18 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback SDL.UnlockTexture(_texture.Handle); } - public void Update(PackedMemoryImage image) + public void Update(PackedImage pixels) { ThrowWhenDisposed(); - var pointer = Unsafe.AsPointer(ref image.DangerousGetReference()); - var pitch = image.Width * Marshal.SizeOf(); - Update(null, pointer, pitch); + Update(null, (void*)pixels, pixels.Pitch); } - public void Update(PackedImage pixels) + public void Update(PackedMemoryImage image) { ThrowWhenDisposed(); - var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); - var pitch = pixels.Width * Marshal.SizeOf(); - Update(null, pointer, pitch); + Update(null, (void*)image, image.Pitch); } public void Update(TPackedPixel[,] pixels) diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index 3ef6518e..f642a3e9 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -45,22 +45,22 @@ public static PackedTexture CreatePackedTexture(this return new PackedTexture(texture); } - public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, Size size) - where TYuvPixelFormat : IYuvPixel, new() + public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, Size size) + where TYuvFormat : IYuvFormat, new() { ArgumentNullException.ThrowIfNull(renderer); - return renderer.CreateYuvTexture(access, size.Width, size.Height); + return renderer.CreateYuvTexture(access, size.Width, size.Height); } - public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TYuvPixelFormat : IYuvPixel, new() + public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TYuvFormat : IYuvFormat, new() { ArgumentNullException.ThrowIfNull(renderer); - var pixelFormat = TYuvPixelFormat.Format; + var pixelFormat = TYuvFormat.PixelFormat; var texture = renderer.CreateTexture(pixelFormat, access, width, height); - return new YuvTexture(texture); + return new YuvTexture(texture); } public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index 3bcf73c6..f102e597 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -40,22 +40,22 @@ public static YuvTexture AsIYUV(this Texture texture) return new YuvTexture(texture); } - public static Nv12Texture AsNV12(this Texture texture) + public static NvTexture AsNV12(this Texture texture) { if (texture.Format != PixelFormat.NV12) { throw new ArgumentException("Texture is not in NV12 color format.", nameof(texture)); } - return new Nv12Texture(texture); + return new NvTexture(texture); } - public static Nv21Texture AsNV21(this Texture texture) + public static NvTexture AsNV21(this Texture texture) { if (texture.Format != PixelFormat.NV21) { throw new ArgumentException("Texture is not in NV21 color format.", nameof(texture)); } - return new Nv21Texture(texture); + return new NvTexture(texture); } public static YuvTexture AsYV12(this Texture texture) diff --git a/sources/SDL2Sharp/Video/YuvImage.cs b/sources/SDL2Sharp/Video/YuvImage.cs index 7b71b8dc..5cac030a 100644 --- a/sources/SDL2Sharp/Video/YuvImage.cs +++ b/sources/SDL2Sharp/Video/YuvImage.cs @@ -24,7 +24,7 @@ namespace SDL2Sharp.Video { - public readonly ref struct YuvImage where TYuvPixelFormat : IYuvPixel, new() + public readonly ref struct YuvImage where TYuvFormat : IYuvFormat, new() { private readonly ImagePlane _yPlane; @@ -76,26 +76,9 @@ public unsafe YuvImage(void* pixels, int width, int height, int pitch) "pitch cannot be less than zero"); } - var yPlaneHeight = TYuvPixelFormat.GetYPlaneHeight(height); - var yPlaneWidth = TYuvPixelFormat.GetYPlaneWidth(width); - var yPlanePitch = TYuvPixelFormat.GetYPlanePitch(pitch); - var yPlaneOffset = TYuvPixelFormat.GetYPlaneOffset(width, height, pitch); - var yPlanePixels = Unsafe.Add(pixels, yPlaneOffset); - _yPlane = new ImagePlane(yPlanePixels, yPlaneWidth, yPlaneHeight, yPlanePitch); - - var uPlaneHeight = TYuvPixelFormat.GetUPlaneHeight(height); - var uPlaneWidth = TYuvPixelFormat.GetUPlaneWidth(width); - var uPlanePitch = TYuvPixelFormat.GetUPlanePitch(pitch); - var uPlaneOffset = TYuvPixelFormat.GetUPlaneOffset(width, height, pitch); - var uPlanePixels = Unsafe.Add(pixels, uPlaneOffset); - _uPlane = new ImagePlane(uPlanePixels, uPlaneWidth, uPlaneHeight, uPlanePitch); - - var vPlaneHeight = TYuvPixelFormat.GetVPlaneHeight(height); - var vPlaneWidth = TYuvPixelFormat.GetVPlaneWidth(width); - var vPlanePitch = TYuvPixelFormat.GetVPlanePitch(pitch); - var vPlaneOffset = TYuvPixelFormat.GetVPlaneOffset(width, height, pitch); - var vPlanePixels = Unsafe.Add(pixels, vPlaneOffset); - _vPlane = new ImagePlane(vPlanePixels, vPlaneWidth, vPlaneHeight, vPlanePitch); + _yPlane = TYuvFormat.CreateYPlane(pixels, width, height, pitch); + _uPlane = TYuvFormat.CreateUPlane(pixels, width, height, pitch); + _vPlane = TYuvFormat.CreateVPlane(pixels, width, height, pitch); } } } diff --git a/sources/SDL2Sharp/Video/Nv12MemoryImage.cs b/sources/SDL2Sharp/Video/YuvMemoryImage.cs similarity index 81% rename from sources/SDL2Sharp/Video/Nv12MemoryImage.cs rename to sources/SDL2Sharp/Video/YuvMemoryImage.cs index f3737b51..23dd1d75 100644 --- a/sources/SDL2Sharp/Video/Nv12MemoryImage.cs +++ b/sources/SDL2Sharp/Video/YuvMemoryImage.cs @@ -24,15 +24,19 @@ namespace SDL2Sharp.Video { - public sealed class Nv12MemoryImage + public sealed class YuvMemoryImage { private readonly ImageMemoryPlane _yPlane; - private readonly ImageMemoryPlane _uvPlane; + private readonly ImageMemoryPlane _uPlane; + + private readonly ImageMemoryPlane _vPlane; public ImageMemoryPlane Y => _yPlane; - public ImageMemoryPlane UV => _uvPlane; + public ImageMemoryPlane U => _uPlane; + + public ImageMemoryPlane V => _vPlane; public int Width { @@ -46,7 +50,7 @@ public int Height get => _yPlane.Height; } - public Nv12MemoryImage(int width, int height) + public YuvMemoryImage(int width, int height) { if (width < 0) { @@ -65,7 +69,8 @@ public Nv12MemoryImage(int width, int height) } _yPlane = new ImageMemoryPlane(width, height); - _uvPlane = new ImageMemoryPlane(width / 2, height / 2); + _uPlane = new ImageMemoryPlane(width / 2, height / 2); + _vPlane = new ImageMemoryPlane(width / 2, height / 2); } } } diff --git a/sources/SDL2Sharp/Video/YuvTexture.cs b/sources/SDL2Sharp/Video/YuvTexture.cs index 34b0bc2e..49cb9a07 100644 --- a/sources/SDL2Sharp/Video/YuvTexture.cs +++ b/sources/SDL2Sharp/Video/YuvTexture.cs @@ -19,16 +19,14 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using SDL2Sharp.Interop; using SDL2Sharp.Video.Colors; namespace SDL2Sharp.Video { - public sealed unsafe partial class YuvTexture : IDisposable where TYuvPixelFormat : IYuvPixel, new() + public sealed unsafe partial class YuvTexture : IDisposable where TYuvFormat : IYuvFormat, new() { - public delegate void LockCallback(YuvImage pixels); + public delegate void LockCallback(YuvImage pixels); private Texture _texture; @@ -93,21 +91,30 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new YuvImage(pixels, width, height, pitch); + var image = new YuvImage(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(YuvImage image) + public void Update(YuvImage image) { - var yPlane = (byte*)Unsafe.AsPointer(ref image.Y.DangerousGetReference()); - var yPitch = image.Y.Width * Marshal.SizeOf(); - var uPlane = (byte*)Unsafe.AsPointer(ref image.U.DangerousGetReference()); - var uPitch = image.U.Width * Marshal.SizeOf(); - var vPlane = (byte*)Unsafe.AsPointer(ref image.V.DangerousGetReference()); - var vPitch = image.V.Width * Marshal.SizeOf(); Error.ThrowLastErrorIfNegative( - SDL.UpdateYUVTexture(_texture.Handle, null, yPlane, yPitch, uPlane, uPitch, vPlane, vPitch) + SDL.UpdateYUVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.U, image.U.Pitch, + (byte*)image.V, image.V.Pitch + ) + ); + } + + public void Update(YuvMemoryImage image) + { + Error.ThrowLastErrorIfNegative( + SDL.UpdateYUVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.U, image.U.Pitch, + (byte*)image.V, image.V.Pitch + ) ); } @@ -116,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(YuvTexture texture) + public static implicit operator Texture(YuvTexture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs index 9015a22d..c00d5ef8 100644 --- a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs @@ -24,16 +24,22 @@ namespace SDL2Sharp.Tests { - public sealed class PlanarTextureTests + public static class PlanarTextureTests { [Fact] - public void WriteAndReadYV12() + public static void WriteAndReadYV12() => WriteAndRead(); + + [Fact] + public static void WriteAndReadIYUV() => WriteAndRead(); + + private static void WriteAndRead() + where TYuvFormat : struct, IYuvFormat { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); using var window = videoSystem.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateYuvTexture(TextureAccess.Streaming, renderer.OutputSize); + using var texture = renderer.CreateYuvTexture(TextureAccess.Streaming, renderer.OutputSize); var y = new Y8(255); var u = new U8(128); diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index e04ca55b..e67af8cb 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -93,7 +93,7 @@ public void CreateTextureOfNV21() planarTexture.WithLock(pixels => { pixels.Y.Fill(y); - pixels.VU.Fill(vu); + pixels.UV.Fill(vu); }); renderer.Copy(texture); renderer.Present(); From 961e9caf5c78f68111edae03b42df8cfc9eabab9 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 4 Aug 2024 04:50:08 +0200 Subject: [PATCH 40/62] Fix formatting rules. --- .editorconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index f9cfe594..dc2e6dc9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,7 +16,7 @@ charset = utf-8-bom # XML project files [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 4 +indent_size = 2 # XML config files [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] @@ -99,7 +99,7 @@ dotnet_naming_style.constant_style.capitalization = pascal_case # Static fields are camelCase and start with _ dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields -dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style +dotnet_naming_rule.static_fields_should_be_camel_case.style = instance_field_style dotnet_naming_symbols.static_fields.applicable_kinds = field dotnet_naming_symbols.static_fields.required_modifiers = static @@ -330,3 +330,5 @@ dotnet_diagnostic.CA1822.severity = suggestion [*.cs] dotnet_diagnostic.CA1401.severity = silent dotnet_diagnostic.SYSLIB1054.severity = silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion From 7b116270b6fdec6930d84587e7becf6751dd08f6 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 4 Aug 2024 05:45:14 +0200 Subject: [PATCH 41/62] Order modifiers. --- sources/SDL2Sharp/Input/Keyboard.cs | 2 +- sources/SDL2Sharp/Video/Colors/IYuvFormat.cs | 6 +++--- sources/SDL2Sharp/Video/Display.cs | 2 +- sources/SDL2Sharp/Video/ImagePlane.cs | 2 +- sources/SDL2Sharp/Video/NvTexture.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/SDL2Sharp/Input/Keyboard.cs b/sources/SDL2Sharp/Input/Keyboard.cs index eb6d6eb0..958e7f41 100644 --- a/sources/SDL2Sharp/Input/Keyboard.cs +++ b/sources/SDL2Sharp/Input/Keyboard.cs @@ -25,7 +25,7 @@ namespace SDL2Sharp.Input { public static class Keyboard { - public unsafe static KeyboardState State + public static unsafe KeyboardState State { get { diff --git a/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs b/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs index ad8baff6..7205e922 100644 --- a/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs +++ b/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs @@ -24,10 +24,10 @@ public interface IYuvFormat { static abstract PixelFormat PixelFormat { get; } - static unsafe abstract ImagePlane CreateYPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); + static abstract unsafe ImagePlane CreateYPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); - static unsafe abstract ImagePlane CreateUPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); + static abstract unsafe ImagePlane CreateUPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); - static unsafe abstract ImagePlane CreateVPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); + static abstract unsafe ImagePlane CreateVPlane(void* pixels, int imageWidth, int imageHeight, int imagePitch); } } diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/Video/Display.cs index 94340da7..9da6c1a2 100644 --- a/sources/SDL2Sharp/Video/Display.cs +++ b/sources/SDL2Sharp/Video/Display.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Video { - public unsafe sealed class Display + public sealed unsafe class Display { private readonly int _displayIndex; diff --git a/sources/SDL2Sharp/Video/ImagePlane.cs b/sources/SDL2Sharp/Video/ImagePlane.cs index 0024af41..fb91d990 100644 --- a/sources/SDL2Sharp/Video/ImagePlane.cs +++ b/sources/SDL2Sharp/Video/ImagePlane.cs @@ -25,7 +25,7 @@ namespace SDL2Sharp.Video { - public unsafe readonly ref struct ImagePlane where TPackedPixel : struct + public readonly unsafe ref struct ImagePlane where TPackedPixel : struct { private readonly void* _pixels; diff --git a/sources/SDL2Sharp/Video/NvTexture.cs b/sources/SDL2Sharp/Video/NvTexture.cs index 909dfa7a..73a1018d 100644 --- a/sources/SDL2Sharp/Video/NvTexture.cs +++ b/sources/SDL2Sharp/Video/NvTexture.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Video { - public unsafe sealed class NvTexture : IDisposable where TUVPixel : struct + public sealed unsafe class NvTexture : IDisposable where TUVPixel : struct { public delegate void LockCallback(NvImage pixels); From 7654907787b15f3464a0e8a981d8a62eb02ae1ff Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 4 Aug 2024 08:09:30 +0200 Subject: [PATCH 42/62] Disable code analysis for generated code. --- sources/SDL2Sharp.Interop/.editorconfig | 8 ++++++++ tests/SDL2Sharp.Interop.Tests/.editorconfig | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 sources/SDL2Sharp.Interop/.editorconfig create mode 100644 tests/SDL2Sharp.Interop.Tests/.editorconfig diff --git a/sources/SDL2Sharp.Interop/.editorconfig b/sources/SDL2Sharp.Interop/.editorconfig new file mode 100644 index 00000000..e1713a8e --- /dev/null +++ b/sources/SDL2Sharp.Interop/.editorconfig @@ -0,0 +1,8 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = false + +# Treat code files as generated code +[*.cs] +generated_code = true \ No newline at end of file diff --git a/tests/SDL2Sharp.Interop.Tests/.editorconfig b/tests/SDL2Sharp.Interop.Tests/.editorconfig new file mode 100644 index 00000000..e1713a8e --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/.editorconfig @@ -0,0 +1,8 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = false + +# Treat code files as generated code +[*.cs] +generated_code = true \ No newline at end of file From ae98c8fc2cc9a75e0761e0467d695e3270ce82fa Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sat, 27 Jul 2024 16:15:06 +0200 Subject: [PATCH 43/62] Generate specific interop code for .NET 8.0, .NET 6.0, and .NET Standard 2.0. --- Directory.Build.props | 11 +- build/Build/Build.csproj | 2 +- build/Build/IBuild.cs | 6 - build/Build/IGenerate.cs | 154 +- build/Build/ITest.cs | 25 +- .../SDL2Sharp.Interop/Extensions/IMG.Error.cs | 4 +- .../SDL2Sharp.Interop/Extensions/SDL.Blit.cs | 2 + .../Extensions/SDL.BlitScaled.cs | 2 + .../Extensions/SDL.BlitSurface.cs | 2 + .../SDL2Sharp.Interop/Extensions/TTF.Error.cs | 4 +- .../SDL2Sharp.Interop.csproj | 34 +- .../{ => codegen/compatible}/ID3D11Device.cs | 0 .../{ => codegen/compatible}/ID3D12Device.cs | 0 .../compatible}/IDirect3DDevice9.cs | 0 .../{ => codegen/compatible}/IMG.cs | 0 .../{ => codegen/compatible}/IMG_Animation.cs | 0 .../{ => codegen/compatible}/IMG_InitFlags.cs | 0 .../codegen/compatible/SDL.cs | 2387 +++++++++++++++++ .../compatible}/SDL_ArrayOrder.cs | 0 .../codegen/compatible/SDL_AudioCVT.cs | 80 + .../compatible}/SDL_AudioCallback.cs | 0 .../compatible}/SDL_AudioDeviceEvent.cs | 0 .../compatible}/SDL_AudioFilter.cs | 0 .../codegen/compatible/SDL_AudioSpec.cs | 52 + .../compatible}/SDL_AudioStatus.cs | 0 .../compatible}/SDL_BitmapOrder.cs | 0 .../compatible}/SDL_BlendFactor.cs | 0 .../{ => codegen/compatible}/SDL_BlendMode.cs | 0 .../compatible}/SDL_BlendOperation.cs | 0 .../{ => codegen/compatible}/SDL_BlitMap.cs | 0 .../{ => codegen/compatible}/SDL_Color.cs | 0 .../compatible}/SDL_CommonEvent.cs | 0 .../compatible}/SDL_ControllerAxisEvent.cs | 0 .../compatible}/SDL_ControllerButtonEvent.cs | 0 .../compatible}/SDL_ControllerDeviceEvent.cs | 0 .../compatible/SDL_ControllerSensorEvent.cs | 43 + .../SDL_ControllerTouchpadEvent.cs | 0 .../{ => codegen/compatible}/SDL_Cursor.cs | 0 .../compatible}/SDL_DUMMY_ENUM.cs | 0 .../compatible}/SDL_DisplayEvent.cs | 0 .../compatible}/SDL_DisplayEventID.cs | 0 .../compatible}/SDL_DisplayMode.cs | 0 .../compatible}/SDL_DisplayOrientation.cs | 0 .../compatible}/SDL_DollarGestureEvent.cs | 0 .../{ => codegen/compatible}/SDL_DropEvent.cs | 0 .../codegen/compatible/SDL_Event.cs | 126 + .../compatible}/SDL_EventFilter.cs | 0 .../{ => codegen/compatible}/SDL_EventType.cs | 0 .../{ => codegen/compatible}/SDL_FPoint.cs | 0 .../{ => codegen/compatible}/SDL_FRect.cs | 0 .../compatible}/SDL_FlashOperation.cs | 0 .../SDL_GLContextResetNotification.cs | 0 .../{ => codegen/compatible}/SDL_GLattr.cs | 0 .../compatible}/SDL_GLcontextFlag.cs | 0 .../compatible}/SDL_GLcontextReleaseFlag.cs | 0 .../{ => codegen/compatible}/SDL_GLprofile.cs | 0 .../codegen/compatible/SDL_GUID.cs | 28 + .../compatible}/SDL_HintCallback.cs | 0 .../compatible}/SDL_HintPriority.cs | 0 .../{ => codegen/compatible}/SDL_HitTest.cs | 0 .../compatible}/SDL_HitTestResult.cs | 0 .../compatible}/SDL_JoyAxisEvent.cs | 0 .../compatible}/SDL_JoyBallEvent.cs | 0 .../compatible}/SDL_JoyBatteryEvent.cs | 0 .../compatible}/SDL_JoyButtonEvent.cs | 0 .../compatible}/SDL_JoyDeviceEvent.cs | 0 .../compatible}/SDL_JoyHatEvent.cs | 0 .../compatible}/SDL_JoystickPowerLevel.cs | 0 .../compatible}/SDL_JoystickType.cs | 0 .../{ => codegen/compatible}/SDL_KeyCode.cs | 0 .../compatible}/SDL_KeyboardEvent.cs | 0 .../{ => codegen/compatible}/SDL_Keymod.cs | 0 .../{ => codegen/compatible}/SDL_Keysym.cs | 0 .../compatible}/SDL_LogCategory.cs | 0 .../compatible}/SDL_LogOutputFunction.cs | 0 .../compatible}/SDL_LogPriority.cs | 0 .../compatible}/SDL_MouseButtonEvent.cs | 0 .../compatible}/SDL_MouseMotionEvent.cs | 0 .../compatible}/SDL_MouseWheelDirection.cs | 0 .../compatible}/SDL_MouseWheelEvent.cs | 0 .../compatible}/SDL_MultiGestureEvent.cs | 0 .../{ => codegen/compatible}/SDL_OSEvent.cs | 0 .../compatible}/SDL_PackedLayout.cs | 0 .../compatible}/SDL_PackedOrder.cs | 0 .../{ => codegen/compatible}/SDL_Palette.cs | 0 .../codegen/compatible/SDL_PixelFormat.cs | 80 + .../compatible}/SDL_PixelFormatEnum.cs | 0 .../{ => codegen/compatible}/SDL_PixelType.cs | 0 .../{ => codegen/compatible}/SDL_Point.cs | 0 .../{ => codegen/compatible}/SDL_QuitEvent.cs | 0 .../codegen/compatible/SDL_RWops.cs | 105 + .../{ => codegen/compatible}/SDL_Rect.cs | 0 .../{ => codegen/compatible}/SDL_Renderer.cs | 0 .../compatible}/SDL_RendererFlags.cs | 0 .../compatible}/SDL_RendererFlip.cs | 0 .../codegen/compatible/SDL_RendererInfo.cs | 41 + .../{ => codegen/compatible}/SDL_ScaleMode.cs | 0 .../{ => codegen/compatible}/SDL_Scancode.cs | 0 .../codegen/compatible/SDL_SensorEvent.cs | 40 + .../{ => codegen/compatible}/SDL_Surface.cs | 0 .../compatible}/SDL_SysWMEvent.cs | 0 .../{ => codegen/compatible}/SDL_SysWMmsg.cs | 0 .../compatible}/SDL_SystemCursor.cs | 0 .../compatible/SDL_TextEditingEvent.cs | 43 + .../compatible}/SDL_TextEditingExtEvent.cs | 0 .../codegen/compatible/SDL_TextInputEvent.cs | 37 + .../{ => codegen/compatible}/SDL_Texture.cs | 0 .../compatible}/SDL_TextureAccess.cs | 0 .../compatible}/SDL_TextureModulate.cs | 0 .../compatible}/SDL_TouchFingerEvent.cs | 0 .../{ => codegen/compatible}/SDL_UserEvent.cs | 0 .../{ => codegen/compatible}/SDL_Vertex.cs | 0 .../compatible/SDL_VirtualJoystickDesc.cs | 80 + .../{ => codegen/compatible}/SDL_Window.cs | 0 .../compatible}/SDL_WindowEvent.cs | 0 .../compatible}/SDL_WindowEventID.cs | 0 .../compatible}/SDL_WindowFlags.cs | 0 .../compatible}/SDL_WindowsMessageHook.cs | 0 .../compatible}/SDL_YUV_CONVERSION_MODE.cs | 0 .../{ => codegen/compatible}/SDL_blit.cs | 0 .../{ => codegen/compatible}/SDL_bool.cs | 0 .../compatible}/SDL_calloc_func.cs | 0 .../{ => codegen/compatible}/SDL_errorcode.cs | 0 .../compatible}/SDL_eventaction.cs | 0 .../{ => codegen/compatible}/SDL_free_func.cs | 0 .../compatible}/SDL_malloc_func.cs | 0 .../compatible}/SDL_realloc_func.cs | 0 .../{ => codegen/compatible}/SDL_version.cs | 0 .../{ => codegen/compatible}/TTF.cs | 0 .../{ => codegen/compatible}/TTF_Direction.cs | 0 .../compatible}/_SDL_AudioStream.cs | 0 .../{ => codegen/compatible}/_SDL_Joystick.cs | 0 .../{ => codegen/compatible}/_SDL_iconv_t.cs | 0 .../{ => codegen/compatible}/_TTF_Font.cs | 0 .../codegen/default/ID3D11Device.cs | 26 + .../codegen/default/ID3D12Device.cs | 26 + .../codegen/default/IDirect3DDevice9.cs | 26 + .../SDL2Sharp.Interop/codegen/default/IMG.cs | 214 ++ .../codegen/default/IMG_Animation.cs | 35 + .../codegen/default/IMG_InitFlags.cs | 32 + .../SDL2Sharp.Interop/codegen/default/SDL.cs | 2387 +++++++++++++++++ .../codegen/default/SDL_ArrayOrder.cs | 33 + .../{ => codegen/default}/SDL_AudioCVT.cs | 0 .../codegen/default/SDL_AudioDeviceEvent.cs | 46 + .../{ => codegen/default}/SDL_AudioSpec.cs | 0 .../codegen/default/SDL_AudioStatus.cs | 29 + .../codegen/default/SDL_BitmapOrder.cs | 29 + .../codegen/default/SDL_BlendFactor.cs | 36 + .../codegen/default/SDL_BlendMode.cs | 32 + .../codegen/default/SDL_BlendOperation.cs | 31 + .../codegen/default/SDL_BlitMap.cs | 26 + .../codegen/default/SDL_Color.cs | 37 + .../codegen/default/SDL_CommonEvent.cs | 31 + .../default/SDL_ControllerAxisEvent.cs | 52 + .../default/SDL_ControllerButtonEvent.cs | 46 + .../default/SDL_ControllerDeviceEvent.cs | 34 + .../default/SDL_ControllerSensorEvent.cs | 43 + .../default/SDL_ControllerTouchpadEvent.cs | 46 + .../codegen/default/SDL_Cursor.cs | 26 + .../codegen/default/SDL_DUMMY_ENUM.cs | 27 + .../codegen/default/SDL_DisplayEvent.cs | 49 + .../codegen/default/SDL_DisplayEventID.cs | 31 + .../codegen/default/SDL_DisplayMode.cs | 36 + .../codegen/default/SDL_DisplayOrientation.cs | 31 + .../codegen/default/SDL_DollarGestureEvent.cs | 46 + .../codegen/default/SDL_DropEvent.cs | 37 + .../codegen/default/SDL_Event.cs | 126 + .../codegen/default/SDL_EventType.cs | 86 + .../codegen/default/SDL_FPoint.cs | 29 + .../codegen/default/SDL_FRect.cs | 33 + .../codegen/default/SDL_FlashOperation.cs | 29 + .../default/SDL_GLContextResetNotification.cs | 28 + .../codegen/default/SDL_GLattr.cs | 54 + .../codegen/default/SDL_GLcontextFlag.cs | 30 + .../default/SDL_GLcontextReleaseFlag.cs | 28 + .../codegen/default/SDL_GLprofile.cs | 29 + .../codegen/default/SDL_GUID.cs | 28 + .../codegen/default/SDL_HintPriority.cs | 29 + .../codegen/default/SDL_HitTestResult.cs | 36 + .../codegen/default/SDL_JoyAxisEvent.cs | 52 + .../codegen/default/SDL_JoyBallEvent.cs | 52 + .../codegen/default/SDL_JoyBatteryEvent.cs | 36 + .../codegen/default/SDL_JoyButtonEvent.cs | 46 + .../codegen/default/SDL_JoyDeviceEvent.cs | 34 + .../codegen/default/SDL_JoyHatEvent.cs | 46 + .../codegen/default/SDL_JoystickPowerLevel.cs | 33 + .../codegen/default/SDL_JoystickType.cs | 36 + .../codegen/default/SDL_KeyCode.cs | 272 ++ .../codegen/default/SDL_KeyboardEvent.cs | 48 + .../codegen/default/SDL_Keymod.cs | 44 + .../codegen/default/SDL_Keysym.cs | 36 + .../codegen/default/SDL_LogCategory.cs | 46 + .../codegen/default/SDL_LogPriority.cs | 33 + .../codegen/default/SDL_MouseButtonEvent.cs | 55 + .../codegen/default/SDL_MouseMotionEvent.cs | 52 + .../default/SDL_MouseWheelDirection.cs | 28 + .../codegen/default/SDL_MouseWheelEvent.cs | 56 + .../codegen/default/SDL_MultiGestureEvent.cs | 48 + .../codegen/default/SDL_OSEvent.cs | 31 + .../codegen/default/SDL_PackedLayout.cs | 35 + .../codegen/default/SDL_PackedOrder.cs | 35 + .../codegen/default/SDL_Palette.cs | 34 + .../codegen/default/SDL_PixelFormat.cs | 80 + .../codegen/default/SDL_PixelFormatEnum.cs | 83 + .../codegen/default/SDL_PixelType.cs | 38 + .../codegen/default/SDL_Point.cs | 29 + .../codegen/default/SDL_QuitEvent.cs | 31 + .../{ => codegen/default}/SDL_RWops.cs | 0 .../codegen/default/SDL_Rect.cs | 33 + .../codegen/default/SDL_Renderer.cs | 26 + .../codegen/default/SDL_RendererFlags.cs | 31 + .../codegen/default/SDL_RendererFlip.cs | 29 + .../codegen/default/SDL_RendererInfo.cs | 41 + .../codegen/default/SDL_ScaleMode.cs | 29 + .../codegen/default/SDL_Scancode.cs | 274 ++ .../codegen/default/SDL_SensorEvent.cs | 40 + .../codegen/default/SDL_Surface.cs | 50 + .../codegen/default/SDL_SysWMEvent.cs | 33 + .../codegen/default/SDL_SysWMmsg.cs | 26 + .../codegen/default/SDL_SystemCursor.cs | 39 + .../codegen/default/SDL_TextEditingEvent.cs | 43 + .../default/SDL_TextEditingExtEvent.cs | 43 + .../codegen/default/SDL_TextInputEvent.cs | 37 + .../codegen/default/SDL_Texture.cs | 26 + .../codegen/default/SDL_TextureAccess.cs | 29 + .../codegen/default/SDL_TextureModulate.cs | 29 + .../codegen/default/SDL_TouchFingerEvent.cs | 50 + .../codegen/default/SDL_UserEvent.cs | 41 + .../codegen/default/SDL_Vertex.cs | 31 + .../default}/SDL_VirtualJoystickDesc.cs | 0 .../codegen/default/SDL_Window.cs | 26 + .../codegen/default/SDL_WindowEvent.cs | 52 + .../codegen/default/SDL_WindowEventID.cs | 45 + .../codegen/default/SDL_WindowFlags.cs | 50 + .../default/SDL_YUV_CONVERSION_MODE.cs | 30 + .../codegen/default/SDL_bool.cs | 28 + .../codegen/default/SDL_errorcode.cs | 32 + .../codegen/default/SDL_eventaction.cs | 29 + .../codegen/default/SDL_version.cs | 34 + .../SDL2Sharp.Interop/codegen/default/TTF.cs | 366 +++ .../codegen/default/TTF_Direction.cs | 30 + .../codegen/default/_SDL_AudioStream.cs | 26 + .../codegen/default/_SDL_Joystick.cs | 26 + .../codegen/default/_SDL_iconv_t.cs | 26 + .../codegen/default/_TTF_Font.cs | 26 + .../codegen/latest/ID3D11Device.cs | 26 + .../codegen/latest/ID3D12Device.cs | 26 + .../codegen/latest/IDirect3DDevice9.cs | 26 + .../SDL2Sharp.Interop/codegen/latest/IMG.cs | 214 ++ .../codegen/latest/IMG_Animation.cs | 35 + .../codegen/latest/IMG_InitFlags.cs | 32 + .../{ => codegen/latest}/SDL.cs | 0 .../codegen/latest/SDL_ArrayOrder.cs | 33 + .../codegen/latest/SDL_AudioCVT.cs | 79 + .../codegen/latest/SDL_AudioCallback.cs | 27 + .../codegen/latest/SDL_AudioDeviceEvent.cs | 46 + .../codegen/latest/SDL_AudioFilter.cs | 27 + .../codegen/latest/SDL_AudioSpec.cs | 50 + .../codegen/latest/SDL_AudioStatus.cs | 29 + .../codegen/latest/SDL_BitmapOrder.cs | 29 + .../codegen/latest/SDL_BlendFactor.cs | 36 + .../codegen/latest/SDL_BlendMode.cs | 32 + .../codegen/latest/SDL_BlendOperation.cs | 31 + .../codegen/latest/SDL_BlitMap.cs | 26 + .../codegen/latest/SDL_Color.cs | 37 + .../codegen/latest/SDL_CommonEvent.cs | 31 + .../codegen/latest/SDL_ControllerAxisEvent.cs | 52 + .../latest/SDL_ControllerButtonEvent.cs | 46 + .../latest/SDL_ControllerDeviceEvent.cs | 34 + .../latest}/SDL_ControllerSensorEvent.cs | 0 .../latest/SDL_ControllerTouchpadEvent.cs | 46 + .../codegen/latest/SDL_Cursor.cs | 26 + .../codegen/latest/SDL_DUMMY_ENUM.cs | 27 + .../codegen/latest/SDL_DisplayEvent.cs | 49 + .../codegen/latest/SDL_DisplayEventID.cs | 31 + .../codegen/latest/SDL_DisplayMode.cs | 36 + .../codegen/latest/SDL_DisplayOrientation.cs | 31 + .../codegen/latest/SDL_DollarGestureEvent.cs | 46 + .../codegen/latest/SDL_DropEvent.cs | 37 + .../{ => codegen/latest}/SDL_Event.cs | 0 .../codegen/latest/SDL_EventFilter.cs | 27 + .../codegen/latest/SDL_EventType.cs | 86 + .../codegen/latest/SDL_FPoint.cs | 29 + .../codegen/latest/SDL_FRect.cs | 33 + .../codegen/latest/SDL_FlashOperation.cs | 29 + .../latest/SDL_GLContextResetNotification.cs | 28 + .../codegen/latest/SDL_GLattr.cs | 54 + .../codegen/latest/SDL_GLcontextFlag.cs | 30 + .../latest/SDL_GLcontextReleaseFlag.cs | 28 + .../codegen/latest/SDL_GLprofile.cs | 29 + .../{ => codegen/latest}/SDL_GUID.cs | 0 .../codegen/latest/SDL_HintCallback.cs | 27 + .../codegen/latest/SDL_HintPriority.cs | 29 + .../codegen/latest/SDL_HitTest.cs | 27 + .../codegen/latest/SDL_HitTestResult.cs | 36 + .../codegen/latest/SDL_JoyAxisEvent.cs | 52 + .../codegen/latest/SDL_JoyBallEvent.cs | 52 + .../codegen/latest/SDL_JoyBatteryEvent.cs | 36 + .../codegen/latest/SDL_JoyButtonEvent.cs | 46 + .../codegen/latest/SDL_JoyDeviceEvent.cs | 34 + .../codegen/latest/SDL_JoyHatEvent.cs | 46 + .../codegen/latest/SDL_JoystickPowerLevel.cs | 33 + .../codegen/latest/SDL_JoystickType.cs | 36 + .../codegen/latest/SDL_KeyCode.cs | 272 ++ .../codegen/latest/SDL_KeyboardEvent.cs | 48 + .../codegen/latest/SDL_Keymod.cs | 44 + .../codegen/latest/SDL_Keysym.cs | 36 + .../codegen/latest/SDL_LogCategory.cs | 46 + .../codegen/latest/SDL_LogOutputFunction.cs | 27 + .../codegen/latest/SDL_LogPriority.cs | 33 + .../codegen/latest/SDL_MouseButtonEvent.cs | 55 + .../codegen/latest/SDL_MouseMotionEvent.cs | 52 + .../codegen/latest/SDL_MouseWheelDirection.cs | 28 + .../codegen/latest/SDL_MouseWheelEvent.cs | 56 + .../codegen/latest/SDL_MultiGestureEvent.cs | 48 + .../codegen/latest/SDL_OSEvent.cs | 31 + .../codegen/latest/SDL_PackedLayout.cs | 35 + .../codegen/latest/SDL_PackedOrder.cs | 35 + .../codegen/latest/SDL_Palette.cs | 34 + .../{ => codegen/latest}/SDL_PixelFormat.cs | 0 .../codegen/latest/SDL_PixelFormatEnum.cs | 83 + .../codegen/latest/SDL_PixelType.cs | 38 + .../codegen/latest/SDL_Point.cs | 29 + .../codegen/latest/SDL_QuitEvent.cs | 31 + .../codegen/latest/SDL_RWops.cs | 104 + .../codegen/latest/SDL_Rect.cs | 33 + .../codegen/latest/SDL_Renderer.cs | 26 + .../codegen/latest/SDL_RendererFlags.cs | 31 + .../codegen/latest/SDL_RendererFlip.cs | 29 + .../{ => codegen/latest}/SDL_RendererInfo.cs | 0 .../codegen/latest/SDL_ScaleMode.cs | 29 + .../codegen/latest/SDL_Scancode.cs | 274 ++ .../{ => codegen/latest}/SDL_SensorEvent.cs | 0 .../codegen/latest/SDL_Surface.cs | 50 + .../codegen/latest/SDL_SysWMEvent.cs | 33 + .../codegen/latest/SDL_SysWMmsg.cs | 26 + .../codegen/latest/SDL_SystemCursor.cs | 39 + .../latest}/SDL_TextEditingEvent.cs | 0 .../codegen/latest/SDL_TextEditingExtEvent.cs | 43 + .../latest}/SDL_TextInputEvent.cs | 0 .../codegen/latest/SDL_Texture.cs | 26 + .../codegen/latest/SDL_TextureAccess.cs | 29 + .../codegen/latest/SDL_TextureModulate.cs | 29 + .../codegen/latest/SDL_TouchFingerEvent.cs | 50 + .../codegen/latest/SDL_UserEvent.cs | 41 + .../codegen/latest/SDL_Vertex.cs | 31 + .../codegen/latest/SDL_VirtualJoystickDesc.cs | 78 + .../codegen/latest/SDL_Window.cs | 26 + .../codegen/latest/SDL_WindowEvent.cs | 52 + .../codegen/latest/SDL_WindowEventID.cs | 45 + .../codegen/latest/SDL_WindowFlags.cs | 50 + .../codegen/latest/SDL_WindowsMessageHook.cs | 27 + .../codegen/latest/SDL_YUV_CONVERSION_MODE.cs | 30 + .../codegen/latest/SDL_blit.cs | 27 + .../codegen/latest/SDL_bool.cs | 28 + .../codegen/latest/SDL_calloc_func.cs | 28 + .../codegen/latest/SDL_errorcode.cs | 32 + .../codegen/latest/SDL_eventaction.cs | 29 + .../codegen/latest/SDL_free_func.cs | 27 + .../codegen/latest/SDL_malloc_func.cs | 28 + .../codegen/latest/SDL_realloc_func.cs | 28 + .../codegen/latest/SDL_version.cs | 34 + .../SDL2Sharp.Interop/codegen/latest/TTF.cs | 366 +++ .../codegen/latest/TTF_Direction.cs | 30 + .../codegen/latest/_SDL_AudioStream.cs | 26 + .../codegen/latest/_SDL_Joystick.cs | 26 + .../codegen/latest/_SDL_iconv_t.cs | 26 + .../codegen/latest/_TTF_Font.cs | 26 + sources/SDL2Sharp/Audio/AudioSubsystem.cs | 10 + tests/SDL2Sharp.Interop.Tests/App.config | 6 - .../SDL2Sharp.Interop.Tests.csproj | 36 +- .../codegen/compatible/ID3D11DeviceTests.cs | 50 + .../codegen/compatible/ID3D12DeviceTests.cs | 50 + .../compatible/IDirect3DDevice9Tests.cs | 50 + .../codegen/compatible/IMG_AnimationTests.cs | 58 + .../codegen/compatible/SDL_AudioCVTTests.cs | 58 + .../compatible/SDL_AudioDeviceEventTests.cs | 50 + .../codegen/compatible/SDL_AudioSpecTests.cs | 58 + .../codegen/compatible/SDL_BlitMapTests.cs | 50 + .../codegen/compatible/SDL_ColorTests.cs | 50 + .../compatible/SDL_CommonEventTests.cs | 50 + .../SDL_ControllerAxisEventTests.cs | 50 + .../SDL_ControllerButtonEventTests.cs | 50 + .../SDL_ControllerDeviceEventTests.cs | 50 + .../SDL_ControllerSensorEventTests.cs | 50 + .../SDL_ControllerTouchpadEventTests.cs | 50 + .../codegen/compatible/SDL_CursorTests.cs | 50 + .../compatible/SDL_DisplayEventTests.cs | 50 + .../compatible/SDL_DisplayModeTests.cs | 58 + .../compatible/SDL_DollarGestureEventTests.cs | 50 + .../codegen/compatible/SDL_DropEventTests.cs | 58 + .../codegen/compatible/SDL_EventTests.cs | 50 + .../codegen/compatible/SDL_FPointTests.cs | 50 + .../codegen/compatible/SDL_FRectTests.cs | 50 + .../codegen/compatible/SDL_GUIDTests.cs | 50 + .../compatible/SDL_JoyAxisEventTests.cs | 50 + .../compatible/SDL_JoyBallEventTests.cs | 50 + .../compatible/SDL_JoyBatteryEventTests.cs | 50 + .../compatible/SDL_JoyButtonEventTests.cs | 50 + .../compatible/SDL_JoyDeviceEventTests.cs | 50 + .../compatible/SDL_JoyHatEventTests.cs | 50 + .../compatible/SDL_KeyboardEventTests.cs | 50 + .../codegen/compatible/SDL_KeysymTests.cs | 50 + .../compatible/SDL_MouseButtonEventTests.cs | 50 + .../compatible/SDL_MouseMotionEventTests.cs | 50 + .../compatible/SDL_MouseWheelEventTests.cs | 50 + .../compatible/SDL_MultiGestureEventTests.cs | 50 + .../codegen/compatible/SDL_OSEventTests.cs | 50 + .../codegen/compatible/SDL_PaletteTests.cs | 58 + .../compatible/SDL_PixelFormatTests.cs | 58 + .../codegen/compatible/SDL_PointTests.cs | 50 + .../codegen/compatible/SDL_QuitEventTests.cs | 50 + .../codegen/compatible/SDL_RWopsTests.cs | 58 + .../codegen/compatible/SDL_RectTests.cs | 50 + .../compatible/SDL_RendererInfoTests.cs | 58 + .../codegen/compatible/SDL_RendererTests.cs | 50 + .../compatible/SDL_SensorEventTests.cs | 50 + .../codegen/compatible/SDL_SurfaceTests.cs | 58 + .../codegen/compatible/SDL_SysWMEventTests.cs | 58 + .../codegen/compatible/SDL_SysWMmsgTests.cs | 50 + .../compatible/SDL_TextEditingEventTests.cs | 50 + .../SDL_TextEditingExtEventTests.cs | 58 + .../compatible/SDL_TextInputEventTests.cs | 50 + .../codegen/compatible/SDL_TextureTests.cs | 50 + .../compatible/SDL_TouchFingerEventTests.cs | 50 + .../codegen/compatible/SDL_UserEventTests.cs | 58 + .../codegen/compatible/SDL_VertexTests.cs | 50 + .../SDL_VirtualJoystickDescTests.cs | 58 + .../compatible/SDL_WindowEventTests.cs | 50 + .../codegen/compatible/SDL_WindowTests.cs | 50 + .../codegen/compatible/SDL_versionTests.cs | 50 + .../compatible/_SDL_AudioStreamTests.cs | 50 + .../codegen/compatible/_SDL_JoystickTests.cs | 50 + .../codegen/compatible/_SDL_iconv_tTests.cs | 50 + .../codegen/compatible/_TTF_FontTests.cs | 50 + .../codegen/default/ID3D11DeviceTests.cs | 50 + .../codegen/default/ID3D12DeviceTests.cs | 50 + .../codegen/default/IDirect3DDevice9Tests.cs | 50 + .../codegen/default/IMG_AnimationTests.cs | 58 + .../codegen/default/SDL_AudioCVTTests.cs | 58 + .../default/SDL_AudioDeviceEventTests.cs | 50 + .../codegen/default/SDL_AudioSpecTests.cs | 58 + .../codegen/default/SDL_BlitMapTests.cs | 50 + .../codegen/default/SDL_ColorTests.cs | 50 + .../codegen/default/SDL_CommonEventTests.cs | 50 + .../default/SDL_ControllerAxisEventTests.cs | 50 + .../default/SDL_ControllerButtonEventTests.cs | 50 + .../default/SDL_ControllerDeviceEventTests.cs | 50 + .../default/SDL_ControllerSensorEventTests.cs | 50 + .../SDL_ControllerTouchpadEventTests.cs | 50 + .../codegen/default/SDL_CursorTests.cs | 50 + .../codegen/default/SDL_DisplayEventTests.cs | 50 + .../codegen/default/SDL_DisplayModeTests.cs | 58 + .../default/SDL_DollarGestureEventTests.cs | 50 + .../codegen/default/SDL_DropEventTests.cs | 58 + .../codegen/default/SDL_EventTests.cs | 50 + .../codegen/default/SDL_FPointTests.cs | 50 + .../codegen/default/SDL_FRectTests.cs | 50 + .../codegen/default/SDL_GUIDTests.cs | 50 + .../codegen/default/SDL_JoyAxisEventTests.cs | 50 + .../codegen/default/SDL_JoyBallEventTests.cs | 50 + .../default/SDL_JoyBatteryEventTests.cs | 50 + .../default/SDL_JoyButtonEventTests.cs | 50 + .../default/SDL_JoyDeviceEventTests.cs | 50 + .../codegen/default/SDL_JoyHatEventTests.cs | 50 + .../codegen/default/SDL_KeyboardEventTests.cs | 50 + .../codegen/default/SDL_KeysymTests.cs | 50 + .../default/SDL_MouseButtonEventTests.cs | 50 + .../default/SDL_MouseMotionEventTests.cs | 50 + .../default/SDL_MouseWheelEventTests.cs | 50 + .../default/SDL_MultiGestureEventTests.cs | 50 + .../codegen/default/SDL_OSEventTests.cs | 50 + .../codegen/default/SDL_PaletteTests.cs | 58 + .../codegen/default/SDL_PixelFormatTests.cs | 58 + .../codegen/default/SDL_PointTests.cs | 50 + .../codegen/default/SDL_QuitEventTests.cs | 50 + .../codegen/default/SDL_RWopsTests.cs | 58 + .../codegen/default/SDL_RectTests.cs | 50 + .../codegen/default/SDL_RendererInfoTests.cs | 58 + .../codegen/default/SDL_RendererTests.cs | 50 + .../codegen/default/SDL_SensorEventTests.cs | 50 + .../codegen/default/SDL_SurfaceTests.cs | 58 + .../codegen/default/SDL_SysWMEventTests.cs | 58 + .../codegen/default/SDL_SysWMmsgTests.cs | 50 + .../default/SDL_TextEditingEventTests.cs | 50 + .../default/SDL_TextEditingExtEventTests.cs | 58 + .../default/SDL_TextInputEventTests.cs | 50 + .../codegen/default/SDL_TextureTests.cs | 50 + .../default/SDL_TouchFingerEventTests.cs | 50 + .../codegen/default/SDL_UserEventTests.cs | 58 + .../codegen/default/SDL_VertexTests.cs | 50 + .../default/SDL_VirtualJoystickDescTests.cs | 58 + .../codegen/default/SDL_WindowEventTests.cs | 50 + .../codegen/default/SDL_WindowTests.cs | 50 + .../codegen/default/SDL_versionTests.cs | 50 + .../codegen/default/_SDL_AudioStreamTests.cs | 50 + .../codegen/default/_SDL_JoystickTests.cs | 50 + .../codegen/default/_SDL_iconv_tTests.cs | 50 + .../codegen/default/_TTF_FontTests.cs | 50 + .../{ => codegen/latest}/ID3D11DeviceTests.cs | 0 .../{ => codegen/latest}/ID3D12DeviceTests.cs | 0 .../latest}/IDirect3DDevice9Tests.cs | 0 .../latest}/IMG_AnimationTests.cs | 0 .../{ => codegen/latest}/SDL_AudioCVTTests.cs | 0 .../latest}/SDL_AudioDeviceEventTests.cs | 0 .../latest}/SDL_AudioSpecTests.cs | 0 .../{ => codegen/latest}/SDL_BlitMapTests.cs | 0 .../{ => codegen/latest}/SDL_ColorTests.cs | 0 .../latest}/SDL_CommonEventTests.cs | 0 .../latest}/SDL_ControllerAxisEventTests.cs | 0 .../latest}/SDL_ControllerButtonEventTests.cs | 0 .../latest}/SDL_ControllerDeviceEventTests.cs | 0 .../latest}/SDL_ControllerSensorEventTests.cs | 0 .../SDL_ControllerTouchpadEventTests.cs | 0 .../{ => codegen/latest}/SDL_CursorTests.cs | 0 .../latest}/SDL_DisplayEventTests.cs | 0 .../latest}/SDL_DisplayModeTests.cs | 0 .../latest}/SDL_DollarGestureEventTests.cs | 0 .../latest}/SDL_DropEventTests.cs | 0 .../{ => codegen/latest}/SDL_EventTests.cs | 0 .../{ => codegen/latest}/SDL_FPointTests.cs | 0 .../{ => codegen/latest}/SDL_FRectTests.cs | 0 .../{ => codegen/latest}/SDL_GUIDTests.cs | 0 .../latest}/SDL_JoyAxisEventTests.cs | 0 .../latest}/SDL_JoyBallEventTests.cs | 0 .../latest}/SDL_JoyBatteryEventTests.cs | 0 .../latest}/SDL_JoyButtonEventTests.cs | 0 .../latest}/SDL_JoyDeviceEventTests.cs | 0 .../latest}/SDL_JoyHatEventTests.cs | 0 .../latest}/SDL_KeyboardEventTests.cs | 0 .../{ => codegen/latest}/SDL_KeysymTests.cs | 0 .../latest}/SDL_MouseButtonEventTests.cs | 0 .../latest}/SDL_MouseMotionEventTests.cs | 0 .../latest}/SDL_MouseWheelEventTests.cs | 0 .../latest}/SDL_MultiGestureEventTests.cs | 0 .../{ => codegen/latest}/SDL_OSEventTests.cs | 0 .../{ => codegen/latest}/SDL_PaletteTests.cs | 0 .../latest}/SDL_PixelFormatTests.cs | 0 .../{ => codegen/latest}/SDL_PointTests.cs | 0 .../latest}/SDL_QuitEventTests.cs | 0 .../{ => codegen/latest}/SDL_RWopsTests.cs | 0 .../{ => codegen/latest}/SDL_RectTests.cs | 0 .../latest}/SDL_RendererInfoTests.cs | 0 .../{ => codegen/latest}/SDL_RendererTests.cs | 0 .../latest}/SDL_SensorEventTests.cs | 0 .../{ => codegen/latest}/SDL_SurfaceTests.cs | 0 .../latest}/SDL_SysWMEventTests.cs | 0 .../{ => codegen/latest}/SDL_SysWMmsgTests.cs | 0 .../latest}/SDL_TextEditingEventTests.cs | 0 .../latest}/SDL_TextEditingExtEventTests.cs | 0 .../latest}/SDL_TextInputEventTests.cs | 0 .../{ => codegen/latest}/SDL_TextureTests.cs | 0 .../latest}/SDL_TouchFingerEventTests.cs | 0 .../latest}/SDL_UserEventTests.cs | 0 .../{ => codegen/latest}/SDL_VertexTests.cs | 0 .../latest}/SDL_VirtualJoystickDescTests.cs | 0 .../latest}/SDL_WindowEventTests.cs | 0 .../{ => codegen/latest}/SDL_WindowTests.cs | 0 .../{ => codegen/latest}/SDL_versionTests.cs | 0 .../latest}/_SDL_AudioStreamTests.cs | 0 .../latest}/_SDL_JoystickTests.cs | 0 .../{ => codegen/latest}/_SDL_iconv_tTests.cs | 0 .../{ => codegen/latest}/_TTF_FontTests.cs | 0 .../SDL2Sharp.Interop.Tests/xunit.runner.json | 6 + tests/SDL2Sharp.Tests/PackedTextureTests.cs | 16 +- 565 files changed, 22588 insertions(+), 111 deletions(-) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/ID3D11Device.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/ID3D12Device.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/IDirect3DDevice9.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/IMG.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/IMG_Animation.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/IMG_InitFlags.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ArrayOrder.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_AudioCallback.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_AudioDeviceEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_AudioFilter.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_AudioStatus.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_BitmapOrder.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_BlendFactor.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_BlendMode.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_BlendOperation.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_BlitMap.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Color.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_CommonEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ControllerAxisEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ControllerButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ControllerDeviceEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ControllerTouchpadEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Cursor.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DUMMY_ENUM.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DisplayEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DisplayEventID.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DisplayMode.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DisplayOrientation.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DollarGestureEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_DropEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_EventFilter.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_EventType.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_FPoint.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_FRect.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_FlashOperation.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_GLContextResetNotification.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_GLattr.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_GLcontextFlag.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_GLcontextReleaseFlag.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_GLprofile.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_HintCallback.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_HintPriority.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_HitTest.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_HitTestResult.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyAxisEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyBallEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyBatteryEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyDeviceEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoyHatEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoystickPowerLevel.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_JoystickType.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_KeyCode.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_KeyboardEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Keymod.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Keysym.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_LogCategory.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_LogOutputFunction.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_LogPriority.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_MouseButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_MouseMotionEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_MouseWheelDirection.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_MouseWheelEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_MultiGestureEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_OSEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_PackedLayout.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_PackedOrder.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Palette.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_PixelFormatEnum.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_PixelType.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Point.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_QuitEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Rect.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Renderer.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_RendererFlags.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_RendererFlip.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_ScaleMode.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Scancode.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Surface.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_SysWMEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_SysWMmsg.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_SystemCursor.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_TextEditingExtEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Texture.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_TextureAccess.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_TextureModulate.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_TouchFingerEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_UserEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Vertex.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_Window.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_WindowEvent.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_WindowEventID.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_WindowFlags.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_WindowsMessageHook.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_YUV_CONVERSION_MODE.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_blit.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_bool.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_calloc_func.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_errorcode.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_eventaction.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_free_func.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_malloc_func.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_realloc_func.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/SDL_version.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/TTF.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/TTF_Direction.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/_SDL_AudioStream.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/_SDL_Joystick.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/_SDL_iconv_t.cs (100%) rename sources/SDL2Sharp.Interop/{ => codegen/compatible}/_TTF_Font.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/IMG.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs rename sources/SDL2Sharp.Interop/{ => codegen/default}/SDL_AudioCVT.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/default}/SDL_AudioSpec.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/default}/SDL_RWops.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs rename sources/SDL2Sharp.Interop/{ => codegen/default}/SDL_VirtualJoystickDesc.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/TTF.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_ControllerSensorEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_Event.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_GUID.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_PixelFormat.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_RendererInfo.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_SensorEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_TextEditingEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs rename sources/SDL2Sharp.Interop/{ => codegen/latest}/SDL_TextInputEvent.cs (100%) create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/TTF.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs create mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/App.config create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs create mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/ID3D11DeviceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/ID3D12DeviceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/IDirect3DDevice9Tests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/IMG_AnimationTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_AudioCVTTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_AudioDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_AudioSpecTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_BlitMapTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ColorTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_CommonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ControllerAxisEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ControllerButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ControllerDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ControllerSensorEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_ControllerTouchpadEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_CursorTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_DisplayEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_DisplayModeTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_DollarGestureEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_DropEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_EventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_FPointTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_FRectTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_GUIDTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyAxisEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyBallEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyBatteryEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_JoyHatEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_KeyboardEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_KeysymTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_MouseButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_MouseMotionEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_MouseWheelEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_MultiGestureEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_OSEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_PaletteTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_PixelFormatTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_PointTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_QuitEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_RWopsTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_RectTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_RendererInfoTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_RendererTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_SensorEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_SurfaceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_SysWMEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_SysWMmsgTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_TextEditingEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_TextEditingExtEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_TextInputEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_TextureTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_TouchFingerEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_UserEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_VertexTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_VirtualJoystickDescTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_WindowEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_WindowTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/SDL_versionTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/_SDL_AudioStreamTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/_SDL_JoystickTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/_SDL_iconv_tTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/{ => codegen/latest}/_TTF_FontTests.cs (100%) create mode 100644 tests/SDL2Sharp.Interop.Tests/xunit.runner.json diff --git a/Directory.Build.props b/Directory.Build.props index 50e9bc71..c2b03f5a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -70,5 +70,14 @@ $(DefaultItemExcludes);obj\** - + + + net8.0 + net7.0;net6.0 + net481;net48;net472;net471;net47;net462;net461;netstandard2.0 + Latest + Default + Compatible + + \ No newline at end of file diff --git a/build/Build/Build.csproj b/build/Build/Build.csproj index ea468012..6845f046 100644 --- a/build/Build/Build.csproj +++ b/build/Build/Build.csproj @@ -16,7 +16,7 @@ - + diff --git a/build/Build/IBuild.cs b/build/Build/IBuild.cs index b0ef1ffb..46c1bfc7 100644 --- a/build/Build/IBuild.cs +++ b/build/Build/IBuild.cs @@ -94,15 +94,9 @@ private static string GetDefaultArchitecture() } protected IReadOnlyCollection GetTargetFrameworks() - { - return GetTargetFrameworks(_ => true); - } - - protected IReadOnlyCollection GetTargetFrameworks(Func predicate) { var targetFrameworkRegex = GetTargetFrameworkRegex(); return Solution.AllProjects - .Where(predicate) .SelectMany((project) => project.GetTargetFrameworks()) .Distinct() .Order() diff --git a/build/Build/IGenerate.cs b/build/Build/IGenerate.cs index af01bf2b..51d30540 100644 --- a/build/Build/IGenerate.cs +++ b/build/Build/IGenerate.cs @@ -26,6 +26,8 @@ using static System.Runtime.InteropServices.RuntimeInformation; using static Nuke.Common.Tools.ClangSharpPInvokeGenerator.ClangSharpPInvokeGeneratorTasks; using static Nuke.Common.Tools.ClangSharpPInvokeGenerator.ClangSharpPInvokeGeneratorConfigOption; +using Nuke.Common.IO; +using System; interface IGenerate : IBuild { @@ -36,38 +38,30 @@ interface IGenerate : IBuild .Produces(ArtifactsDirectory / "log" / "*.*") .Executes(() => { - GenerateBindingsForSDL2(); - GenerateBindingsForSDL2Image(); - GenerateBindingsForSDL2TTF(); + var codegens = new[] { compatible_codegen, default_codegen, latest_codegen }; + foreach (var codegen in codegens) + { + GenerateBindingsForSDL2(codegen); + GenerateBindingsForSDL2Image(codegen); + GenerateBindingsForSDL2TTF(codegen); + } }); - private void GenerateBindingsForSDL2() + private void GenerateBindingsForSDL2(ClangSharpPInvokeGeneratorConfigOption codegen) { - var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; - var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; - - const string packageId = "SDL2"; - var packageFolder = packageId.ToLower(); - var packageReferenceVersion = Solution.AllProjects - .Where(e => e.Name.Equals("SDL2Sharp.Interop")) - .Select(e => e.GetPackageReferenceVersion(packageId)) - .Single(e => e is not null); - var fileDirectory = GlobalPackagesFolder / packageFolder / packageReferenceVersion / "lib" / "native" / "include"; - ClangSharpPInvokeGenerator(settings => settings .SetConfig ( - latest_codegen, + codegen, generate_aggressive_inlining, generate_macro_bindings, generate_tests_xunit, multi_file ) - .SetHeaderFile(headerFile) + .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(outputDirectory) - .SetTestOutput(testOutputDirectory) + .SetOutput(GetOutput(codegen)) + .SetTestOutput(GetTestOutput(codegen)) .SetWithType ( "SDL_EventType=uint", @@ -328,43 +322,25 @@ private void GenerateBindingsForSDL2() .SetLibraryPath("SDL2") .SetMethodClassName("SDL") .SetPrefixStrip("SDL_") - .SetFileDirectory(fileDirectory) + .SetFileDirectory(GetFileDirectory("SDL2")) ); } - private void GenerateBindingsForSDL2Image() + private void GenerateBindingsForSDL2Image(ClangSharpPInvokeGeneratorConfigOption codegen) { - var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; - var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; - - const string basePackageId = "SDL2"; - var basePackageFolder = basePackageId.ToLower(); - var basePackageReferenceVersion = Solution.AllProjects - .Where(e => e.Name.Equals("SDL2Sharp.Interop")) - .Select(e => e.GetPackageReferenceVersion(basePackageId)) - .Single(e => e is not null); - var includeDirectory = GlobalPackagesFolder / basePackageFolder / basePackageReferenceVersion / "lib" / "native" / "include"; - - const string packageId = "SDL2_image"; - var packageFolder = packageId.ToLower(); - var packageReferenceVersion = Solution.AllProjects - .Select(e => e.GetPackageReferenceVersion(packageId)) - .Single(e => e is not null); - var fileDirectory = GlobalPackagesFolder / packageFolder / packageReferenceVersion / "lib" / "native" / "include"; - ClangSharpPInvokeGenerator(settings => settings .SetConfig ( - compatible_codegen, + codegen, generate_aggressive_inlining, generate_macro_bindings, - generate_tests_xunit, multi_file + generate_tests_xunit, + multi_file ) - .SetHeaderFile(headerFile) + .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(outputDirectory) - .SetTestOutput(testOutputDirectory) + .SetOutput(GetOutput(codegen)) + .SetTestOutput(GetTestOutput(codegen)) .SetWithType ( "SDL_EventType=uint", @@ -382,44 +358,25 @@ private void GenerateBindingsForSDL2Image() .SetLibraryPath("SDL2_image") .SetMethodClassName("IMG") .SetPrefixStrip("IMG_") - .SetFileDirectory(fileDirectory) - .SetIncludeDirectory(includeDirectory) + .SetFileDirectory(GetFileDirectory("SDL2_image")) + .SetIncludeDirectory(GetIncludeDirectory("SDL2")) ); } - private void GenerateBindingsForSDL2TTF() + private void GenerateBindingsForSDL2TTF(ClangSharpPInvokeGeneratorConfigOption codegen) { - var headerFile = RootDirectory / "build" / "Build" / "Header.txt"; - var outputDirectory = RootDirectory / "sources" / "SDL2Sharp.Interop"; - var testOutputDirectory = RootDirectory / "tests" / "SDL2Sharp.Interop.Tests"; - - const string basePackageId = "SDL2"; - var basePackageFolder = basePackageId.ToLower(); - var basePackageReferenceVersion = Solution.AllProjects - .Where(e => e.Name.Equals("SDL2Sharp.Interop")) - .Select(e => e.GetPackageReferenceVersion(basePackageId)) - .Single(e => e is not null); - var includeDirectory = GlobalPackagesFolder / basePackageFolder / basePackageReferenceVersion / "lib" / "native" / "include"; - - const string packageId = "SDL2_ttf"; - var packageFolder = packageId.ToLower(); - var packageReferenceVersion = Solution.AllProjects - .Select(e => e.GetPackageReferenceVersion(packageId)) - .Single(e => e is not null); - var fileDirectory = GlobalPackagesFolder / packageFolder / packageReferenceVersion / "lib" / "native" / "include"; - ClangSharpPInvokeGenerator(settings => settings .SetConfig ( - compatible_codegen, + codegen, generate_aggressive_inlining, generate_macro_bindings, generate_tests_xunit, multi_file ) - .SetHeaderFile(headerFile) + .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(outputDirectory) - .SetTestOutput(testOutputDirectory) + .SetOutput(GetOutput(codegen)) + .SetTestOutput(GetTestOutput(codegen)) .SetWithType ( "SDL_EventType=uint", @@ -441,8 +398,57 @@ private void GenerateBindingsForSDL2TTF() .SetLibraryPath("SDL2_ttf") .SetMethodClassName("TTF") .SetPrefixStrip("TTF_") - .SetFileDirectory(fileDirectory) - .SetIncludeDirectory(includeDirectory) + .SetFileDirectory(GetFileDirectory("SDL2_ttf")) + .SetIncludeDirectory(GetIncludeDirectory("SDL2")) ); } + + private AbsolutePath GetOutput(ClangSharpPInvokeGeneratorConfigOption codegen) + { + if (codegen == compatible_codegen) + { + return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "compatible"; + } + if (codegen == default_codegen) + { + return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "default"; + } + if (codegen == latest_codegen) + { + return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "latest"; + } + + throw new NotSupportedException("The specified option is not supported."); + } + + private AbsolutePath GetTestOutput(ClangSharpPInvokeGeneratorConfigOption codegen) + { + if (codegen == compatible_codegen) + { + return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "compatible"; + } + if (codegen == default_codegen) + { + return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "default"; + } + if (codegen == latest_codegen) + { + return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "latest"; + } + + throw new NotSupportedException("The specified option is not supported."); + } + + private AbsolutePath GetFileDirectory(string packageId) => GetIncludeDirectory(packageId); + + private AbsolutePath GetIncludeDirectory(string packageId) + { + var packageFolder = packageId.ToLower(); + var packageReferenceVersion = Solution.AllProjects + .Where(e => e.Name.Equals("SDL2Sharp.Interop")) + .Select(e => e.GetPackageReferenceVersion(packageId)) + .Single(e => e is not null); + var fileDirectory = GlobalPackagesFolder / packageFolder / packageReferenceVersion / "lib" / "native" / "include"; + return fileDirectory; + } } diff --git a/build/Build/ITest.cs b/build/Build/ITest.cs index fee426c7..65e0d82b 100644 --- a/build/Build/ITest.cs +++ b/build/Build/ITest.cs @@ -18,7 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System.Linq; using Nuke.Common; +using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; @@ -31,17 +33,20 @@ interface ITest : IBuild .Produces(ArtifactsDirectory / "tst" / "*.*", ArtifactsDirectory / "log" / "*.*") .Executes(() => { - foreach (var targetFramework in GetTargetFrameworks(project => project.Name.EndsWith(".Tests"))) + foreach (var project in Solution.AllProjects.Where(e => e.Name.EndsWith(".Tests"))) { - DotNetTest(settings => settings - .SetProjectFile(Solution) - .SetConfiguration(Configuration) - .SetNoRestore(true) - .SetNoBuild(true) - .SetVerbosity(Verbosity.ToDotNetVerbosity()) - .SetFramework(targetFramework) - .SetProcessArgumentConfigurator(_ => _.Add("-- RunConfiguration.DisableAppDomain=true")) - ); + foreach (var targetFramework in project.GetTargetFrameworks()) + { + DotNetTest(settings => settings + .SetProjectFile(project) + .SetConfiguration(Configuration) + .SetNoRestore(true) + .SetNoBuild(true) + .SetVerbosity(Verbosity.ToDotNetVerbosity()) + .SetFramework(targetFramework) + .SetProcessArgumentConfigurator(_ => _.Add("-- RunConfiguration.DisableAppDomain=true")) + ); + } } }); } diff --git a/sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs b/sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs index 5130ec35..54f08b5b 100644 --- a/sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs +++ b/sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,10 +22,12 @@ namespace SDL2Sharp.Interop { public static unsafe partial class IMG { +#if NET8_0_OR_GREATER [NativeTypeName("#define IMG_SetError SDL_SetError")] public static int SetError(sbyte* fmt) => SDL.SetError(fmt, __arglist()); [NativeTypeName("#define IMG_GetError SDL_GetError")] public static sbyte* GetError() => SDL.GetError(); +#endif } } diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs b/sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs index db157c13..3b922079 100644 --- a/sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs +++ b/sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs @@ -22,6 +22,8 @@ namespace SDL2Sharp.Interop { public static unsafe partial class SDL { +#if NET8_0_OR_GREATER public static readonly delegate* Blit = &UpperBlit; +#endif } } diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs b/sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs index 10cd4062..5410632b 100644 --- a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs +++ b/sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs @@ -22,7 +22,9 @@ namespace SDL2Sharp.Interop { public static unsafe partial class SDL { +#if NET8_0_OR_GREATER [NativeTypeName("#define SDL_BlitScaled SDL_UpperBlitScaled")] public static readonly delegate* BlitScaled = &UpperBlitScaled; +#endif } } diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs b/sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs index 60767285..673e5c70 100644 --- a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs +++ b/sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs @@ -22,7 +22,9 @@ namespace SDL2Sharp.Interop { public static unsafe partial class SDL { +#if NET8_0_OR_GREATER [NativeTypeName("#define SDL_BlitSurface SDL_UpperBlit")] public static readonly delegate* BlitSurface = &UpperBlit; +#endif } } diff --git a/sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs b/sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs index 6bc77fc3..eac64778 100644 --- a/sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs +++ b/sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -22,10 +22,12 @@ namespace SDL2Sharp.Interop { public static unsafe partial class TTF { +#if NET8_0_OR_GREATER [NativeTypeName("#define IMG_SetError SDL_SetError")] public static int SetError(sbyte* fmt) => SDL.SetError(fmt, __arglist()); [NativeTypeName("#define IMG_GetError SDL_GetError")] public static sbyte* GetError() => SDL.GetError(); +#endif } } diff --git a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj index 4bb1cb40..af650f66 100644 --- a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj +++ b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj @@ -1,12 +1,44 @@  - net8.0 + net8.0;net6.0;net461;netstandard2.0 AnyCPU Provides SDL2 bindings written in C#. SDL2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/SDL2Sharp.Interop/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/compatible/ID3D11Device.cs similarity index 100% rename from sources/SDL2Sharp.Interop/ID3D11Device.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/ID3D11Device.cs diff --git a/sources/SDL2Sharp.Interop/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/compatible/ID3D12Device.cs similarity index 100% rename from sources/SDL2Sharp.Interop/ID3D12Device.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/ID3D12Device.cs diff --git a/sources/SDL2Sharp.Interop/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/compatible/IDirect3DDevice9.cs similarity index 100% rename from sources/SDL2Sharp.Interop/IDirect3DDevice9.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/IDirect3DDevice9.cs diff --git a/sources/SDL2Sharp.Interop/IMG.cs b/sources/SDL2Sharp.Interop/codegen/compatible/IMG.cs similarity index 100% rename from sources/SDL2Sharp.Interop/IMG.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/IMG.cs diff --git a/sources/SDL2Sharp.Interop/IMG_Animation.cs b/sources/SDL2Sharp.Interop/codegen/compatible/IMG_Animation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/IMG_Animation.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/IMG_Animation.cs diff --git a/sources/SDL2Sharp.Interop/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/compatible/IMG_InitFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/IMG_InitFlags.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/IMG_InitFlags.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs new file mode 100644 index 00000000..ffe9f358 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs @@ -0,0 +1,2387 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class SDL + { + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)] + public static extern int Init([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_InitSubSystem", ExactSpelling = true)] + public static extern int InitSubSystem([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QuitSubSystem", ExactSpelling = true)] + public static extern void QuitSubSystem([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WasInit", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint WasInit([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")] + public const uint SDL_INIT_TIMER = 0x00000001U; + + [NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")] + public const uint SDL_INIT_AUDIO = 0x00000010U; + + [NativeTypeName("#define SDL_INIT_VIDEO 0x00000020u")] + public const uint SDL_INIT_VIDEO = 0x00000020U; + + [NativeTypeName("#define SDL_INIT_JOYSTICK 0x00000200u")] + public const uint SDL_INIT_JOYSTICK = 0x00000200U; + + [NativeTypeName("#define SDL_INIT_HAPTIC 0x00001000u")] + public const uint SDL_INIT_HAPTIC = 0x00001000U; + + [NativeTypeName("#define SDL_INIT_GAMECONTROLLER 0x00002000u")] + public const uint SDL_INIT_GAMECONTROLLER = 0x00002000U; + + [NativeTypeName("#define SDL_INIT_EVENTS 0x00004000u")] + public const uint SDL_INIT_EVENTS = 0x00004000U; + + [NativeTypeName("#define SDL_INIT_SENSOR 0x00008000u")] + public const uint SDL_INIT_SENSOR = 0x00008000U; + + [NativeTypeName("#define SDL_INIT_NOPARACHUTE 0x00100000u")] + public const uint SDL_INIT_NOPARACHUTE = 0x00100000U; + + [NativeTypeName("#define SDL_INIT_EVERYTHING ( \\\r\n SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \\\r\n SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \\\r\n )")] + public const uint SDL_INIT_EVERYTHING = (0x00000001U | 0x00000010U | 0x00000020U | 0x00004000U | 0x00000200U | 0x00001000U | 0x00002000U | 0x00008000U); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDrivers", ExactSpelling = true)] + public static extern int GetNumAudioDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetAudioDriver(int index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioInit", ExactSpelling = true)] + public static extern int AudioInit([NativeTypeName("const char *")] sbyte* driver_name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioQuit", ExactSpelling = true)] + public static extern void AudioQuit(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentAudioDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetCurrentAudioDriver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudio", ExactSpelling = true)] + public static extern int OpenAudio(SDL_AudioSpec* desired, SDL_AudioSpec* obtained); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDevices", ExactSpelling = true)] + public static extern int GetNumAudioDevices(int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetAudioDeviceName(int index, int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceSpec", ExactSpelling = true)] + public static extern int GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec* spec); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultAudioInfo", ExactSpelling = true)] + public static extern int GetDefaultAudioInfo([NativeTypeName("char **")] sbyte** name, SDL_AudioSpec* spec, int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudioDevice", ExactSpelling = true)] + [return: NativeTypeName("SDL_AudioDeviceID")] + public static extern uint OpenAudioDevice([NativeTypeName("const char *")] sbyte* device, int iscapture, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* desired, SDL_AudioSpec* obtained, int allowed_changes); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioStatus", ExactSpelling = true)] + public static extern SDL_AudioStatus GetAudioStatus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceStatus", ExactSpelling = true)] + public static extern SDL_AudioStatus GetAudioDeviceStatus([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudio", ExactSpelling = true)] + public static extern void PauseAudio(int pause_on); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudioDevice", ExactSpelling = true)] + public static extern void PauseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev, int pause_on); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadWAV_RW", ExactSpelling = true)] + public static extern SDL_AudioSpec* LoadWAV_RW(SDL_RWops* src, int freesrc, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeWAV", ExactSpelling = true)] + public static extern void FreeWAV([NativeTypeName("Uint8 *")] byte* audio_buf); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_BuildAudioCVT", ExactSpelling = true)] + public static extern int BuildAudioCVT(SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort src_format, [NativeTypeName("Uint8")] byte src_channels, int src_rate, [NativeTypeName("SDL_AudioFormat")] ushort dst_format, [NativeTypeName("Uint8")] byte dst_channels, int dst_rate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertAudio", ExactSpelling = true)] + public static extern int ConvertAudio(SDL_AudioCVT* cvt); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NewAudioStream", ExactSpelling = true)] + [return: NativeTypeName("SDL_AudioStream *")] + public static extern _SDL_AudioStream* NewAudioStream([NativeTypeName("const SDL_AudioFormat")] ushort src_format, [NativeTypeName("const Uint8")] byte src_channels, [NativeTypeName("const int")] int src_rate, [NativeTypeName("const SDL_AudioFormat")] ushort dst_format, [NativeTypeName("const Uint8")] byte dst_channels, [NativeTypeName("const int")] int dst_rate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamPut", ExactSpelling = true)] + public static extern int AudioStreamPut([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, [NativeTypeName("const void *")] void* buf, int len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamGet", ExactSpelling = true)] + public static extern int AudioStreamGet([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, void* buf, int len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamAvailable", ExactSpelling = true)] + public static extern int AudioStreamAvailable([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamFlush", ExactSpelling = true)] + public static extern int AudioStreamFlush([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamClear", ExactSpelling = true)] + public static extern void AudioStreamClear([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeAudioStream", ExactSpelling = true)] + public static extern void FreeAudioStream([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudio", ExactSpelling = true)] + public static extern void MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("Uint32")] uint len, int volume); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudioFormat", ExactSpelling = true)] + public static extern void MixAudioFormat([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("SDL_AudioFormat")] ushort format, [NativeTypeName("Uint32")] uint len, int volume); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueueAudio", ExactSpelling = true)] + public static extern int QueueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, [NativeTypeName("const void *")] void* data, [NativeTypeName("Uint32")] uint len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DequeueAudio", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint DequeueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, void* data, [NativeTypeName("Uint32")] uint len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetQueuedAudioSize", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetQueuedAudioSize([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearQueuedAudio", ExactSpelling = true)] + public static extern void ClearQueuedAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudio", ExactSpelling = true)] + public static extern void LockAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudioDevice", ExactSpelling = true)] + public static extern void LockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudio", ExactSpelling = true)] + public static extern void UnlockAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudioDevice", ExactSpelling = true)] + public static extern void UnlockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudio", ExactSpelling = true)] + public static extern void CloseAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudioDevice", ExactSpelling = true)] + public static extern void CloseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFF)")] + public const int SDL_AUDIO_MASK_BITSIZE = (0xFF); + + [NativeTypeName("#define SDL_AUDIO_MASK_DATATYPE (1<<8)")] + public const int SDL_AUDIO_MASK_DATATYPE = (1 << 8); + + [NativeTypeName("#define SDL_AUDIO_MASK_ENDIAN (1<<12)")] + public const int SDL_AUDIO_MASK_ENDIAN = (1 << 12); + + [NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1<<15)")] + public const int SDL_AUDIO_MASK_SIGNED = (1 << 15); + + [NativeTypeName("#define AUDIO_U8 0x0008")] + public const int AUDIO_U8 = 0x0008; + + [NativeTypeName("#define AUDIO_S8 0x8008")] + public const int AUDIO_S8 = 0x8008; + + [NativeTypeName("#define AUDIO_U16LSB 0x0010")] + public const int AUDIO_U16LSB = 0x0010; + + [NativeTypeName("#define AUDIO_S16LSB 0x8010")] + public const int AUDIO_S16LSB = 0x8010; + + [NativeTypeName("#define AUDIO_U16MSB 0x1010")] + public const int AUDIO_U16MSB = 0x1010; + + [NativeTypeName("#define AUDIO_S16MSB 0x9010")] + public const int AUDIO_S16MSB = 0x9010; + + [NativeTypeName("#define AUDIO_U16 AUDIO_U16LSB")] + public const int AUDIO_U16 = 0x0010; + + [NativeTypeName("#define AUDIO_S16 AUDIO_S16LSB")] + public const int AUDIO_S16 = 0x8010; + + [NativeTypeName("#define AUDIO_S32LSB 0x8020")] + public const int AUDIO_S32LSB = 0x8020; + + [NativeTypeName("#define AUDIO_S32MSB 0x9020")] + public const int AUDIO_S32MSB = 0x9020; + + [NativeTypeName("#define AUDIO_S32 AUDIO_S32LSB")] + public const int AUDIO_S32 = 0x8020; + + [NativeTypeName("#define AUDIO_F32LSB 0x8120")] + public const int AUDIO_F32LSB = 0x8120; + + [NativeTypeName("#define AUDIO_F32MSB 0x9120")] + public const int AUDIO_F32MSB = 0x9120; + + [NativeTypeName("#define AUDIO_F32 AUDIO_F32LSB")] + public const int AUDIO_F32 = 0x8120; + + [NativeTypeName("#define AUDIO_U16SYS AUDIO_U16LSB")] + public const int AUDIO_U16SYS = 0x0010; + + [NativeTypeName("#define AUDIO_S16SYS AUDIO_S16LSB")] + public const int AUDIO_S16SYS = 0x8010; + + [NativeTypeName("#define AUDIO_S32SYS AUDIO_S32LSB")] + public const int AUDIO_S32SYS = 0x8020; + + [NativeTypeName("#define AUDIO_F32SYS AUDIO_F32LSB")] + public const int AUDIO_F32SYS = 0x8120; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001")] + public const int SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002")] + public const int SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004")] + public const int SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008")] + public const int SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)")] + public const int SDL_AUDIO_ALLOW_ANY_CHANGE = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008); + + [NativeTypeName("#define SDL_AUDIOCVT_MAX_FILTERS 9")] + public const int SDL_AUDIOCVT_MAX_FILTERS = 9; + + [NativeTypeName("#define SDL_MIX_MAXVOLUME 128")] + public const int SDL_MIX_MAXVOLUME = 128; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ComposeCustomBlendMode", ExactSpelling = true)] + public static extern SDL_BlendMode ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetError", ExactSpelling = true)] + public static extern int SetError([NativeTypeName("const char *")] sbyte* fmt, __arglist); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetError(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetErrorMsg", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* GetErrorMsg([NativeTypeName("char *")] sbyte* errstr, int maxlen); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearError", ExactSpelling = true)] + public static extern void ClearError(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Error", ExactSpelling = true)] + public static extern int Error(SDL_errorcode code); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PumpEvents", ExactSpelling = true)] + public static extern void PumpEvents(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PeepEvents", ExactSpelling = true)] + public static extern int PeepEvents(SDL_Event* events, int numevents, SDL_eventaction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvent", ExactSpelling = true)] + public static extern SDL_bool HasEvent([NativeTypeName("Uint32")] uint type); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvents", ExactSpelling = true)] + public static extern SDL_bool HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvent", ExactSpelling = true)] + public static extern void FlushEvent([NativeTypeName("Uint32")] uint type); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvents", ExactSpelling = true)] + public static extern void FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PollEvent", ExactSpelling = true)] + public static extern int PollEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEvent", ExactSpelling = true)] + public static extern int WaitEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEventTimeout", ExactSpelling = true)] + public static extern int WaitEventTimeout(SDL_Event* @event, int timeout); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PushEvent", ExactSpelling = true)] + public static extern int PushEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetEventFilter", ExactSpelling = true)] + public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEventFilter", ExactSpelling = true)] + public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] IntPtr* filter, void** userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddEventWatch", ExactSpelling = true)] + public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelEventWatch", ExactSpelling = true)] + public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FilterEvents", ExactSpelling = true)] + public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EventState", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte EventState([NativeTypeName("Uint32")] uint type, int state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RegisterEvents", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint RegisterEvents(int numevents); + + [NativeTypeName("#define SDL_RELEASED 0")] + public const int SDL_RELEASED = 0; + + [NativeTypeName("#define SDL_PRESSED 1")] + public const int SDL_PRESSED = 1; + + [NativeTypeName("#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)")] + public const int SDL_TEXTEDITINGEVENT_TEXT_SIZE = (32); + + [NativeTypeName("#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)")] + public const int SDL_TEXTINPUTEVENT_TEXT_SIZE = (32); + + [NativeTypeName("#define SDL_QUERY -1")] + public const int SDL_QUERY = -1; + + [NativeTypeName("#define SDL_IGNORE 0")] + public const int SDL_IGNORE = 0; + + [NativeTypeName("#define SDL_DISABLE 0")] + public const int SDL_DISABLE = 0; + + [NativeTypeName("#define SDL_ENABLE 1")] + public const int SDL_ENABLE = 1; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDToString", ExactSpelling = true)] + public static extern void GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDFromString", ExactSpelling = true)] + public static extern SDL_GUID GUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHintWithPriority", ExactSpelling = true)] + public static extern SDL_bool SetHintWithPriority([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value, SDL_HintPriority priority); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)] + public static extern SDL_bool SetHint([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHint", ExactSpelling = true)] + public static extern SDL_bool ResetHint([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHints", ExactSpelling = true)] + public static extern void ResetHints(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHint", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetHint([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHintBoolean", ExactSpelling = true)] + public static extern SDL_bool GetHintBoolean([NativeTypeName("const char *")] sbyte* name, SDL_bool default_value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddHintCallback", ExactSpelling = true)] + public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelHintCallback", ExactSpelling = true)] + public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearHints", ExactSpelling = true)] + public static extern void ClearHints(); + + [NativeTypeName("#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"SDL_ACCELEROMETER_AS_JOYSTICK\"")] + public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x4F, 0x4D, 0x45, 0x54, 0x45, 0x52, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] + public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x54, 0x41, 0x42, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x42, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ALLOW_TOPMOST \"SDL_ALLOW_TOPMOST\"")] + public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x4F, 0x50, 0x4D, 0x4F, 0x53, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x4D, 0x41, 0x49, 0x4E, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x54, 0x52, 0x41, 0x50, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APP_NAME \"SDL_APP_NAME\"")] + public static ReadOnlySpan SDL_HINT_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS \"SDL_APPLE_TV_CONTROLLER_UI_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x49, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION \"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION\"")] + public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x52, 0x4F, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4F, 0x52, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"SDL_AUDIO_DEVICE_APP_NAME\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"SDL_AUDIO_DEVICE_STREAM_NAME\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x52, 0x4F, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_RESAMPLING_MODE \"SDL_AUDIO_RESAMPLING_MODE\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x52, 0x45, 0x53, 0x41, 0x4D, 0x50, 0x4C, 0x49, 0x4E, 0x47, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_JOYSTICKS \"SDL_AUTO_UPDATE_JOYSTICKS\"")] + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_SENSORS \"SDL_AUTO_UPDATE_SENSORS\"")] + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x53, 0x45, 0x4E, 0x53, 0x4F, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT \"SDL_BMP_SAVE_LEGACY_FORMAT\"")] + public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x42, 0x4D, 0x50, 0x5F, 0x53, 0x41, 0x56, 0x45, 0x5F, 0x4C, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] + public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x4C, 0x41, 0x59, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x4F, 0x55, 0x4E, 0x44, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x49, 0x46, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x5F, 0x45, 0x4C, 0x45, 0x4D, 0x45, 0x4E, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] + public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ENABLE_STEAM_CONTROLLERS \"SDL_ENABLE_STEAM_CONTROLLERS\"")] + public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EVENT_LOGGING \"SDL_EVENT_LOGGING\"")] + public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x5F, 0x4C, 0x4F, 0x47, 0x47, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_FORCE_RAISEWINDOW \"SDL_HINT_FORCE_RAISEWINDOW\"")] + public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x41, 0x49, 0x53, 0x45, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x00 }; + + [NativeTypeName("#define SDL_HINT_FRAMEBUFFER_ACCELERATION \"SDL_FRAMEBUFFER_ACCELERATION\"")] + public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG \"SDL_GAMECONTROLLERCONFIG\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"SDL_GAMECONTROLLERCONFIG_FILE\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERTYPE \"SDL_GAMECONTROLLERTYPE\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x54, 0x59, 0x50, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES \"SDL_GAMECONTROLLER_IGNORE_DEVICES\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT \"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x5F, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"SDL_GAMECONTROLLER_USE_BUTTON_LABELS\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GRAB_KEYBOARD \"SDL_GRAB_KEYBOARD\"")] + public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")] + public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IDLE_TIMER_DISABLED \"SDL_IOS_IDLE_TIMER_DISABLED\"")] + public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x49, 0x44, 0x4C, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")] + public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")] + public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x5F, 0x55, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"SDL_IME_SUPPORT_EXTENDED_TEXT\"")] + public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x55, 0x50, 0x50, 0x4F, 0x52, 0x54, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")] + public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x49, 0x43, 0x41, 0x54, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS \"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI \"SDL_JOYSTICK_HIDAPI\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"SDL_JOYSTICK_HIDAPI_GAMECUBE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE \"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x52, 0x41, 0x4B, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS \"SDL_JOYSTICK_HIDAPI_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS \"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x43, 0x4F, 0x4D, 0x42, 0x49, 0x4E, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x56, 0x45, 0x52, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LUNA \"SDL_JOYSTICK_HIDAPI_LUNA\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4C, 0x55, 0x4E, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC \"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4E, 0x49, 0x4E, 0x54, 0x45, 0x4E, 0x44, 0x4F, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x48, 0x49, 0x45, 0x4C, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS3 \"SDL_JOYSTICK_HIDAPI_PS3\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x33, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4 \"SDL_JOYSTICK_HIDAPI_PS4\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STADIA \"SDL_JOYSTICK_HIDAPI_STADIA\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x41, 0x44, 0x49, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED \"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x43, 0x4F, 0x4E, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII \"SDL_JOYSTICK_HIDAPI_WII\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX \"SDL_JOYSTICK_HIDAPI_XBOX\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 \"SDL_JOYSTICK_HIDAPI_XBOX_360\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS \"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x57, 0x49, 0x52, 0x45, 0x4C, 0x45, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE \"SDL_JOYSTICK_HIDAPI_XBOX_ONE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT \"SDL_JOYSTICK_RAWINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x43, 0x4F, 0x52, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"SDL_JOYSTICK_ROG_CHAKRAM\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x4F, 0x47, 0x5F, 0x43, 0x48, 0x41, 0x4B, 0x52, 0x41, 0x4D, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_THREAD \"SDL_JOYSTICK_THREAD\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] + public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5F, 0x44, 0x52, 0x4D, 0x5F, 0x4D, 0x41, 0x53, 0x54, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_DIGITAL_HATS \"SDL_LINUX_DIGITAL_HATS\"")] + public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_HAT_DEADZONES \"SDL_LINUX_HAT_DEADZONES\"")] + public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x48, 0x41, 0x54, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"SDL_LINUX_JOYSTICK_CLASSIC\"")] + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"SDL_LINUX_JOYSTICK_DEADZONES\"")] + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_BACKGROUND_APP \"SDL_MAC_BACKGROUND_APP\"")] + public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x41, 0x50, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")] + public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x43, 0x54, 0x52, 0x4C, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x52, 0x49, 0x47, 0x48, 0x54, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")] + public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x41, 0x54, 0x43, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"SDL_MOUSE_DOUBLE_CLICK_RADIUS\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x44, 0x49, 0x55, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH \"SDL_MOUSE_FOCUS_CLICKTHROUGH\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x54, 0x48, 0x52, 0x4F, 0x55, 0x47, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"SDL_MOUSE_NORMAL_SPEED_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x4E, 0x4F, 0x52, 0x4D, 0x41, 0x4C, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x43, 0x45, 0x4E, 0x54, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SCALING \"SDL_MOUSE_RELATIVE_SCALING\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE \"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x5F, 0x4D, 0x4F, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_AUTO_CAPTURE \"SDL_MOUSE_AUTO_CAPTURE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_NO_SIGNAL_HANDLERS \"SDL_NO_SIGNAL_HANDLERS\"")] + public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4E, 0x4F, 0x5F, 0x53, 0x49, 0x47, 0x4E, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x45, 0x53, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_IOS_ORIENTATIONS\"")] + public static ReadOnlySpan SDL_HINT_ORIENTATIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] + public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x4F, 0x4C, 0x4C, 0x5F, 0x53, 0x45, 0x4E, 0x54, 0x49, 0x4E, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_PREFERRED_LOCALES \"SDL_PREFERRED_LOCALES\"")] + public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x52, 0x45, 0x44, 0x5F, 0x4C, 0x4F, 0x43, 0x41, 0x4C, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION \"SDL_QTWAYLAND_CONTENT_ORIENTATION\"")] + public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x4E, 0x54, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS \"SDL_QTWAYLAND_WINDOW_FLAGS\"")] + public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x4C, 0x41, 0x47, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_BATCHING \"SDL_RENDER_BATCHING\"")] + public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x42, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_LINE_METHOD \"SDL_RENDER_LINE_METHOD\"")] + public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x4E, 0x45, 0x5F, 0x4D, 0x45, 0x54, 0x48, 0x4F, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x31, 0x31, 0x5F, 0x44, 0x45, 0x42, 0x55, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"SDL_RENDER_DIRECT3D_THREADSAFE\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x53, 0x41, 0x46, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"SDL_RENDER_LOGICAL_SIZE_MODE\"")] + public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_OPENGL_SHADERS \"SDL_RENDER_OPENGL_SHADERS\"")] + public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_SCALE_QUALITY \"SDL_RENDER_SCALE_QUALITY\"")] + public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x5F, 0x51, 0x55, 0x41, 0x4C, 0x49, 0x54, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_VSYNC \"SDL_RENDER_VSYNC\"")] + public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_PS2_DYNAMIC_VSYNC \"SDL_PS2_DYNAMIC_VSYNC\"")] + public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x53, 0x32, 0x5F, 0x44, 0x59, 0x4E, 0x41, 0x4D, 0x49, 0x43, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RETURN_KEY_HIDES_IME \"SDL_RETURN_KEY_HIDES_IME\"")] + public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x53, 0x5F, 0x49, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] + public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x50, 0x49, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME\"")] + public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x5F, 0x49, 0x4E, 0x48, 0x49, 0x42, 0x49, 0x54, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL\"")] + public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x45, 0x41, 0x4C, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_PRIORITY_POLICY \"SDL_THREAD_PRIORITY_POLICY\"")] + public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x50, 0x52, 0x49, 0x4F, 0x52, 0x49, 0x54, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_STACK_SIZE \"SDL_THREAD_STACK_SIZE\"")] + public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x53, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TIMER_RESOLUTION \"SDL_TIMER_RESOLUTION\"")] + public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x52, 0x45, 0x53, 0x4F, 0x4C, 0x55, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TOUCH_MOUSE_EVENTS \"SDL_TOUCH_MOUSE_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE \"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE\"")] + public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x56, 0x49, 0x54, 0x41, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"SDL_TV_REMOTE_AS_JOYSTICK\"")] + public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x47, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x52, 0x41, 0x4E, 0x53, 0x50, 0x41, 0x52, 0x45, 0x4E, 0x43, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT \"SDL_VIDEO_EXTERNAL_CONTEXT\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x58, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"SDL_VIDEO_HIGHDPI_DISABLED\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x48, 0x49, 0x47, 0x48, 0x44, 0x50, 0x49, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x46, 0x55, 0x4C, 0x4C, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x53, 0x50, 0x41, 0x43, 0x45, 0x53, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x49, 0x4E, 0x49, 0x4D, 0x49, 0x5A, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x4C, 0x4F, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR \"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION \"SDL_VIDEO_WAYLAND_MODE_EMULATION\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP \"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5F, 0x50, 0x49, 0x58, 0x45, 0x4C, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"SDL_VIDEO_FOREIGN_WINDOW_OPENGL\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"SDL_VIDEO_FOREIGN_WINDOW_VULKAN\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x55, 0x4C, 0x4B, 0x41, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x5F, 0x44, 0x33, 0x44, 0x43, 0x4F, 0x4D, 0x50, 0x49, 0x4C, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_FORCE_EGL \"SDL_VIDEO_X11_FORCE_EGL\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x45, 0x47, 0x4C, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x42, 0x59, 0x50, 0x41, 0x53, 0x53, 0x5F, 0x43, 0x4F, 0x4D, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_PING \"SDL_VIDEO_X11_NET_WM_PING\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"SDL_VIDEO_X11_WINDOW_VISUALID\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x49, 0x53, 0x55, 0x41, 0x4C, 0x49, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XINERAMA \"SDL_VIDEO_X11_XINERAMA\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x49, 0x4E, 0x45, 0x52, 0x41, 0x4D, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XRANDR \"SDL_VIDEO_X11_XRANDR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x52, 0x41, 0x4E, 0x44, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XVIDMODE \"SDL_VIDEO_X11_XVIDMODE\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x56, 0x49, 0x44, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_FACT_CHUNK \"SDL_WAVE_FACT_CHUNK\"")] + public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x46, 0x41, 0x43, 0x54, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE \"SDL_WAVE_RIFF_CHUNK_SIZE\"")] + public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x52, 0x49, 0x46, 0x46, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_TRUNCATION \"SDL_WAVE_TRUNCATION\"")] + public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x54, 0x52, 0x55, 0x4E, 0x43, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING \"SDL_WINDOWS_DISABLE_THREAD_NAMING\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x4E, 0x41, 0x4D, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS \"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x4E, 0x55, 0x5F, 0x4D, 0x4E, 0x45, 0x4D, 0x4F, 0x4E, 0x49, 0x43, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x4C, 0x4F, 0x4F, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS \"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4D, 0x55, 0x54, 0x45, 0x58, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x53, 0x45, 0x4D, 0x41, 0x50, 0x48, 0x4F, 0x52, 0x45, 0x5F, 0x4B, 0x45, 0x52, 0x4E, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON \"SDL_WINDOWS_INTRESOURCE_ICON\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"SDL_WINDOWS_INTRESOURCE_ICON_SMALL\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x5F, 0x53, 0x4D, 0x41, 0x4C, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x4E, 0x4F, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x46, 0x34, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x33, 0x44, 0x39, 0x45, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_AWARENESS \"SDL_WINDOWS_DPI_AWARENESS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x41, 0x57, 0x41, 0x52, 0x45, 0x4E, 0x45, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_SCALING \"SDL_WINDOWS_DPI_SCALING\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN\"")] + public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x43, 0x55, 0x52, 0x53, 0x4F, 0x52, 0x5F, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN \"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN\"")] + public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4E, 0x4F, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x5F, 0x57, 0x48, 0x45, 0x4E, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] + public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x55, 0x52, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] + public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x5F, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] + public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_DIRECTINPUT_ENABLED \"SDL_DIRECTINPUT_ENABLED\"")] + public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING\"")] + public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x4F, 0x4C, 0x44, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x4D, 0x41, 0x50, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"SDL_AUDIO_INCLUDE_MONITORS\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x49, 0x4E, 0x43, 0x4C, 0x55, 0x44, 0x45, 0x5F, 0x4D, 0x4F, 0x4E, 0x49, 0x54, 0x4F, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_X11_WINDOW_TYPE \"SDL_X11_WINDOW_TYPE\"")] + public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"SDL_QUIT_ON_LAST_WINDOW_CLOSE\"")] + public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x55, 0x49, 0x54, 0x5F, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x53, 0x54, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEODRIVER \"SDL_VIDEODRIVER\"")] + public static ReadOnlySpan SDL_HINT_VIDEODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIODRIVER \"SDL_AUDIODRIVER\"")] + public static ReadOnlySpan SDL_HINT_AUDIODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")] + public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x45, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY \"SDL_TRACKPAD_IS_TOUCH_ONLY\"")] + public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x52, 0x41, 0x43, 0x4B, 0x50, 0x41, 0x44, 0x5F, 0x49, 0x53, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4F, 0x4E, 0x4C, 0x59, 0x00 }; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockJoysticks", ExactSpelling = true)] + public static extern void LockJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockJoysticks", ExactSpelling = true)] + public static extern void UnlockJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NumJoysticks", ExactSpelling = true)] + public static extern int NumJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNameForIndex", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickNameForIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPathForIndex", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickPathForIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDevicePlayerIndex", ExactSpelling = true)] + public static extern int JoystickGetDevicePlayerIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceGUID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetDeviceGUID(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceVendor", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceVendor(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProduct", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceProduct(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProductVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceProductVersion(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceType", ExactSpelling = true)] + public static extern SDL_JoystickType JoystickGetDeviceType(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickID")] + public static extern int JoystickGetDeviceInstanceID(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickOpen", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickOpen(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickFromInstanceID([NativeTypeName("SDL_JoystickID")] int instance_id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromPlayerIndex", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickFromPlayerIndex(int player_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtual", ExactSpelling = true)] + public static extern int JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtualEx", ExactSpelling = true)] + public static extern int JoystickAttachVirtualEx([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickDetachVirtual", ExactSpelling = true)] + public static extern int JoystickDetachVirtual(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickIsVirtual", ExactSpelling = true)] + public static extern SDL_bool JoystickIsVirtual(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualAxis", ExactSpelling = true)] + public static extern int JoystickSetVirtualAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualButton", ExactSpelling = true)] + public static extern int JoystickSetVirtualButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualHat", ExactSpelling = true)] + public static extern int JoystickSetVirtualHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickName([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPath", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickPath([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetPlayerIndex", ExactSpelling = true)] + public static extern int JoystickGetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetPlayerIndex", ExactSpelling = true)] + public static extern void JoystickSetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int player_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetGUID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetVendor", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetVendor([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProduct", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetProduct([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProductVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetProductVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetFirmwareVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetFirmwareVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetSerial", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickGetSerial([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetType", ExactSpelling = true)] + public static extern SDL_JoystickType JoystickGetType([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDString", ExactSpelling = true)] + public static extern void JoystickGetGUIDString([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDFromString", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetGUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetJoystickGUIDInfo", ExactSpelling = true)] + public static extern void GetJoystickGUIDInfo([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAttached", ExactSpelling = true)] + public static extern SDL_bool JoystickGetAttached([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickID")] + public static extern int JoystickInstanceID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumAxes", ExactSpelling = true)] + public static extern int JoystickNumAxes([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumBalls", ExactSpelling = true)] + public static extern int JoystickNumBalls([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumHats", ExactSpelling = true)] + public static extern int JoystickNumHats([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumButtons", ExactSpelling = true)] + public static extern int JoystickNumButtons([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickUpdate", ExactSpelling = true)] + public static extern void JoystickUpdate(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickEventState", ExactSpelling = true)] + public static extern int JoystickEventState(int state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxis", ExactSpelling = true)] + [return: NativeTypeName("Sint16")] + public static extern short JoystickGetAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxisInitialState", ExactSpelling = true)] + public static extern SDL_bool JoystickGetAxisInitialState([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetHat", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte JoystickGetHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetBall", ExactSpelling = true)] + public static extern int JoystickGetBall([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int ball, int* dx, int* dy); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetButton", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte JoystickGetButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumble", ExactSpelling = true)] + public static extern int JoystickRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumbleTriggers", ExactSpelling = true)] + public static extern int JoystickRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasLED", ExactSpelling = true)] + public static extern SDL_bool JoystickHasLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumble", ExactSpelling = true)] + public static extern SDL_bool JoystickHasRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumbleTriggers", ExactSpelling = true)] + public static extern SDL_bool JoystickHasRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetLED", ExactSpelling = true)] + public static extern int JoystickSetLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSendEffect", ExactSpelling = true)] + public static extern int JoystickSendEffect([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("const void *")] void* data, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickClose", ExactSpelling = true)] + public static extern void JoystickClose([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickCurrentPowerLevel", ExactSpelling = true)] + public static extern SDL_JoystickPowerLevel JoystickCurrentPowerLevel([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [NativeTypeName("#define SDL_IPHONE_MAX_GFORCE 5.0")] + public const double SDL_IPHONE_MAX_GFORCE = 5.0; + + [NativeTypeName("#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1")] + public const int SDL_VIRTUAL_JOYSTICK_DESC_VERSION = 1; + + [NativeTypeName("#define SDL_JOYSTICK_AXIS_MAX 32767")] + public const int SDL_JOYSTICK_AXIS_MAX = 32767; + + [NativeTypeName("#define SDL_JOYSTICK_AXIS_MIN -32768")] + public const int SDL_JOYSTICK_AXIS_MIN = -32768; + + [NativeTypeName("#define SDL_HAT_CENTERED 0x00")] + public const int SDL_HAT_CENTERED = 0x00; + + [NativeTypeName("#define SDL_HAT_UP 0x01")] + public const int SDL_HAT_UP = 0x01; + + [NativeTypeName("#define SDL_HAT_RIGHT 0x02")] + public const int SDL_HAT_RIGHT = 0x02; + + [NativeTypeName("#define SDL_HAT_DOWN 0x04")] + public const int SDL_HAT_DOWN = 0x04; + + [NativeTypeName("#define SDL_HAT_LEFT 0x08")] + public const int SDL_HAT_LEFT = 0x08; + + [NativeTypeName("#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)")] + public const int SDL_HAT_RIGHTUP = (0x02 | 0x01); + + [NativeTypeName("#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)")] + public const int SDL_HAT_RIGHTDOWN = (0x02 | 0x04); + + [NativeTypeName("#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)")] + public const int SDL_HAT_LEFTUP = (0x08 | 0x01); + + [NativeTypeName("#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)")] + public const int SDL_HAT_LEFTDOWN = (0x08 | 0x04); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardFocus", ExactSpelling = true)] + public static extern SDL_Window* GetKeyboardFocus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardState", ExactSpelling = true)] + [return: NativeTypeName("const Uint8 *")] + public static extern byte* GetKeyboardState(int* numkeys); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetKeyboard", ExactSpelling = true)] + public static extern void ResetKeyboard(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetModState", ExactSpelling = true)] + public static extern SDL_Keymod GetModState(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetModState", ExactSpelling = true)] + public static extern void SetModState(SDL_Keymod modstate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromScancode", ExactSpelling = true)] + [return: NativeTypeName("SDL_Keycode")] + public static extern int GetKeyFromScancode(SDL_Scancode scancode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromKey", ExactSpelling = true)] + public static extern SDL_Scancode GetScancodeFromKey([NativeTypeName("SDL_Keycode")] int key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetScancodeName(SDL_Scancode scancode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromName", ExactSpelling = true)] + public static extern SDL_Scancode GetScancodeFromName([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetKeyName([NativeTypeName("SDL_Keycode")] int key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromName", ExactSpelling = true)] + [return: NativeTypeName("SDL_Keycode")] + public static extern int GetKeyFromName([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StartTextInput", ExactSpelling = true)] + public static extern void StartTextInput(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputActive", ExactSpelling = true)] + public static extern SDL_bool IsTextInputActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StopTextInput", ExactSpelling = true)] + public static extern void StopTextInput(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearComposition", ExactSpelling = true)] + public static extern void ClearComposition(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputShown", ExactSpelling = true)] + public static extern SDL_bool IsTextInputShown(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextInputRect", ExactSpelling = true)] + public static extern void SetTextInputRect([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasScreenKeyboardSupport", ExactSpelling = true)] + public static extern SDL_bool HasScreenKeyboardSupport(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenKeyboardShown", ExactSpelling = true)] + public static extern SDL_bool IsScreenKeyboardShown(SDL_Window* window); + + [NativeTypeName("#define SDLK_SCANCODE_MASK (1<<30)")] + public const int SDLK_SCANCODE_MASK = (1 << 30); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseFocus", ExactSpelling = true)] + public static extern SDL_Window* GetMouseFocus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGlobalMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetGlobalMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetRelativeMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseInWindow", ExactSpelling = true)] + public static extern void WarpMouseInWindow(SDL_Window* window, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseGlobal", ExactSpelling = true)] + public static extern int WarpMouseGlobal(int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRelativeMouseMode", ExactSpelling = true)] + public static extern int SetRelativeMouseMode(SDL_bool enabled); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CaptureMouse", ExactSpelling = true)] + public static extern int CaptureMouse(SDL_bool enabled); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseMode", ExactSpelling = true)] + public static extern SDL_bool GetRelativeMouseMode(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateColorCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSystemCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateSystemCursor(SDL_SystemCursor id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetCursor", ExactSpelling = true)] + public static extern void SetCursor(SDL_Cursor* cursor); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCursor", ExactSpelling = true)] + public static extern SDL_Cursor* GetCursor(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultCursor", ExactSpelling = true)] + public static extern SDL_Cursor* GetDefaultCursor(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeCursor", ExactSpelling = true)] + public static extern void FreeCursor(SDL_Cursor* cursor); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowCursor", ExactSpelling = true)] + public static extern int ShowCursor(int toggle); + + [NativeTypeName("#define SDL_BUTTON_LEFT 1")] + public const int SDL_BUTTON_LEFT = 1; + + [NativeTypeName("#define SDL_BUTTON_MIDDLE 2")] + public const int SDL_BUTTON_MIDDLE = 2; + + [NativeTypeName("#define SDL_BUTTON_RIGHT 3")] + public const int SDL_BUTTON_RIGHT = 3; + + [NativeTypeName("#define SDL_BUTTON_X1 4")] + public const int SDL_BUTTON_X1 = 4; + + [NativeTypeName("#define SDL_BUTTON_X2 5")] + public const int SDL_BUTTON_X2 = 5; + + [NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)")] + public const int SDL_BUTTON_LMASK = (1 << ((1) - 1)); + + [NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)")] + public const int SDL_BUTTON_MMASK = (1 << ((2) - 1)); + + [NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)")] + public const int SDL_BUTTON_RMASK = (1 << ((3) - 1)); + + [NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)")] + public const int SDL_BUTTON_X1MASK = (1 << ((4) - 1)); + + [NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)")] + public const int SDL_BUTTON_X2MASK = (1 << ((5) - 1)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetPixelFormatName([NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PixelFormatEnumToMasks", ExactSpelling = true)] + public static extern SDL_bool PixelFormatEnumToMasks([NativeTypeName("Uint32")] uint format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MasksToPixelFormatEnum", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MasksToPixelFormatEnum(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocFormat", ExactSpelling = true)] + public static extern SDL_PixelFormat* AllocFormat([NativeTypeName("Uint32")] uint pixel_format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeFormat", ExactSpelling = true)] + public static extern void FreeFormat(SDL_PixelFormat* format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocPalette", ExactSpelling = true)] + public static extern SDL_Palette* AllocPalette(int ncolors); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPixelFormatPalette", ExactSpelling = true)] + public static extern int SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPaletteColors", ExactSpelling = true)] + public static extern int SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreePalette", ExactSpelling = true)] + public static extern void FreePalette(SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGB", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGBA", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGB", ExactSpelling = true)] + public static extern void GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGBA", ExactSpelling = true)] + public static extern void 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); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CalculateGammaRamp", ExactSpelling = true)] + public static extern void CalculateGammaRamp(float gamma, [NativeTypeName("Uint16 *")] ushort* ramp); + + [NativeTypeName("#define SDL_ALPHA_OPAQUE 255")] + public const int SDL_ALPHA_OPAQUE = 255; + + [NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")] + public const int SDL_ALPHA_TRANSPARENT = 0; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumRenderDrivers", ExactSpelling = true)] + public static extern int GetNumRenderDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDriverInfo", ExactSpelling = true)] + public static extern int GetRenderDriverInfo(int index, SDL_RendererInfo* info); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowAndRenderer", ExactSpelling = true)] + public static extern int CreateWindowAndRenderer(int width, int height, [NativeTypeName("Uint32")] uint window_flags, SDL_Window** window, SDL_Renderer** renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* CreateRenderer(SDL_Window* window, int index, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSoftwareRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* CreateSoftwareRenderer(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* GetRenderer(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetWindow", ExactSpelling = true)] + public static extern SDL_Window* RenderGetWindow(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererInfo", ExactSpelling = true)] + public static extern int GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererOutputSize", ExactSpelling = true)] + public static extern int GetRendererOutputSize(SDL_Renderer* renderer, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTexture", ExactSpelling = true)] + public static extern SDL_Texture* CreateTexture(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint format, int access, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTextureFromSurface", ExactSpelling = true)] + public static extern SDL_Texture* CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueryTexture", ExactSpelling = true)] + public static extern int QueryTexture(SDL_Texture* texture, [NativeTypeName("Uint32 *")] uint* format, int* access, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureColorMod", ExactSpelling = true)] + public static extern int SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureColorMod", ExactSpelling = true)] + public static extern int GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureAlphaMod", ExactSpelling = true)] + public static extern int SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureAlphaMod", ExactSpelling = true)] + public static extern int GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureBlendMode", ExactSpelling = true)] + public static extern int SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureBlendMode", ExactSpelling = true)] + public static extern int GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureScaleMode", ExactSpelling = true)] + public static extern int SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureScaleMode", ExactSpelling = true)] + public static extern int GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureUserData", ExactSpelling = true)] + public static extern int SetTextureUserData(SDL_Texture* texture, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureUserData", ExactSpelling = true)] + public static extern void* GetTextureUserData(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateTexture", ExactSpelling = true)] + public static extern int UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] void* pixels, int pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateYUVTexture", ExactSpelling = true)] + public static extern int UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateNVTexture", ExactSpelling = true)] + public static extern int UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTexture", ExactSpelling = true)] + public static extern int LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, void** pixels, int* pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTextureToSurface", ExactSpelling = true)] + public static extern int LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockTexture", ExactSpelling = true)] + public static extern void UnlockTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderTargetSupported", ExactSpelling = true)] + public static extern SDL_bool RenderTargetSupported(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderTarget", ExactSpelling = true)] + public static extern int SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderTarget", ExactSpelling = true)] + public static extern SDL_Texture* GetRenderTarget(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetLogicalSize", ExactSpelling = true)] + public static extern int RenderSetLogicalSize(SDL_Renderer* renderer, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetLogicalSize", ExactSpelling = true)] + public static extern void RenderGetLogicalSize(SDL_Renderer* renderer, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetIntegerScale", ExactSpelling = true)] + public static extern int RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetIntegerScale", ExactSpelling = true)] + public static extern SDL_bool RenderGetIntegerScale(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetViewport", ExactSpelling = true)] + public static extern int RenderSetViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetViewport", ExactSpelling = true)] + public static extern void RenderGetViewport(SDL_Renderer* renderer, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetClipRect", ExactSpelling = true)] + public static extern int RenderSetClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetClipRect", ExactSpelling = true)] + public static extern void RenderGetClipRect(SDL_Renderer* renderer, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderIsClipEnabled", ExactSpelling = true)] + public static extern SDL_bool RenderIsClipEnabled(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetScale", ExactSpelling = true)] + public static extern int RenderSetScale(SDL_Renderer* renderer, float scaleX, float scaleY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetScale", ExactSpelling = true)] + public static extern void RenderGetScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderWindowToLogical", ExactSpelling = true)] + public static extern void RenderWindowToLogical(SDL_Renderer* renderer, int windowX, int windowY, float* logicalX, float* logicalY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderLogicalToWindow", ExactSpelling = true)] + public static extern void RenderLogicalToWindow(SDL_Renderer* renderer, float logicalX, float logicalY, int* windowX, int* windowY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawColor", ExactSpelling = true)] + public static extern int SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawColor", ExactSpelling = true)] + public static extern int GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawBlendMode", ExactSpelling = true)] + public static extern int SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawBlendMode", ExactSpelling = true)] + public static extern int GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderClear", ExactSpelling = true)] + public static extern int RenderClear(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoint", ExactSpelling = true)] + public static extern int RenderDrawPoint(SDL_Renderer* renderer, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoints", ExactSpelling = true)] + public static extern int RenderDrawPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLine", ExactSpelling = true)] + public static extern int RenderDrawLine(SDL_Renderer* renderer, int x1, int y1, int x2, int y2); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLines", ExactSpelling = true)] + public static extern int RenderDrawLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRect", ExactSpelling = true)] + public static extern int RenderDrawRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRects", ExactSpelling = true)] + public static extern int RenderDrawRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRect", ExactSpelling = true)] + public static extern int RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRects", ExactSpelling = true)] + public static extern int RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopy", ExactSpelling = true)] + public static extern int RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyEx", ExactSpelling = true)] + public static extern int RenderCopyEx(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_Point *")] SDL_Point* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointF", ExactSpelling = true)] + public static extern int RenderDrawPointF(SDL_Renderer* renderer, float x, float y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointsF", ExactSpelling = true)] + public static extern int RenderDrawPointsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLineF", ExactSpelling = true)] + public static extern int RenderDrawLineF(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLinesF", ExactSpelling = true)] + public static extern int RenderDrawLinesF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectF", ExactSpelling = true)] + public static extern int RenderDrawRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectsF", ExactSpelling = true)] + public static extern int RenderDrawRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectF", ExactSpelling = true)] + public static extern int RenderFillRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectsF", ExactSpelling = true)] + public static extern int RenderFillRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyF", ExactSpelling = true)] + public static extern int RenderCopyF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyExF", ExactSpelling = true)] + public static extern int RenderCopyExF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometry", ExactSpelling = true)] + public static extern int 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("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometryRaw", ExactSpelling = true)] + public static extern int 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 *")] void* indices, int num_indices, int size_indices); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderReadPixels", ExactSpelling = true)] + public static extern int RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint format, void* pixels, int pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderPresent", ExactSpelling = true)] + public static extern void RenderPresent(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyTexture", ExactSpelling = true)] + public static extern void DestroyTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyRenderer", ExactSpelling = true)] + public static extern void DestroyRenderer(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFlush", ExactSpelling = true)] + public static extern int RenderFlush(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_BindTexture", ExactSpelling = true)] + public static extern int GL_BindTexture(SDL_Texture* texture, float* texw, float* texh); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnbindTexture", ExactSpelling = true)] + public static extern int GL_UnbindTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalLayer", ExactSpelling = true)] + public static extern void* RenderGetMetalLayer(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalCommandEncoder", ExactSpelling = true)] + public static extern void* RenderGetMetalCommandEncoder(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetVSync", ExactSpelling = true)] + public static extern int RenderSetVSync(SDL_Renderer* renderer, int vsync); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFile", ExactSpelling = true)] + public static extern SDL_RWops* RWFromFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("const char *")] sbyte* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFP", ExactSpelling = true)] + public static extern SDL_RWops* RWFromFP(void* fp, SDL_bool autoclose); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromMem", ExactSpelling = true)] + public static extern SDL_RWops* RWFromMem(void* mem, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromConstMem", ExactSpelling = true)] + public static extern SDL_RWops* RWFromConstMem([NativeTypeName("const void *")] void* mem, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocRW", ExactSpelling = true)] + public static extern SDL_RWops* AllocRW(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeRW", ExactSpelling = true)] + public static extern void FreeRW(SDL_RWops* area); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWsize", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWsize(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWseek", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWseek(SDL_RWops* context, [NativeTypeName("Sint64")] long offset, int whence); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWtell", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWtell(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWread", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr maxnum); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWwrite", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr num); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWclose", ExactSpelling = true)] + public static extern int RWclose(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile_RW", ExactSpelling = true)] + public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] UIntPtr* datasize, int freesrc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile", ExactSpelling = true)] + public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] UIntPtr* datasize); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadU8", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte ReadU8(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE16", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort ReadLE16(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE16", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort ReadBE16(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE32", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint ReadLE32(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE32", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint ReadBE32(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE64", ExactSpelling = true)] + [return: NativeTypeName("Uint64")] + public static extern ulong ReadLE64(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE64", ExactSpelling = true)] + [return: NativeTypeName("Uint64")] + public static extern ulong ReadBE64(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteU8", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE16", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE16", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE32", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE32", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE64", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE64", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + + [NativeTypeName("#define SDL_RWOPS_UNKNOWN 0U")] + public const uint SDL_RWOPS_UNKNOWN = 0U; + + [NativeTypeName("#define SDL_RWOPS_WINFILE 1U")] + public const uint SDL_RWOPS_WINFILE = 1U; + + [NativeTypeName("#define SDL_RWOPS_STDFILE 2U")] + public const uint SDL_RWOPS_STDFILE = 2U; + + [NativeTypeName("#define SDL_RWOPS_JNIFILE 3U")] + public const uint SDL_RWOPS_JNIFILE = 3U; + + [NativeTypeName("#define SDL_RWOPS_MEMORY 4U")] + public const uint SDL_RWOPS_MEMORY = 4U; + + [NativeTypeName("#define SDL_RWOPS_MEMORY_RO 5U")] + public const uint SDL_RWOPS_MEMORY_RO = 5U; + + [NativeTypeName("#define RW_SEEK_SET 0")] + public const int RW_SEEK_SET = 0; + + [NativeTypeName("#define RW_SEEK_CUR 1")] + public const int RW_SEEK_CUR = 1; + + [NativeTypeName("#define RW_SEEK_END 2")] + public const int RW_SEEK_END = 2; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_malloc", ExactSpelling = true)] + public static extern void* malloc([NativeTypeName("size_t")] UIntPtr size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_calloc", ExactSpelling = true)] + public static extern void* calloc([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_realloc", ExactSpelling = true)] + public static extern void* realloc(void* mem, [NativeTypeName("size_t")] UIntPtr size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)] + public static extern void free(void* mem); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetOriginalMemoryFunctions", ExactSpelling = true)] + public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMemoryFunctions", ExactSpelling = true)] + public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMemoryFunctions", ExactSpelling = true)] + public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] IntPtr malloc_func, [NativeTypeName("SDL_calloc_func")] IntPtr calloc_func, [NativeTypeName("SDL_realloc_func")] IntPtr realloc_func, [NativeTypeName("SDL_free_func")] IntPtr free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAllocations", ExactSpelling = true)] + public static extern int GetNumAllocations(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strcasestr", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* strcasestr([NativeTypeName("const char *")] sbyte* haystack, [NativeTypeName("const char *")] sbyte* needle); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_open", ExactSpelling = true)] + [return: NativeTypeName("SDL_iconv_t")] + public static extern _SDL_iconv_t* iconv_open([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_close", ExactSpelling = true)] + public static extern int iconv_close([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern UIntPtr iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] UIntPtr* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] UIntPtr* outbytesleft); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_string", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] UIntPtr inbytesleft); + + [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] + public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL; + + [NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")] + public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F)); + + [NativeTypeName("#define SDL_MIN_SINT8 ((Sint8)(~0x7F))")] + public const sbyte SDL_MIN_SINT8 = ((sbyte)(~0x7F)); + + [NativeTypeName("#define SDL_MAX_UINT8 ((Uint8)0xFF)")] + public const byte SDL_MAX_UINT8 = ((byte)(0xFF)); + + [NativeTypeName("#define SDL_MIN_UINT8 ((Uint8)0x00)")] + public const byte SDL_MIN_UINT8 = ((byte)(0x00)); + + [NativeTypeName("#define SDL_MAX_SINT16 ((Sint16)0x7FFF)")] + public const short SDL_MAX_SINT16 = ((short)(0x7FFF)); + + [NativeTypeName("#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF))")] + public const short SDL_MIN_SINT16 = ((short)(~0x7FFF)); + + [NativeTypeName("#define SDL_MAX_UINT16 ((Uint16)0xFFFF)")] + public const ushort SDL_MAX_UINT16 = ((ushort)(0xFFFF)); + + [NativeTypeName("#define SDL_MIN_UINT16 ((Uint16)0x0000)")] + public const ushort SDL_MIN_UINT16 = ((ushort)(0x0000)); + + [NativeTypeName("#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF)")] + public const int SDL_MAX_SINT32 = ((int)(0x7FFFFFFF)); + + [NativeTypeName("#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF))")] + public const int SDL_MIN_SINT32 = ((int)(~0x7FFFFFFF)); + + [NativeTypeName("#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu)")] + public const uint SDL_MAX_UINT32 = ((uint)(0xFFFFFFFFU)); + + [NativeTypeName("#define SDL_MIN_UINT32 ((Uint32)0x00000000)")] + public const uint SDL_MIN_UINT32 = ((uint)(0x00000000)); + + [NativeTypeName("#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll)")] + public const long SDL_MAX_SINT64 = ((long)(0x7FFFFFFFFFFFFFFFL)); + + [NativeTypeName("#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll))")] + public const long SDL_MIN_SINT64 = ((long)(~0x7FFFFFFFFFFFFFFFL)); + + [NativeTypeName("#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull)")] + public const ulong SDL_MAX_UINT64 = ((ulong)(0xFFFFFFFFFFFFFFFFUL)); + + [NativeTypeName("#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull))")] + public const ulong SDL_MIN_UINT64 = ((ulong)(0x0000000000000000UL)); + + [NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")] + public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; + + [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] + public static ReadOnlySpan SDL_PRIs64 => new byte[] { 0x49, 0x36, 0x34, 0x64, 0x00 }; + + [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] + public static ReadOnlySpan SDL_PRIu64 => new byte[] { 0x49, 0x36, 0x34, 0x75, 0x00 }; + + [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] + public static ReadOnlySpan SDL_PRIx64 => new byte[] { 0x49, 0x36, 0x34, 0x78, 0x00 }; + + [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] + public static ReadOnlySpan SDL_PRIX64 => new byte[] { 0x49, 0x36, 0x34, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_PRIs32 \"d\"")] + public static ReadOnlySpan SDL_PRIs32 => new byte[] { 0x64, 0x00 }; + + [NativeTypeName("#define SDL_PRIu32 \"u\"")] + public static ReadOnlySpan SDL_PRIu32 => new byte[] { 0x75, 0x00 }; + + [NativeTypeName("#define SDL_PRIx32 \"x\"")] + public static ReadOnlySpan SDL_PRIx32 => new byte[] { 0x78, 0x00 }; + + [NativeTypeName("#define SDL_PRIX32 \"X\"")] + public static ReadOnlySpan SDL_PRIX32 => new byte[] { 0x58, 0x00 }; + + [NativeTypeName("#define M_PI 3.14159265358979323846264338327950288")] + public const double M_PI = 3.14159265358979323846264338327950288; + + [NativeTypeName("#define SDL_ICONV_ERROR (size_t)-1")] + public static readonly UIntPtr SDL_ICONV_ERROR = unchecked((nuint)(-1)); + + [NativeTypeName("#define SDL_ICONV_E2BIG (size_t)-2")] + public static readonly UIntPtr SDL_ICONV_E2BIG = unchecked((nuint)(-2)); + + [NativeTypeName("#define SDL_ICONV_EILSEQ (size_t)-3")] + public static readonly UIntPtr SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); + + [NativeTypeName("#define SDL_ICONV_EINVAL (size_t)-4")] + public static readonly UIntPtr SDL_ICONV_EINVAL = unchecked((nuint)(-4)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurface", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurface([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormat", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceWithFormat([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceFrom", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormatFrom", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeSurface", ExactSpelling = true)] + public static extern void FreeSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfacePalette", ExactSpelling = true)] + public static extern int SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockSurface", ExactSpelling = true)] + public static extern int LockSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockSurface", ExactSpelling = true)] + public static extern void UnlockSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadBMP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SaveBMP_RW", ExactSpelling = true)] + public static extern int SaveBMP_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceRLE", ExactSpelling = true)] + public static extern int SetSurfaceRLE(SDL_Surface* surface, int flag); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasSurfaceRLE", ExactSpelling = true)] + public static extern SDL_bool HasSurfaceRLE(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetColorKey", ExactSpelling = true)] + public static extern int SetColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasColorKey", ExactSpelling = true)] + public static extern SDL_bool HasColorKey(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetColorKey", ExactSpelling = true)] + public static extern int GetColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceColorMod", ExactSpelling = true)] + public static extern int SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceColorMod", ExactSpelling = true)] + public static extern int GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceAlphaMod", ExactSpelling = true)] + public static extern int SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceAlphaMod", ExactSpelling = true)] + public static extern int GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceBlendMode", ExactSpelling = true)] + public static extern int SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceBlendMode", ExactSpelling = true)] + public static extern int GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipRect", ExactSpelling = true)] + public static extern SDL_bool SetClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipRect", ExactSpelling = true)] + public static extern void GetClipRect(SDL_Surface* surface, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DuplicateSurface", ExactSpelling = true)] + public static extern SDL_Surface* DuplicateSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurface", ExactSpelling = true)] + public static extern SDL_Surface* ConvertSurface(SDL_Surface* src, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* fmt, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurfaceFormat", ExactSpelling = true)] + public static extern SDL_Surface* ConvertSurfaceFormat(SDL_Surface* src, [NativeTypeName("Uint32")] uint pixel_format, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertPixels", ExactSpelling = true)] + public static extern int ConvertPixels(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PremultiplyAlpha", ExactSpelling = true)] + public static extern int PremultiplyAlpha(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRect", ExactSpelling = true)] + public static extern int FillRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRects", ExactSpelling = true)] + public static extern int FillRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlit", ExactSpelling = true)] + public static extern int UpperBlit(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlit", ExactSpelling = true)] + public static extern int LowerBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretch", ExactSpelling = true)] + public static extern int SoftStretch(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretchLinear", ExactSpelling = true)] + public static extern int SoftStretchLinear(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlitScaled", ExactSpelling = true)] + public static extern int UpperBlitScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlitScaled", ExactSpelling = true)] + public static extern int LowerBlitScaled(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetYUVConversionMode", ExactSpelling = true)] + public static extern void SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionMode", ExactSpelling = true)] + public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionMode(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionModeForResolution", ExactSpelling = true)] + public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); + + [NativeTypeName("#define SDL_SWSURFACE 0")] + public const int SDL_SWSURFACE = 0; + + [NativeTypeName("#define SDL_PREALLOC 0x00000001")] + public const int SDL_PREALLOC = 0x00000001; + + [NativeTypeName("#define SDL_RLEACCEL 0x00000002")] + public const int SDL_RLEACCEL = 0x00000002; + + [NativeTypeName("#define SDL_DONTFREE 0x00000004")] + public const int SDL_DONTFREE = 0x00000004; + + [NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008")] + public const int SDL_SIMD_ALIGNED = 0x00000008; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowsMessageHook", ExactSpelling = true)] + public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] IntPtr callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Direct3D9GetAdapterIndex", ExactSpelling = true)] + public static extern int Direct3D9GetAdapterIndex(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D9Device", ExactSpelling = true)] + public static extern IDirect3DDevice9* RenderGetD3D9Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D11Device", ExactSpelling = true)] + public static extern ID3D11Device* RenderGetD3D11Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D12Device", ExactSpelling = true)] + public static extern ID3D12Device* RenderGetD3D12Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DXGIGetOutputInfo", ExactSpelling = true)] + public static extern SDL_bool DXGIGetOutputInfo(int displayIndex, int* adapterIndex, int* outputIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTablet", ExactSpelling = true)] + public static extern SDL_bool IsTablet(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillTerminate", ExactSpelling = true)] + public static extern void OnApplicationWillTerminate(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidReceiveMemoryWarning", ExactSpelling = true)] + public static extern void OnApplicationDidReceiveMemoryWarning(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillResignActive", ExactSpelling = true)] + public static extern void OnApplicationWillResignActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidEnterBackground", ExactSpelling = true)] + public static extern void OnApplicationDidEnterBackground(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillEnterForeground", ExactSpelling = true)] + public static extern void OnApplicationWillEnterForeground(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidBecomeActive", ExactSpelling = true)] + public static extern void OnApplicationDidBecomeActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVersion", ExactSpelling = true)] + public static extern void GetVersion(SDL_version* ver); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevision", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetRevision(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevisionNumber", ExactSpelling = true)] + public static extern int GetRevisionNumber(); + + [NativeTypeName("#define SDL_MAJOR_VERSION 2")] + public const int SDL_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_MINOR_VERSION 28")] + public const int SDL_MINOR_VERSION = 28; + + [NativeTypeName("#define SDL_PATCHLEVEL 0")] + public const int SDL_PATCHLEVEL = 0; + + [NativeTypeName("#define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)")] + public const int SDL_COMPILEDVERSION = ((2) * 1000 + (28) * 100 + (0)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDrivers", ExactSpelling = true)] + public static extern int GetNumVideoDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVideoDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetVideoDriver(int index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoInit", ExactSpelling = true)] + public static extern int VideoInit([NativeTypeName("const char *")] sbyte* driver_name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoQuit", ExactSpelling = true)] + public static extern void VideoQuit(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentVideoDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetCurrentVideoDriver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDisplays", ExactSpelling = true)] + public static extern int GetNumVideoDisplays(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetDisplayName(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayBounds", ExactSpelling = true)] + public static extern int GetDisplayBounds(int displayIndex, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayUsableBounds", ExactSpelling = true)] + public static extern int GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayDPI", ExactSpelling = true)] + public static extern int GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayOrientation", ExactSpelling = true)] + public static extern SDL_DisplayOrientation GetDisplayOrientation(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumDisplayModes", ExactSpelling = true)] + public static extern int GetNumDisplayModes(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayMode", ExactSpelling = true)] + public static extern int GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDesktopDisplayMode", ExactSpelling = true)] + public static extern int GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentDisplayMode", ExactSpelling = true)] + public static extern int GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClosestDisplayMode", ExactSpelling = true)] + public static extern SDL_DisplayMode* GetClosestDisplayMode(int displayIndex, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode, SDL_DisplayMode* closest); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPointDisplayIndex", ExactSpelling = true)] + public static extern int GetPointDisplayIndex([NativeTypeName("const SDL_Point *")] SDL_Point* point); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRectDisplayIndex", ExactSpelling = true)] + public static extern int GetRectDisplayIndex([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayIndex", ExactSpelling = true)] + public static extern int GetWindowDisplayIndex(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowDisplayMode", ExactSpelling = true)] + public static extern int SetWindowDisplayMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayMode", ExactSpelling = true)] + public static extern int GetWindowDisplayMode(SDL_Window* window, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowICCProfile", ExactSpelling = true)] + public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] UIntPtr* size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPixelFormat", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowPixelFormat(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindow", ExactSpelling = true)] + public static extern SDL_Window* CreateWindow([NativeTypeName("const char *")] sbyte* title, int x, int y, int w, int h, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowFrom", ExactSpelling = true)] + public static extern SDL_Window* CreateWindowFrom([NativeTypeName("const void *")] void* data); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowID", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowID(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFromID", ExactSpelling = true)] + public static extern SDL_Window* GetWindowFromID([NativeTypeName("Uint32")] uint id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFlags", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowFlags(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowTitle", ExactSpelling = true)] + public static extern void SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] sbyte* title); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowTitle", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetWindowTitle(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowIcon", ExactSpelling = true)] + public static extern void SetWindowIcon(SDL_Window* window, SDL_Surface* icon); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowData", ExactSpelling = true)] + public static extern void* SetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowData", ExactSpelling = true)] + public static extern void* GetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowPosition", ExactSpelling = true)] + public static extern void SetWindowPosition(SDL_Window* window, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPosition", ExactSpelling = true)] + public static extern void GetWindowPosition(SDL_Window* window, int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowSize", ExactSpelling = true)] + public static extern void SetWindowSize(SDL_Window* window, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSize", ExactSpelling = true)] + public static extern void GetWindowSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBordersSize", ExactSpelling = true)] + public static extern int GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSizeInPixels", ExactSpelling = true)] + public static extern void GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMinimumSize", ExactSpelling = true)] + public static extern void SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMinimumSize", ExactSpelling = true)] + public static extern void GetWindowMinimumSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMaximumSize", ExactSpelling = true)] + public static extern void SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMaximumSize", ExactSpelling = true)] + public static extern void GetWindowMaximumSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBordered", ExactSpelling = true)] + public static extern void SetWindowBordered(SDL_Window* window, SDL_bool bordered); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowResizable", ExactSpelling = true)] + public static extern void SetWindowResizable(SDL_Window* window, SDL_bool resizable); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowAlwaysOnTop", ExactSpelling = true)] + public static extern void SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowWindow", ExactSpelling = true)] + public static extern void ShowWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)] + public static extern void HideWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RaiseWindow", ExactSpelling = true)] + public static extern void RaiseWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MaximizeWindow", ExactSpelling = true)] + public static extern void MaximizeWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MinimizeWindow", ExactSpelling = true)] + public static extern void MinimizeWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RestoreWindow", ExactSpelling = true)] + public static extern void RestoreWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowFullscreen", ExactSpelling = true)] + public static extern int SetWindowFullscreen(SDL_Window* window, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasWindowSurface", ExactSpelling = true)] + public static extern SDL_bool HasWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSurface", ExactSpelling = true)] + public static extern SDL_Surface* GetWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurface", ExactSpelling = true)] + public static extern int UpdateWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurfaceRects", ExactSpelling = true)] + public static extern int UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindowSurface", ExactSpelling = true)] + public static extern int DestroyWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGrab", ExactSpelling = true)] + public static extern void SetWindowGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowKeyboardGrab", ExactSpelling = true)] + public static extern void SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseGrab", ExactSpelling = true)] + public static extern void SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowKeyboardGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowKeyboardGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowMouseGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGrabbedWindow", ExactSpelling = true)] + public static extern SDL_Window* GetGrabbedWindow(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseRect", ExactSpelling = true)] + public static extern int SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseRect", ExactSpelling = true)] + [return: NativeTypeName("const SDL_Rect *")] + public static extern SDL_Rect* GetWindowMouseRect(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBrightness", ExactSpelling = true)] + public static extern int SetWindowBrightness(SDL_Window* window, float brightness); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBrightness", ExactSpelling = true)] + public static extern float GetWindowBrightness(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)] + public static extern int SetWindowOpacity(SDL_Window* window, float opacity); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowOpacity", ExactSpelling = true)] + public static extern int GetWindowOpacity(SDL_Window* window, float* out_opacity); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowModalFor", ExactSpelling = true)] + public static extern int SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowInputFocus", ExactSpelling = true)] + public static extern int SetWindowInputFocus(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGammaRamp", ExactSpelling = true)] + public static extern int SetWindowGammaRamp(SDL_Window* window, [NativeTypeName("const Uint16 *")] ushort* red, [NativeTypeName("const Uint16 *")] ushort* green, [NativeTypeName("const Uint16 *")] ushort* blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGammaRamp", ExactSpelling = true)] + public static extern int GetWindowGammaRamp(SDL_Window* window, [NativeTypeName("Uint16 *")] ushort* red, [NativeTypeName("Uint16 *")] ushort* green, [NativeTypeName("Uint16 *")] ushort* blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowHitTest", ExactSpelling = true)] + public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] IntPtr callback, void* callback_data); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlashWindow", ExactSpelling = true)] + public static extern int FlashWindow(SDL_Window* window, SDL_FlashOperation operation); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindow", ExactSpelling = true)] + public static extern void DestroyWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenSaverEnabled", ExactSpelling = true)] + public static extern SDL_bool IsScreenSaverEnabled(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EnableScreenSaver", ExactSpelling = true)] + public static extern void EnableScreenSaver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)] + public static extern void DisableScreenSaver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_LoadLibrary", ExactSpelling = true)] + public static extern int GL_LoadLibrary([NativeTypeName("const char *")] sbyte* path); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetProcAddress", ExactSpelling = true)] + public static extern void* GL_GetProcAddress([NativeTypeName("const char *")] sbyte* proc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnloadLibrary", ExactSpelling = true)] + public static extern void GL_UnloadLibrary(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ExtensionSupported", ExactSpelling = true)] + public static extern SDL_bool GL_ExtensionSupported([NativeTypeName("const char *")] sbyte* extension); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ResetAttributes", ExactSpelling = true)] + public static extern void GL_ResetAttributes(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetAttribute", ExactSpelling = true)] + public static extern int GL_SetAttribute(SDL_GLattr attr, int value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetAttribute", ExactSpelling = true)] + public static extern int GL_GetAttribute(SDL_GLattr attr, int* value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_CreateContext", ExactSpelling = true)] + [return: NativeTypeName("SDL_GLContext")] + public static extern void* GL_CreateContext(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_MakeCurrent", ExactSpelling = true)] + public static extern int GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] void* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentWindow", ExactSpelling = true)] + public static extern SDL_Window* GL_GetCurrentWindow(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentContext", ExactSpelling = true)] + [return: NativeTypeName("SDL_GLContext")] + public static extern void* GL_GetCurrentContext(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetDrawableSize", ExactSpelling = true)] + public static extern void GL_GetDrawableSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetSwapInterval", ExactSpelling = true)] + public static extern int GL_SetSwapInterval(int interval); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetSwapInterval", ExactSpelling = true)] + public static extern int GL_GetSwapInterval(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SwapWindow", ExactSpelling = true)] + public static extern void GL_SwapWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_DeleteContext", ExactSpelling = true)] + public static extern void GL_DeleteContext([NativeTypeName("SDL_GLContext")] void* context); + + [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u")] + public const uint SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000U; + + [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)")] + public const uint SDL_WINDOWPOS_UNDEFINED = (0x1FFF0000U | (0)); + + [NativeTypeName("#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u")] + public const uint SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000U; + + [NativeTypeName("#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)")] + public const uint SDL_WINDOWPOS_CENTERED = (0x2FFF0000U | (0)); + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ArrayOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ArrayOrder.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ArrayOrder.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs new file mode 100644 index 00000000..027f7f78 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs @@ -0,0 +1,80 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_AudioCVT + { + public int needed; + + [NativeTypeName("SDL_AudioFormat")] + public ushort src_format; + + [NativeTypeName("SDL_AudioFormat")] + public ushort dst_format; + + public double rate_incr; + + [NativeTypeName("Uint8 *")] + public byte* buf; + + public int len; + + public int len_cvt; + + public int len_mult; + + public double len_ratio; + + [NativeTypeName("SDL_AudioFilter[10]")] + public _filters_e__FixedBuffer filters; + + public int filter_index; + + public partial struct _filters_e__FixedBuffer + { + public IntPtr e0; + public IntPtr e1; + public IntPtr e2; + public IntPtr e3; + public IntPtr e4; + public IntPtr e5; + public IntPtr e6; + public IntPtr e7; + public IntPtr e8; + public IntPtr e9; + + public unsafe ref IntPtr this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + fixed (IntPtr* pThis = &e0) + { + return ref pThis[index]; + } + } + } + } + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_AudioCallback.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioCallback.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs diff --git a/sources/SDL2Sharp.Interop/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_AudioFilter.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioFilter.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs new file mode 100644 index 00000000..fe0e438e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_AudioSpec + { + public int freq; + + [NativeTypeName("SDL_AudioFormat")] + public ushort format; + + [NativeTypeName("Uint8")] + public byte channels; + + [NativeTypeName("Uint8")] + public byte silence; + + [NativeTypeName("Uint16")] + public ushort samples; + + [NativeTypeName("Uint16")] + public ushort padding; + + [NativeTypeName("Uint32")] + public uint size; + + [NativeTypeName("SDL_AudioCallback")] + public IntPtr callback; + + public void* userdata; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioStatus.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioStatus.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioStatus.cs diff --git a/sources/SDL2Sharp.Interop/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BitmapOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_BitmapOrder.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_BitmapOrder.cs diff --git a/sources/SDL2Sharp.Interop/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendFactor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_BlendFactor.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendFactor.cs diff --git a/sources/SDL2Sharp.Interop/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_BlendMode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendMode.cs diff --git a/sources/SDL2Sharp.Interop/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendOperation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_BlendOperation.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendOperation.cs diff --git a/sources/SDL2Sharp.Interop/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlitMap.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_BlitMap.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlitMap.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Color.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Color.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Color.cs diff --git a/sources/SDL2Sharp.Interop/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_CommonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_CommonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_CommonEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerAxisEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ControllerAxisEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerAxisEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ControllerButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ControllerDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs new file mode 100644 index 00000000..2dfb1b42 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_ControllerSensorEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Sint32")] + public int sensor; + + [NativeTypeName("float[3]")] + public fixed float data[3]; + + [NativeTypeName("Uint64")] + public ulong timestamp_us; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerTouchpadEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ControllerTouchpadEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerTouchpadEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Cursor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Cursor.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Cursor.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DUMMY_ENUM.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DUMMY_ENUM.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DUMMY_ENUM.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DisplayEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEventID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DisplayEventID.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEventID.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DisplayMode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayMode.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayOrientation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DisplayOrientation.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayOrientation.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DollarGestureEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DollarGestureEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DollarGestureEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DropEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_DropEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_DropEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs new file mode 100644 index 00000000..7db609df --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs @@ -0,0 +1,126 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct SDL_Event + { + [FieldOffset(0)] + [NativeTypeName("Uint32")] + public uint type; + + [FieldOffset(0)] + public SDL_CommonEvent common; + + [FieldOffset(0)] + public SDL_DisplayEvent display; + + [FieldOffset(0)] + public SDL_WindowEvent window; + + [FieldOffset(0)] + public SDL_KeyboardEvent key; + + [FieldOffset(0)] + public SDL_TextEditingEvent edit; + + [FieldOffset(0)] + public SDL_TextEditingExtEvent editExt; + + [FieldOffset(0)] + public SDL_TextInputEvent text; + + [FieldOffset(0)] + public SDL_MouseMotionEvent motion; + + [FieldOffset(0)] + public SDL_MouseButtonEvent button; + + [FieldOffset(0)] + public SDL_MouseWheelEvent wheel; + + [FieldOffset(0)] + public SDL_JoyAxisEvent jaxis; + + [FieldOffset(0)] + public SDL_JoyBallEvent jball; + + [FieldOffset(0)] + public SDL_JoyHatEvent jhat; + + [FieldOffset(0)] + public SDL_JoyButtonEvent jbutton; + + [FieldOffset(0)] + public SDL_JoyDeviceEvent jdevice; + + [FieldOffset(0)] + public SDL_JoyBatteryEvent jbattery; + + [FieldOffset(0)] + public SDL_ControllerAxisEvent caxis; + + [FieldOffset(0)] + public SDL_ControllerButtonEvent cbutton; + + [FieldOffset(0)] + public SDL_ControllerDeviceEvent cdevice; + + [FieldOffset(0)] + public SDL_ControllerTouchpadEvent ctouchpad; + + [FieldOffset(0)] + public SDL_ControllerSensorEvent csensor; + + [FieldOffset(0)] + public SDL_AudioDeviceEvent adevice; + + [FieldOffset(0)] + public SDL_SensorEvent sensor; + + [FieldOffset(0)] + public SDL_QuitEvent quit; + + [FieldOffset(0)] + public SDL_UserEvent user; + + [FieldOffset(0)] + public SDL_SysWMEvent syswm; + + [FieldOffset(0)] + public SDL_TouchFingerEvent tfinger; + + [FieldOffset(0)] + public SDL_MultiGestureEvent mgesture; + + [FieldOffset(0)] + public SDL_DollarGestureEvent dgesture; + + [FieldOffset(0)] + public SDL_DropEvent drop; + + [FieldOffset(0)] + [NativeTypeName("Uint8[56]")] + public fixed byte padding[56]; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_EventFilter.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_EventFilter.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs diff --git a/sources/SDL2Sharp.Interop/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_EventType.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventType.cs diff --git a/sources/SDL2Sharp.Interop/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FPoint.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_FPoint.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_FPoint.cs diff --git a/sources/SDL2Sharp.Interop/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FRect.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_FRect.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_FRect.cs diff --git a/sources/SDL2Sharp.Interop/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FlashOperation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_FlashOperation.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_FlashOperation.cs diff --git a/sources/SDL2Sharp.Interop/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLContextResetNotification.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GLContextResetNotification.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLContextResetNotification.cs diff --git a/sources/SDL2Sharp.Interop/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLattr.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GLattr.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLattr.cs diff --git a/sources/SDL2Sharp.Interop/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextFlag.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GLcontextFlag.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextFlag.cs diff --git a/sources/SDL2Sharp.Interop/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextReleaseFlag.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GLcontextReleaseFlag.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextReleaseFlag.cs diff --git a/sources/SDL2Sharp.Interop/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLprofile.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GLprofile.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLprofile.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs new file mode 100644 index 00000000..fb41ca1e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_GUID + { + [NativeTypeName("Uint8[16]")] + public fixed byte data[16]; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_HintCallback.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_HintCallback.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs diff --git a/sources/SDL2Sharp.Interop/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintPriority.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_HintPriority.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintPriority.cs diff --git a/sources/SDL2Sharp.Interop/SDL_HitTest.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_HitTest.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs diff --git a/sources/SDL2Sharp.Interop/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTestResult.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_HitTestResult.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTestResult.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyAxisEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyAxisEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyAxisEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBallEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyBallEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBallEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBatteryEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyBatteryEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBatteryEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyHatEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoyHatEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyHatEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickPowerLevel.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoystickPowerLevel.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickPowerLevel.cs diff --git a/sources/SDL2Sharp.Interop/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_JoystickType.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickType.cs diff --git a/sources/SDL2Sharp.Interop/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyCode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_KeyCode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyCode.cs diff --git a/sources/SDL2Sharp.Interop/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyboardEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_KeyboardEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyboardEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keymod.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Keymod.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keymod.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keysym.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Keysym.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keysym.cs diff --git a/sources/SDL2Sharp.Interop/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogCategory.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_LogCategory.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogCategory.cs diff --git a/sources/SDL2Sharp.Interop/SDL_LogOutputFunction.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_LogOutputFunction.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs diff --git a/sources/SDL2Sharp.Interop/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogPriority.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_LogPriority.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogPriority.cs diff --git a/sources/SDL2Sharp.Interop/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_MouseButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseMotionEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_MouseMotionEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseMotionEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelDirection.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_MouseWheelDirection.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelDirection.cs diff --git a/sources/SDL2Sharp.Interop/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_MouseWheelEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MultiGestureEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_MultiGestureEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_MultiGestureEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_OSEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_OSEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_OSEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedLayout.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_PackedLayout.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedLayout.cs diff --git a/sources/SDL2Sharp.Interop/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_PackedOrder.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedOrder.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Palette.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Palette.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Palette.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs new file mode 100644 index 00000000..fa3c1100 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs @@ -0,0 +1,80 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_PixelFormat + { + [NativeTypeName("Uint32")] + public uint format; + + public SDL_Palette* palette; + + [NativeTypeName("Uint8")] + public byte BitsPerPixel; + + [NativeTypeName("Uint8")] + public byte BytesPerPixel; + + [NativeTypeName("Uint8[2]")] + public fixed byte padding[2]; + + [NativeTypeName("Uint32")] + public uint Rmask; + + [NativeTypeName("Uint32")] + public uint Gmask; + + [NativeTypeName("Uint32")] + public uint Bmask; + + [NativeTypeName("Uint32")] + public uint Amask; + + [NativeTypeName("Uint8")] + public byte Rloss; + + [NativeTypeName("Uint8")] + public byte Gloss; + + [NativeTypeName("Uint8")] + public byte Bloss; + + [NativeTypeName("Uint8")] + public byte Aloss; + + [NativeTypeName("Uint8")] + public byte Rshift; + + [NativeTypeName("Uint8")] + public byte Gshift; + + [NativeTypeName("Uint8")] + public byte Bshift; + + [NativeTypeName("Uint8")] + public byte Ashift; + + public int refcount; + + [NativeTypeName("struct SDL_PixelFormat *")] + public SDL_PixelFormat* next; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormatEnum.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_PixelFormatEnum.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormatEnum.cs diff --git a/sources/SDL2Sharp.Interop/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_PixelType.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelType.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Point.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Point.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Point.cs diff --git a/sources/SDL2Sharp.Interop/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_QuitEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_QuitEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_QuitEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs new file mode 100644 index 00000000..54b9583d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs @@ -0,0 +1,105 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_RWops + { + [NativeTypeName("Sint64 (*)(struct SDL_RWops *) __attribute__((cdecl))")] + public IntPtr size; + + [NativeTypeName("Sint64 (*)(struct SDL_RWops *, Sint64, int) __attribute__((cdecl))")] + public IntPtr seek; + + [NativeTypeName("size_t (*)(struct SDL_RWops *, void *, size_t, size_t) __attribute__((cdecl))")] + public IntPtr read; + + [NativeTypeName("size_t (*)(struct SDL_RWops *, const void *, size_t, size_t) __attribute__((cdecl))")] + public IntPtr write; + + [NativeTypeName("int (*)(struct SDL_RWops *) __attribute__((cdecl))")] + public IntPtr close; + + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("__AnonymousRecord_SDL_rwops_L94_C5")] + public _hidden_e__Union hidden; + + [StructLayout(LayoutKind.Explicit)] + public partial struct _hidden_e__Union + { + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L102_C9")] + public _windowsio_e__Struct windowsio; + + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L122_C9")] + public _mem_e__Struct mem; + + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L128_C9")] + public _unknown_e__Struct unknown; + + public unsafe partial struct _windowsio_e__Struct + { + public SDL_bool append; + + public void* h; + + [NativeTypeName("__AnonymousRecord_SDL_rwops_L106_C13")] + public _buffer_e__Struct buffer; + + public unsafe partial struct _buffer_e__Struct + { + public void* data; + + [NativeTypeName("size_t")] + public UIntPtr size; + + [NativeTypeName("size_t")] + public UIntPtr left; + } + } + + public unsafe partial struct _mem_e__Struct + { + [NativeTypeName("Uint8 *")] + public byte* @base; + + [NativeTypeName("Uint8 *")] + public byte* here; + + [NativeTypeName("Uint8 *")] + public byte* stop; + } + + public unsafe partial struct _unknown_e__Struct + { + public void* data1; + + public void* data2; + } + } + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Rect.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Rect.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Rect.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Renderer.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Renderer.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Renderer.cs diff --git a/sources/SDL2Sharp.Interop/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_RendererFlags.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlags.cs diff --git a/sources/SDL2Sharp.Interop/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlip.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_RendererFlip.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlip.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs new file mode 100644 index 00000000..c21a4ba1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_RendererInfo + { + [NativeTypeName("const char *")] + public sbyte* name; + + [NativeTypeName("Uint32")] + public uint flags; + + [NativeTypeName("Uint32")] + public uint num_texture_formats; + + [NativeTypeName("Uint32[16]")] + public fixed uint texture_formats[16]; + + public int max_texture_width; + + public int max_texture_height; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ScaleMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ScaleMode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_ScaleMode.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Scancode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Scancode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Scancode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs new file mode 100644 index 00000000..ce329d9f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs @@ -0,0 +1,40 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_SensorEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + + [NativeTypeName("float[6]")] + public fixed float data[6]; + + [NativeTypeName("Uint64")] + public ulong timestamp_us; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Surface.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Surface.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Surface.cs diff --git a/sources/SDL2Sharp.Interop/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_SysWMEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMmsg.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_SysWMmsg.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMmsg.cs diff --git a/sources/SDL2Sharp.Interop/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SystemCursor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_SystemCursor.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_SystemCursor.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs new file mode 100644 index 00000000..40f05865 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextEditingEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char[32]")] + public fixed sbyte text[32]; + + [NativeTypeName("Sint32")] + public int start; + + [NativeTypeName("Sint32")] + public int length; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingExtEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TextEditingExtEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingExtEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs new file mode 100644 index 00000000..285e9416 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextInputEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char[32]")] + public fixed sbyte text[32]; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Texture.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Texture.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Texture.cs diff --git a/sources/SDL2Sharp.Interop/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureAccess.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TextureAccess.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureAccess.cs diff --git a/sources/SDL2Sharp.Interop/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureModulate.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TextureModulate.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureModulate.cs diff --git a/sources/SDL2Sharp.Interop/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TouchFingerEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TouchFingerEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_TouchFingerEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_UserEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_UserEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_UserEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Vertex.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Vertex.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Vertex.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs new file mode 100644 index 00000000..34a9ad27 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs @@ -0,0 +1,80 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_VirtualJoystickDesc + { + [NativeTypeName("Uint16")] + public ushort version; + + [NativeTypeName("Uint16")] + public ushort type; + + [NativeTypeName("Uint16")] + public ushort naxes; + + [NativeTypeName("Uint16")] + public ushort nbuttons; + + [NativeTypeName("Uint16")] + public ushort nhats; + + [NativeTypeName("Uint16")] + public ushort vendor_id; + + [NativeTypeName("Uint16")] + public ushort product_id; + + [NativeTypeName("Uint16")] + public ushort padding; + + [NativeTypeName("Uint32")] + public uint button_mask; + + [NativeTypeName("Uint32")] + public uint axis_mask; + + [NativeTypeName("const char *")] + public sbyte* name; + + public void* userdata; + + [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] + public IntPtr Update; + + [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] + public IntPtr SetPlayerIndex; + + [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + public IntPtr Rumble; + + [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + public IntPtr RumbleTriggers; + + [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] + public IntPtr SetLED; + + [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] + public IntPtr SendEffect; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Window.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Window.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_Window.cs diff --git a/sources/SDL2Sharp.Interop/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_WindowEvent.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEvent.cs diff --git a/sources/SDL2Sharp.Interop/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEventID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_WindowEventID.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEventID.cs diff --git a/sources/SDL2Sharp.Interop/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_WindowFlags.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowFlags.cs diff --git a/sources/SDL2Sharp.Interop/SDL_WindowsMessageHook.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_WindowsMessageHook.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs diff --git a/sources/SDL2Sharp.Interop/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_YUV_CONVERSION_MODE.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_YUV_CONVERSION_MODE.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_YUV_CONVERSION_MODE.cs diff --git a/sources/SDL2Sharp.Interop/SDL_blit.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_blit.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs diff --git a/sources/SDL2Sharp.Interop/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_bool.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_bool.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_bool.cs diff --git a/sources/SDL2Sharp.Interop/SDL_calloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_calloc_func.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs diff --git a/sources/SDL2Sharp.Interop/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_errorcode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_errorcode.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_errorcode.cs diff --git a/sources/SDL2Sharp.Interop/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_eventaction.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_eventaction.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_eventaction.cs diff --git a/sources/SDL2Sharp.Interop/SDL_free_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_free_func.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs diff --git a/sources/SDL2Sharp.Interop/SDL_malloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_malloc_func.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs diff --git a/sources/SDL2Sharp.Interop/SDL_realloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_realloc_func.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs diff --git a/sources/SDL2Sharp.Interop/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_version.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_version.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/SDL_version.cs diff --git a/sources/SDL2Sharp.Interop/TTF.cs b/sources/SDL2Sharp.Interop/codegen/compatible/TTF.cs similarity index 100% rename from sources/SDL2Sharp.Interop/TTF.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/TTF.cs diff --git a/sources/SDL2Sharp.Interop/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/compatible/TTF_Direction.cs similarity index 100% rename from sources/SDL2Sharp.Interop/TTF_Direction.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/TTF_Direction.cs diff --git a/sources/SDL2Sharp.Interop/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_AudioStream.cs similarity index 100% rename from sources/SDL2Sharp.Interop/_SDL_AudioStream.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/_SDL_AudioStream.cs diff --git a/sources/SDL2Sharp.Interop/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_Joystick.cs similarity index 100% rename from sources/SDL2Sharp.Interop/_SDL_Joystick.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/_SDL_Joystick.cs diff --git a/sources/SDL2Sharp.Interop/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_iconv_t.cs similarity index 100% rename from sources/SDL2Sharp.Interop/_SDL_iconv_t.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/_SDL_iconv_t.cs diff --git a/sources/SDL2Sharp.Interop/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/compatible/_TTF_Font.cs similarity index 100% rename from sources/SDL2Sharp.Interop/_TTF_Font.cs rename to sources/SDL2Sharp.Interop/codegen/compatible/_TTF_Font.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs new file mode 100644 index 00000000..8ea3fc3a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct ID3D11Device + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs new file mode 100644 index 00000000..ade1cb11 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct ID3D12Device + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs new file mode 100644 index 00000000..42715080 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct IDirect3DDevice9 + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG.cs b/sources/SDL2Sharp.Interop/codegen/default/IMG.cs new file mode 100644 index 00000000..33f72853 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/IMG.cs @@ -0,0 +1,214 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class IMG + { + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Linked_Version", ExactSpelling = true)] + [return: NativeTypeName("const SDL_version *")] + public static extern SDL_version* Linked_Version(); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Init", ExactSpelling = true)] + public static extern int Init(int flags); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTyped_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load", ExactSpelling = true)] + public static extern SDL_Surface* Load([NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load_RW", ExactSpelling = true)] + public static extern SDL_Surface* Load_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture", ExactSpelling = true)] + public static extern SDL_Texture* LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture_RW", ExactSpelling = true)] + public static extern SDL_Texture* LoadTexture_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTextureTyped_RW", ExactSpelling = true)] + public static extern SDL_Texture* LoadTextureTyped_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isAVIF", ExactSpelling = true)] + public static extern int isAVIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isICO", ExactSpelling = true)] + public static extern int isICO(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isCUR", ExactSpelling = true)] + public static extern int isCUR(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isBMP", ExactSpelling = true)] + public static extern int isBMP(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isGIF", ExactSpelling = true)] + public static extern int isGIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJPG", ExactSpelling = true)] + public static extern int isJPG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJXL", ExactSpelling = true)] + public static extern int isJXL(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isLBM", ExactSpelling = true)] + public static extern int isLBM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPCX", ExactSpelling = true)] + public static extern int isPCX(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNG", ExactSpelling = true)] + public static extern int isPNG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNM", ExactSpelling = true)] + public static extern int isPNM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isSVG", ExactSpelling = true)] + public static extern int isSVG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isQOI", ExactSpelling = true)] + public static extern int isQOI(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isTIF", ExactSpelling = true)] + public static extern int isTIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXCF", ExactSpelling = true)] + public static extern int isXCF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXPM", ExactSpelling = true)] + public static extern int isXPM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXV", ExactSpelling = true)] + public static extern int isXV(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isWEBP", ExactSpelling = true)] + public static extern int isWEBP(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAVIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadAVIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadICO_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadICO_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadCUR_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadCUR_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadBMP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadGIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJPG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadJPG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJXL_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadJXL_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadLBM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadLBM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPCX_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPCX_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPNG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPNM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSVG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadSVG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadQOI_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadQOI_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTGA_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTGA_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXCF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXCF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXPM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXPM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXV_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXV_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadWEBP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadWEBP_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSizedSVG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadSizedSVG_RW(SDL_RWops* src, int width, int height); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArray", ExactSpelling = true)] + public static extern SDL_Surface* ReadXPMFromArray([NativeTypeName("char **")] sbyte** xpm); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArrayToRGB888", ExactSpelling = true)] + public static extern SDL_Surface* ReadXPMFromArrayToRGB888([NativeTypeName("char **")] sbyte** xpm); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG", ExactSpelling = true)] + public static extern int SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG_RW", ExactSpelling = true)] + public static extern int SavePNG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG", ExactSpelling = true)] + public static extern int SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file, int quality); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG_RW", ExactSpelling = true)] + public static extern int SaveJPG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst, int quality); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimation([NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimation_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimationTyped_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimationTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_FreeAnimation", ExactSpelling = true)] + public static extern void FreeAnimation(IMG_Animation* anim); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIFAnimation_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadGIFAnimation_RW(SDL_RWops* src); + + [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 2")] + public const int SDL_IMAGE_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 6")] + public const int SDL_IMAGE_MINOR_VERSION = 6; + + [NativeTypeName("#define SDL_IMAGE_PATCHLEVEL 3")] + public const int SDL_IMAGE_PATCHLEVEL = 3; + + [NativeTypeName("#define SDL_IMAGE_COMPILEDVERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL)")] + public const int SDL_IMAGE_COMPILEDVERSION = ((2) * 1000 + (6) * 100 + (3)); + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs b/sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs new file mode 100644 index 00000000..ad4f4be3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct IMG_Animation + { + public int w; + + public int h; + + public int count; + + public SDL_Surface** frames; + + public int* delays; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs new file mode 100644 index 00000000..01d7abbb --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum IMG_InitFlags + { + IMG_INIT_JPG = 0x00000001, + IMG_INIT_PNG = 0x00000002, + IMG_INIT_TIF = 0x00000004, + IMG_INIT_WEBP = 0x00000008, + IMG_INIT_JXL = 0x00000010, + IMG_INIT_AVIF = 0x00000020, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL.cs new file mode 100644 index 00000000..121259a6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL.cs @@ -0,0 +1,2387 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class SDL + { + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)] + public static extern int Init([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_InitSubSystem", ExactSpelling = true)] + public static extern int InitSubSystem([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QuitSubSystem", ExactSpelling = true)] + public static extern void QuitSubSystem([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WasInit", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint WasInit([NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")] + public const uint SDL_INIT_TIMER = 0x00000001U; + + [NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")] + public const uint SDL_INIT_AUDIO = 0x00000010U; + + [NativeTypeName("#define SDL_INIT_VIDEO 0x00000020u")] + public const uint SDL_INIT_VIDEO = 0x00000020U; + + [NativeTypeName("#define SDL_INIT_JOYSTICK 0x00000200u")] + public const uint SDL_INIT_JOYSTICK = 0x00000200U; + + [NativeTypeName("#define SDL_INIT_HAPTIC 0x00001000u")] + public const uint SDL_INIT_HAPTIC = 0x00001000U; + + [NativeTypeName("#define SDL_INIT_GAMECONTROLLER 0x00002000u")] + public const uint SDL_INIT_GAMECONTROLLER = 0x00002000U; + + [NativeTypeName("#define SDL_INIT_EVENTS 0x00004000u")] + public const uint SDL_INIT_EVENTS = 0x00004000U; + + [NativeTypeName("#define SDL_INIT_SENSOR 0x00008000u")] + public const uint SDL_INIT_SENSOR = 0x00008000U; + + [NativeTypeName("#define SDL_INIT_NOPARACHUTE 0x00100000u")] + public const uint SDL_INIT_NOPARACHUTE = 0x00100000U; + + [NativeTypeName("#define SDL_INIT_EVERYTHING ( \\\r\n SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \\\r\n SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \\\r\n )")] + public const uint SDL_INIT_EVERYTHING = (0x00000001U | 0x00000010U | 0x00000020U | 0x00004000U | 0x00000200U | 0x00001000U | 0x00002000U | 0x00008000U); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDrivers", ExactSpelling = true)] + public static extern int GetNumAudioDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetAudioDriver(int index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioInit", ExactSpelling = true)] + public static extern int AudioInit([NativeTypeName("const char *")] sbyte* driver_name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioQuit", ExactSpelling = true)] + public static extern void AudioQuit(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentAudioDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetCurrentAudioDriver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudio", ExactSpelling = true)] + public static extern int OpenAudio(SDL_AudioSpec* desired, SDL_AudioSpec* obtained); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDevices", ExactSpelling = true)] + public static extern int GetNumAudioDevices(int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetAudioDeviceName(int index, int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceSpec", ExactSpelling = true)] + public static extern int GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec* spec); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultAudioInfo", ExactSpelling = true)] + public static extern int GetDefaultAudioInfo([NativeTypeName("char **")] sbyte** name, SDL_AudioSpec* spec, int iscapture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudioDevice", ExactSpelling = true)] + [return: NativeTypeName("SDL_AudioDeviceID")] + public static extern uint OpenAudioDevice([NativeTypeName("const char *")] sbyte* device, int iscapture, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* desired, SDL_AudioSpec* obtained, int allowed_changes); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioStatus", ExactSpelling = true)] + public static extern SDL_AudioStatus GetAudioStatus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceStatus", ExactSpelling = true)] + public static extern SDL_AudioStatus GetAudioDeviceStatus([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudio", ExactSpelling = true)] + public static extern void PauseAudio(int pause_on); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudioDevice", ExactSpelling = true)] + public static extern void PauseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev, int pause_on); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadWAV_RW", ExactSpelling = true)] + public static extern SDL_AudioSpec* LoadWAV_RW(SDL_RWops* src, int freesrc, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeWAV", ExactSpelling = true)] + public static extern void FreeWAV([NativeTypeName("Uint8 *")] byte* audio_buf); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_BuildAudioCVT", ExactSpelling = true)] + public static extern int BuildAudioCVT(SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort src_format, [NativeTypeName("Uint8")] byte src_channels, int src_rate, [NativeTypeName("SDL_AudioFormat")] ushort dst_format, [NativeTypeName("Uint8")] byte dst_channels, int dst_rate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertAudio", ExactSpelling = true)] + public static extern int ConvertAudio(SDL_AudioCVT* cvt); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NewAudioStream", ExactSpelling = true)] + [return: NativeTypeName("SDL_AudioStream *")] + public static extern _SDL_AudioStream* NewAudioStream([NativeTypeName("const SDL_AudioFormat")] ushort src_format, [NativeTypeName("const Uint8")] byte src_channels, [NativeTypeName("const int")] int src_rate, [NativeTypeName("const SDL_AudioFormat")] ushort dst_format, [NativeTypeName("const Uint8")] byte dst_channels, [NativeTypeName("const int")] int dst_rate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamPut", ExactSpelling = true)] + public static extern int AudioStreamPut([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, [NativeTypeName("const void *")] void* buf, int len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamGet", ExactSpelling = true)] + public static extern int AudioStreamGet([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, void* buf, int len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamAvailable", ExactSpelling = true)] + public static extern int AudioStreamAvailable([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamFlush", ExactSpelling = true)] + public static extern int AudioStreamFlush([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamClear", ExactSpelling = true)] + public static extern void AudioStreamClear([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeAudioStream", ExactSpelling = true)] + public static extern void FreeAudioStream([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudio", ExactSpelling = true)] + public static extern void MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("Uint32")] uint len, int volume); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudioFormat", ExactSpelling = true)] + public static extern void MixAudioFormat([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("SDL_AudioFormat")] ushort format, [NativeTypeName("Uint32")] uint len, int volume); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueueAudio", ExactSpelling = true)] + public static extern int QueueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, [NativeTypeName("const void *")] void* data, [NativeTypeName("Uint32")] uint len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DequeueAudio", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint DequeueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, void* data, [NativeTypeName("Uint32")] uint len); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetQueuedAudioSize", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetQueuedAudioSize([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearQueuedAudio", ExactSpelling = true)] + public static extern void ClearQueuedAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudio", ExactSpelling = true)] + public static extern void LockAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudioDevice", ExactSpelling = true)] + public static extern void LockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudio", ExactSpelling = true)] + public static extern void UnlockAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudioDevice", ExactSpelling = true)] + public static extern void UnlockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudio", ExactSpelling = true)] + public static extern void CloseAudio(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudioDevice", ExactSpelling = true)] + public static extern void CloseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); + + [NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFF)")] + public const int SDL_AUDIO_MASK_BITSIZE = (0xFF); + + [NativeTypeName("#define SDL_AUDIO_MASK_DATATYPE (1<<8)")] + public const int SDL_AUDIO_MASK_DATATYPE = (1 << 8); + + [NativeTypeName("#define SDL_AUDIO_MASK_ENDIAN (1<<12)")] + public const int SDL_AUDIO_MASK_ENDIAN = (1 << 12); + + [NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1<<15)")] + public const int SDL_AUDIO_MASK_SIGNED = (1 << 15); + + [NativeTypeName("#define AUDIO_U8 0x0008")] + public const int AUDIO_U8 = 0x0008; + + [NativeTypeName("#define AUDIO_S8 0x8008")] + public const int AUDIO_S8 = 0x8008; + + [NativeTypeName("#define AUDIO_U16LSB 0x0010")] + public const int AUDIO_U16LSB = 0x0010; + + [NativeTypeName("#define AUDIO_S16LSB 0x8010")] + public const int AUDIO_S16LSB = 0x8010; + + [NativeTypeName("#define AUDIO_U16MSB 0x1010")] + public const int AUDIO_U16MSB = 0x1010; + + [NativeTypeName("#define AUDIO_S16MSB 0x9010")] + public const int AUDIO_S16MSB = 0x9010; + + [NativeTypeName("#define AUDIO_U16 AUDIO_U16LSB")] + public const int AUDIO_U16 = 0x0010; + + [NativeTypeName("#define AUDIO_S16 AUDIO_S16LSB")] + public const int AUDIO_S16 = 0x8010; + + [NativeTypeName("#define AUDIO_S32LSB 0x8020")] + public const int AUDIO_S32LSB = 0x8020; + + [NativeTypeName("#define AUDIO_S32MSB 0x9020")] + public const int AUDIO_S32MSB = 0x9020; + + [NativeTypeName("#define AUDIO_S32 AUDIO_S32LSB")] + public const int AUDIO_S32 = 0x8020; + + [NativeTypeName("#define AUDIO_F32LSB 0x8120")] + public const int AUDIO_F32LSB = 0x8120; + + [NativeTypeName("#define AUDIO_F32MSB 0x9120")] + public const int AUDIO_F32MSB = 0x9120; + + [NativeTypeName("#define AUDIO_F32 AUDIO_F32LSB")] + public const int AUDIO_F32 = 0x8120; + + [NativeTypeName("#define AUDIO_U16SYS AUDIO_U16LSB")] + public const int AUDIO_U16SYS = 0x0010; + + [NativeTypeName("#define AUDIO_S16SYS AUDIO_S16LSB")] + public const int AUDIO_S16SYS = 0x8010; + + [NativeTypeName("#define AUDIO_S32SYS AUDIO_S32LSB")] + public const int AUDIO_S32SYS = 0x8020; + + [NativeTypeName("#define AUDIO_F32SYS AUDIO_F32LSB")] + public const int AUDIO_F32SYS = 0x8120; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001")] + public const int SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002")] + public const int SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004")] + public const int SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008")] + public const int SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008; + + [NativeTypeName("#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)")] + public const int SDL_AUDIO_ALLOW_ANY_CHANGE = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008); + + [NativeTypeName("#define SDL_AUDIOCVT_MAX_FILTERS 9")] + public const int SDL_AUDIOCVT_MAX_FILTERS = 9; + + [NativeTypeName("#define SDL_MIX_MAXVOLUME 128")] + public const int SDL_MIX_MAXVOLUME = 128; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ComposeCustomBlendMode", ExactSpelling = true)] + public static extern SDL_BlendMode ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetError", ExactSpelling = true)] + public static extern int SetError([NativeTypeName("const char *")] sbyte* fmt, __arglist); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetError(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetErrorMsg", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* GetErrorMsg([NativeTypeName("char *")] sbyte* errstr, int maxlen); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearError", ExactSpelling = true)] + public static extern void ClearError(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Error", ExactSpelling = true)] + public static extern int Error(SDL_errorcode code); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PumpEvents", ExactSpelling = true)] + public static extern void PumpEvents(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PeepEvents", ExactSpelling = true)] + public static extern int PeepEvents(SDL_Event* events, int numevents, SDL_eventaction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvent", ExactSpelling = true)] + public static extern SDL_bool HasEvent([NativeTypeName("Uint32")] uint type); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvents", ExactSpelling = true)] + public static extern SDL_bool HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvent", ExactSpelling = true)] + public static extern void FlushEvent([NativeTypeName("Uint32")] uint type); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvents", ExactSpelling = true)] + public static extern void FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PollEvent", ExactSpelling = true)] + public static extern int PollEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEvent", ExactSpelling = true)] + public static extern int WaitEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEventTimeout", ExactSpelling = true)] + public static extern int WaitEventTimeout(SDL_Event* @event, int timeout); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PushEvent", ExactSpelling = true)] + public static extern int PushEvent(SDL_Event* @event); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetEventFilter", ExactSpelling = true)] + public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEventFilter", ExactSpelling = true)] + public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]* filter, void** userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddEventWatch", ExactSpelling = true)] + public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelEventWatch", ExactSpelling = true)] + public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FilterEvents", ExactSpelling = true)] + public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EventState", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte EventState([NativeTypeName("Uint32")] uint type, int state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RegisterEvents", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint RegisterEvents(int numevents); + + [NativeTypeName("#define SDL_RELEASED 0")] + public const int SDL_RELEASED = 0; + + [NativeTypeName("#define SDL_PRESSED 1")] + public const int SDL_PRESSED = 1; + + [NativeTypeName("#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)")] + public const int SDL_TEXTEDITINGEVENT_TEXT_SIZE = (32); + + [NativeTypeName("#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)")] + public const int SDL_TEXTINPUTEVENT_TEXT_SIZE = (32); + + [NativeTypeName("#define SDL_QUERY -1")] + public const int SDL_QUERY = -1; + + [NativeTypeName("#define SDL_IGNORE 0")] + public const int SDL_IGNORE = 0; + + [NativeTypeName("#define SDL_DISABLE 0")] + public const int SDL_DISABLE = 0; + + [NativeTypeName("#define SDL_ENABLE 1")] + public const int SDL_ENABLE = 1; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDToString", ExactSpelling = true)] + public static extern void GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDFromString", ExactSpelling = true)] + public static extern SDL_GUID GUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHintWithPriority", ExactSpelling = true)] + public static extern SDL_bool SetHintWithPriority([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value, SDL_HintPriority priority); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)] + public static extern SDL_bool SetHint([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHint", ExactSpelling = true)] + public static extern SDL_bool ResetHint([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHints", ExactSpelling = true)] + public static extern void ResetHints(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHint", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetHint([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHintBoolean", ExactSpelling = true)] + public static extern SDL_bool GetHintBoolean([NativeTypeName("const char *")] sbyte* name, SDL_bool default_value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddHintCallback", ExactSpelling = true)] + public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelHintCallback", ExactSpelling = true)] + public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearHints", ExactSpelling = true)] + public static extern void ClearHints(); + + [NativeTypeName("#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"SDL_ACCELEROMETER_AS_JOYSTICK\"")] + public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x4F, 0x4D, 0x45, 0x54, 0x45, 0x52, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] + public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x54, 0x41, 0x42, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x42, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ALLOW_TOPMOST \"SDL_ALLOW_TOPMOST\"")] + public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x4F, 0x50, 0x4D, 0x4F, 0x53, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x4D, 0x41, 0x49, 0x4E, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")] + public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x54, 0x52, 0x41, 0x50, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APP_NAME \"SDL_APP_NAME\"")] + public static ReadOnlySpan SDL_HINT_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS \"SDL_APPLE_TV_CONTROLLER_UI_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x49, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION \"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION\"")] + public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x52, 0x4F, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4F, 0x52, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"SDL_AUDIO_DEVICE_APP_NAME\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"SDL_AUDIO_DEVICE_STREAM_NAME\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x52, 0x4F, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_RESAMPLING_MODE \"SDL_AUDIO_RESAMPLING_MODE\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x52, 0x45, 0x53, 0x41, 0x4D, 0x50, 0x4C, 0x49, 0x4E, 0x47, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_JOYSTICKS \"SDL_AUTO_UPDATE_JOYSTICKS\"")] + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_SENSORS \"SDL_AUTO_UPDATE_SENSORS\"")] + public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x53, 0x45, 0x4E, 0x53, 0x4F, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT \"SDL_BMP_SAVE_LEGACY_FORMAT\"")] + public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x42, 0x4D, 0x50, 0x5F, 0x53, 0x41, 0x56, 0x45, 0x5F, 0x4C, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] + public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x4C, 0x41, 0x59, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x4F, 0x55, 0x4E, 0x44, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x49, 0x46, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] + public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x5F, 0x45, 0x4C, 0x45, 0x4D, 0x45, 0x4E, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] + public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ENABLE_STEAM_CONTROLLERS \"SDL_ENABLE_STEAM_CONTROLLERS\"")] + public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_EVENT_LOGGING \"SDL_EVENT_LOGGING\"")] + public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x5F, 0x4C, 0x4F, 0x47, 0x47, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_FORCE_RAISEWINDOW \"SDL_HINT_FORCE_RAISEWINDOW\"")] + public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x41, 0x49, 0x53, 0x45, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x00 }; + + [NativeTypeName("#define SDL_HINT_FRAMEBUFFER_ACCELERATION \"SDL_FRAMEBUFFER_ACCELERATION\"")] + public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG \"SDL_GAMECONTROLLERCONFIG\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"SDL_GAMECONTROLLERCONFIG_FILE\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLERTYPE \"SDL_GAMECONTROLLERTYPE\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x54, 0x59, 0x50, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES \"SDL_GAMECONTROLLER_IGNORE_DEVICES\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT \"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x5F, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"SDL_GAMECONTROLLER_USE_BUTTON_LABELS\"")] + public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_GRAB_KEYBOARD \"SDL_GRAB_KEYBOARD\"")] + public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")] + public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IDLE_TIMER_DISABLED \"SDL_IOS_IDLE_TIMER_DISABLED\"")] + public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x49, 0x44, 0x4C, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")] + public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")] + public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x5F, 0x55, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"SDL_IME_SUPPORT_EXTENDED_TEXT\"")] + public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x55, 0x50, 0x50, 0x4F, 0x52, 0x54, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")] + public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x49, 0x43, 0x41, 0x54, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS \"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI \"SDL_JOYSTICK_HIDAPI\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"SDL_JOYSTICK_HIDAPI_GAMECUBE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE \"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x52, 0x41, 0x4B, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS \"SDL_JOYSTICK_HIDAPI_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS \"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x43, 0x4F, 0x4D, 0x42, 0x49, 0x4E, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x56, 0x45, 0x52, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LUNA \"SDL_JOYSTICK_HIDAPI_LUNA\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4C, 0x55, 0x4E, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC \"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4E, 0x49, 0x4E, 0x54, 0x45, 0x4E, 0x44, 0x4F, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x48, 0x49, 0x45, 0x4C, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS3 \"SDL_JOYSTICK_HIDAPI_PS3\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x33, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4 \"SDL_JOYSTICK_HIDAPI_PS4\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STADIA \"SDL_JOYSTICK_HIDAPI_STADIA\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x41, 0x44, 0x49, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED \"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x43, 0x4F, 0x4E, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII \"SDL_JOYSTICK_HIDAPI_WII\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX \"SDL_JOYSTICK_HIDAPI_XBOX\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 \"SDL_JOYSTICK_HIDAPI_XBOX_360\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS \"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x57, 0x49, 0x52, 0x45, 0x4C, 0x45, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE \"SDL_JOYSTICK_HIDAPI_XBOX_ONE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT \"SDL_JOYSTICK_RAWINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x43, 0x4F, 0x52, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"SDL_JOYSTICK_ROG_CHAKRAM\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x4F, 0x47, 0x5F, 0x43, 0x48, 0x41, 0x4B, 0x52, 0x41, 0x4D, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_THREAD \"SDL_JOYSTICK_THREAD\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] + public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5F, 0x44, 0x52, 0x4D, 0x5F, 0x4D, 0x41, 0x53, 0x54, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_DIGITAL_HATS \"SDL_LINUX_DIGITAL_HATS\"")] + public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_HAT_DEADZONES \"SDL_LINUX_HAT_DEADZONES\"")] + public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x48, 0x41, 0x54, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"SDL_LINUX_JOYSTICK_CLASSIC\"")] + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"SDL_LINUX_JOYSTICK_DEADZONES\"")] + public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_BACKGROUND_APP \"SDL_MAC_BACKGROUND_APP\"")] + public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x41, 0x50, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")] + public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x43, 0x54, 0x52, 0x4C, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x52, 0x49, 0x47, 0x48, 0x54, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")] + public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x41, 0x54, 0x43, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"SDL_MOUSE_DOUBLE_CLICK_RADIUS\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x44, 0x49, 0x55, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH \"SDL_MOUSE_FOCUS_CLICKTHROUGH\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x54, 0x48, 0x52, 0x4F, 0x55, 0x47, 0x48, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"SDL_MOUSE_NORMAL_SPEED_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x4E, 0x4F, 0x52, 0x4D, 0x41, 0x4C, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x43, 0x45, 0x4E, 0x54, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SCALING \"SDL_MOUSE_RELATIVE_SCALING\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE \"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x5F, 0x4D, 0x4F, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_MOUSE_AUTO_CAPTURE \"SDL_MOUSE_AUTO_CAPTURE\"")] + public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_NO_SIGNAL_HANDLERS \"SDL_NO_SIGNAL_HANDLERS\"")] + public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4E, 0x4F, 0x5F, 0x53, 0x49, 0x47, 0x4E, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x45, 0x53, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_IOS_ORIENTATIONS\"")] + public static ReadOnlySpan SDL_HINT_ORIENTATIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] + public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x4F, 0x4C, 0x4C, 0x5F, 0x53, 0x45, 0x4E, 0x54, 0x49, 0x4E, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_PREFERRED_LOCALES \"SDL_PREFERRED_LOCALES\"")] + public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x52, 0x45, 0x44, 0x5F, 0x4C, 0x4F, 0x43, 0x41, 0x4C, 0x45, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION \"SDL_QTWAYLAND_CONTENT_ORIENTATION\"")] + public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x4E, 0x54, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS \"SDL_QTWAYLAND_WINDOW_FLAGS\"")] + public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x4C, 0x41, 0x47, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_BATCHING \"SDL_RENDER_BATCHING\"")] + public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x42, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_LINE_METHOD \"SDL_RENDER_LINE_METHOD\"")] + public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x4E, 0x45, 0x5F, 0x4D, 0x45, 0x54, 0x48, 0x4F, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x31, 0x31, 0x5F, 0x44, 0x45, 0x42, 0x55, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"SDL_RENDER_DIRECT3D_THREADSAFE\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x53, 0x41, 0x46, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] + public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"SDL_RENDER_LOGICAL_SIZE_MODE\"")] + public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_OPENGL_SHADERS \"SDL_RENDER_OPENGL_SHADERS\"")] + public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_SCALE_QUALITY \"SDL_RENDER_SCALE_QUALITY\"")] + public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x5F, 0x51, 0x55, 0x41, 0x4C, 0x49, 0x54, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RENDER_VSYNC \"SDL_RENDER_VSYNC\"")] + public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_PS2_DYNAMIC_VSYNC \"SDL_PS2_DYNAMIC_VSYNC\"")] + public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x53, 0x32, 0x5F, 0x44, 0x59, 0x4E, 0x41, 0x4D, 0x49, 0x43, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RETURN_KEY_HIDES_IME \"SDL_RETURN_KEY_HIDES_IME\"")] + public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x53, 0x5F, 0x49, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] + public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x50, 0x49, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME\"")] + public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x5F, 0x49, 0x4E, 0x48, 0x49, 0x42, 0x49, 0x54, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL\"")] + public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x45, 0x41, 0x4C, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_PRIORITY_POLICY \"SDL_THREAD_PRIORITY_POLICY\"")] + public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x50, 0x52, 0x49, 0x4F, 0x52, 0x49, 0x54, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_THREAD_STACK_SIZE \"SDL_THREAD_STACK_SIZE\"")] + public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x53, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TIMER_RESOLUTION \"SDL_TIMER_RESOLUTION\"")] + public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x52, 0x45, 0x53, 0x4F, 0x4C, 0x55, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TOUCH_MOUSE_EVENTS \"SDL_TOUCH_MOUSE_EVENTS\"")] + public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE \"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE\"")] + public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x56, 0x49, 0x54, 0x41, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"SDL_TV_REMOTE_AS_JOYSTICK\"")] + public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x47, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x52, 0x41, 0x4E, 0x53, 0x50, 0x41, 0x52, 0x45, 0x4E, 0x43, 0x59, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT \"SDL_VIDEO_EXTERNAL_CONTEXT\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x58, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"SDL_VIDEO_HIGHDPI_DISABLED\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x48, 0x49, 0x47, 0x48, 0x44, 0x50, 0x49, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x46, 0x55, 0x4C, 0x4C, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x53, 0x50, 0x41, 0x43, 0x45, 0x53, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x49, 0x4E, 0x49, 0x4D, 0x49, 0x5A, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x4C, 0x4F, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR \"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION \"SDL_VIDEO_WAYLAND_MODE_EMULATION\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP \"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5F, 0x50, 0x49, 0x58, 0x45, 0x4C, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"SDL_VIDEO_FOREIGN_WINDOW_OPENGL\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"SDL_VIDEO_FOREIGN_WINDOW_VULKAN\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x55, 0x4C, 0x4B, 0x41, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x5F, 0x44, 0x33, 0x44, 0x43, 0x4F, 0x4D, 0x50, 0x49, 0x4C, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_FORCE_EGL \"SDL_VIDEO_X11_FORCE_EGL\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x45, 0x47, 0x4C, 0x00 }; + + [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x42, 0x59, 0x50, 0x41, 0x53, 0x53, 0x5F, 0x43, 0x4F, 0x4D, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x4F, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_PING \"SDL_VIDEO_X11_NET_WM_PING\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"SDL_VIDEO_X11_WINDOW_VISUALID\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x49, 0x53, 0x55, 0x41, 0x4C, 0x49, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XINERAMA \"SDL_VIDEO_X11_XINERAMA\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x49, 0x4E, 0x45, 0x52, 0x41, 0x4D, 0x41, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XRANDR \"SDL_VIDEO_X11_XRANDR\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x52, 0x41, 0x4E, 0x44, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEO_X11_XVIDMODE \"SDL_VIDEO_X11_XVIDMODE\"")] + public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x56, 0x49, 0x44, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_FACT_CHUNK \"SDL_WAVE_FACT_CHUNK\"")] + public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x46, 0x41, 0x43, 0x54, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE \"SDL_WAVE_RIFF_CHUNK_SIZE\"")] + public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x52, 0x49, 0x46, 0x46, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WAVE_TRUNCATION \"SDL_WAVE_TRUNCATION\"")] + public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x54, 0x52, 0x55, 0x4E, 0x43, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING \"SDL_WINDOWS_DISABLE_THREAD_NAMING\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x4E, 0x41, 0x4D, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS \"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x4E, 0x55, 0x5F, 0x4D, 0x4E, 0x45, 0x4D, 0x4F, 0x4E, 0x49, 0x43, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x4C, 0x4F, 0x4F, 0x50, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS \"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4D, 0x55, 0x54, 0x45, 0x58, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x53, 0x45, 0x4D, 0x41, 0x50, 0x48, 0x4F, 0x52, 0x45, 0x5F, 0x4B, 0x45, 0x52, 0x4E, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON \"SDL_WINDOWS_INTRESOURCE_ICON\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"SDL_WINDOWS_INTRESOURCE_ICON_SMALL\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x5F, 0x53, 0x4D, 0x41, 0x4C, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x4E, 0x4F, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x46, 0x34, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x33, 0x44, 0x39, 0x45, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_AWARENESS \"SDL_WINDOWS_DPI_AWARENESS\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x41, 0x57, 0x41, 0x52, 0x45, 0x4E, 0x45, 0x53, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_SCALING \"SDL_WINDOWS_DPI_SCALING\"")] + public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN\"")] + public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x43, 0x55, 0x52, 0x53, 0x4F, 0x52, 0x5F, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN \"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN\"")] + public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4E, 0x4F, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x5F, 0x57, 0x48, 0x45, 0x4E, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] + public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] + public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x55, 0x52, 0x4C, 0x00 }; + + [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] + public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x5F, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x00 }; + + [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] + public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_DIRECTINPUT_ENABLED \"SDL_DIRECTINPUT_ENABLED\"")] + public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; + + [NativeTypeName("#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING\"")] + public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x4F, 0x4C, 0x44, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x4D, 0x41, 0x50, 0x50, 0x49, 0x4E, 0x47, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"SDL_AUDIO_INCLUDE_MONITORS\"")] + public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x49, 0x4E, 0x43, 0x4C, 0x55, 0x44, 0x45, 0x5F, 0x4D, 0x4F, 0x4E, 0x49, 0x54, 0x4F, 0x52, 0x53, 0x00 }; + + [NativeTypeName("#define SDL_HINT_X11_WINDOW_TYPE \"SDL_X11_WINDOW_TYPE\"")] + public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"SDL_QUIT_ON_LAST_WINDOW_CLOSE\"")] + public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x55, 0x49, 0x54, 0x5F, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x53, 0x54, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x00 }; + + [NativeTypeName("#define SDL_HINT_VIDEODRIVER \"SDL_VIDEODRIVER\"")] + public static ReadOnlySpan SDL_HINT_VIDEODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_AUDIODRIVER \"SDL_AUDIODRIVER\"")] + public static ReadOnlySpan SDL_HINT_AUDIODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; + + [NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")] + public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x45, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY \"SDL_TRACKPAD_IS_TOUCH_ONLY\"")] + public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x52, 0x41, 0x43, 0x4B, 0x50, 0x41, 0x44, 0x5F, 0x49, 0x53, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4F, 0x4E, 0x4C, 0x59, 0x00 }; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockJoysticks", ExactSpelling = true)] + public static extern void LockJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockJoysticks", ExactSpelling = true)] + public static extern void UnlockJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NumJoysticks", ExactSpelling = true)] + public static extern int NumJoysticks(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNameForIndex", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickNameForIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPathForIndex", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickPathForIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDevicePlayerIndex", ExactSpelling = true)] + public static extern int JoystickGetDevicePlayerIndex(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceGUID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetDeviceGUID(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceVendor", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceVendor(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProduct", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceProduct(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProductVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetDeviceProductVersion(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceType", ExactSpelling = true)] + public static extern SDL_JoystickType JoystickGetDeviceType(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickID")] + public static extern int JoystickGetDeviceInstanceID(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickOpen", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickOpen(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickFromInstanceID([NativeTypeName("SDL_JoystickID")] int instance_id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromPlayerIndex", ExactSpelling = true)] + [return: NativeTypeName("SDL_Joystick *")] + public static extern _SDL_Joystick* JoystickFromPlayerIndex(int player_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtual", ExactSpelling = true)] + public static extern int JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtualEx", ExactSpelling = true)] + public static extern int JoystickAttachVirtualEx([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickDetachVirtual", ExactSpelling = true)] + public static extern int JoystickDetachVirtual(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickIsVirtual", ExactSpelling = true)] + public static extern SDL_bool JoystickIsVirtual(int device_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualAxis", ExactSpelling = true)] + public static extern int JoystickSetVirtualAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualButton", ExactSpelling = true)] + public static extern int JoystickSetVirtualButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualHat", ExactSpelling = true)] + public static extern int JoystickSetVirtualHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickName([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPath", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickPath([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetPlayerIndex", ExactSpelling = true)] + public static extern int JoystickGetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetPlayerIndex", ExactSpelling = true)] + public static extern void JoystickSetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int player_index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetGUID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetVendor", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetVendor([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProduct", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetProduct([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProductVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetProductVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetFirmwareVersion", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort JoystickGetFirmwareVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetSerial", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* JoystickGetSerial([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetType", ExactSpelling = true)] + public static extern SDL_JoystickType JoystickGetType([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDString", ExactSpelling = true)] + public static extern void JoystickGetGUIDString([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDFromString", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickGUID")] + public static extern SDL_GUID JoystickGetGUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetJoystickGUIDInfo", ExactSpelling = true)] + public static extern void GetJoystickGUIDInfo([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAttached", ExactSpelling = true)] + public static extern SDL_bool JoystickGetAttached([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickInstanceID", ExactSpelling = true)] + [return: NativeTypeName("SDL_JoystickID")] + public static extern int JoystickInstanceID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumAxes", ExactSpelling = true)] + public static extern int JoystickNumAxes([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumBalls", ExactSpelling = true)] + public static extern int JoystickNumBalls([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumHats", ExactSpelling = true)] + public static extern int JoystickNumHats([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumButtons", ExactSpelling = true)] + public static extern int JoystickNumButtons([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickUpdate", ExactSpelling = true)] + public static extern void JoystickUpdate(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickEventState", ExactSpelling = true)] + public static extern int JoystickEventState(int state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxis", ExactSpelling = true)] + [return: NativeTypeName("Sint16")] + public static extern short JoystickGetAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxisInitialState", ExactSpelling = true)] + public static extern SDL_bool JoystickGetAxisInitialState([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetHat", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte JoystickGetHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetBall", ExactSpelling = true)] + public static extern int JoystickGetBall([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int ball, int* dx, int* dy); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetButton", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte JoystickGetButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumble", ExactSpelling = true)] + public static extern int JoystickRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumbleTriggers", ExactSpelling = true)] + public static extern int JoystickRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasLED", ExactSpelling = true)] + public static extern SDL_bool JoystickHasLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumble", ExactSpelling = true)] + public static extern SDL_bool JoystickHasRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumbleTriggers", ExactSpelling = true)] + public static extern SDL_bool JoystickHasRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetLED", ExactSpelling = true)] + public static extern int JoystickSetLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSendEffect", ExactSpelling = true)] + public static extern int JoystickSendEffect([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("const void *")] void* data, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickClose", ExactSpelling = true)] + public static extern void JoystickClose([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickCurrentPowerLevel", ExactSpelling = true)] + public static extern SDL_JoystickPowerLevel JoystickCurrentPowerLevel([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); + + [NativeTypeName("#define SDL_IPHONE_MAX_GFORCE 5.0")] + public const double SDL_IPHONE_MAX_GFORCE = 5.0; + + [NativeTypeName("#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1")] + public const int SDL_VIRTUAL_JOYSTICK_DESC_VERSION = 1; + + [NativeTypeName("#define SDL_JOYSTICK_AXIS_MAX 32767")] + public const int SDL_JOYSTICK_AXIS_MAX = 32767; + + [NativeTypeName("#define SDL_JOYSTICK_AXIS_MIN -32768")] + public const int SDL_JOYSTICK_AXIS_MIN = -32768; + + [NativeTypeName("#define SDL_HAT_CENTERED 0x00")] + public const int SDL_HAT_CENTERED = 0x00; + + [NativeTypeName("#define SDL_HAT_UP 0x01")] + public const int SDL_HAT_UP = 0x01; + + [NativeTypeName("#define SDL_HAT_RIGHT 0x02")] + public const int SDL_HAT_RIGHT = 0x02; + + [NativeTypeName("#define SDL_HAT_DOWN 0x04")] + public const int SDL_HAT_DOWN = 0x04; + + [NativeTypeName("#define SDL_HAT_LEFT 0x08")] + public const int SDL_HAT_LEFT = 0x08; + + [NativeTypeName("#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)")] + public const int SDL_HAT_RIGHTUP = (0x02 | 0x01); + + [NativeTypeName("#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)")] + public const int SDL_HAT_RIGHTDOWN = (0x02 | 0x04); + + [NativeTypeName("#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)")] + public const int SDL_HAT_LEFTUP = (0x08 | 0x01); + + [NativeTypeName("#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)")] + public const int SDL_HAT_LEFTDOWN = (0x08 | 0x04); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardFocus", ExactSpelling = true)] + public static extern SDL_Window* GetKeyboardFocus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardState", ExactSpelling = true)] + [return: NativeTypeName("const Uint8 *")] + public static extern byte* GetKeyboardState(int* numkeys); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetKeyboard", ExactSpelling = true)] + public static extern void ResetKeyboard(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetModState", ExactSpelling = true)] + public static extern SDL_Keymod GetModState(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetModState", ExactSpelling = true)] + public static extern void SetModState(SDL_Keymod modstate); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromScancode", ExactSpelling = true)] + [return: NativeTypeName("SDL_Keycode")] + public static extern int GetKeyFromScancode(SDL_Scancode scancode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromKey", ExactSpelling = true)] + public static extern SDL_Scancode GetScancodeFromKey([NativeTypeName("SDL_Keycode")] int key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetScancodeName(SDL_Scancode scancode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromName", ExactSpelling = true)] + public static extern SDL_Scancode GetScancodeFromName([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetKeyName([NativeTypeName("SDL_Keycode")] int key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromName", ExactSpelling = true)] + [return: NativeTypeName("SDL_Keycode")] + public static extern int GetKeyFromName([NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StartTextInput", ExactSpelling = true)] + public static extern void StartTextInput(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputActive", ExactSpelling = true)] + public static extern SDL_bool IsTextInputActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StopTextInput", ExactSpelling = true)] + public static extern void StopTextInput(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearComposition", ExactSpelling = true)] + public static extern void ClearComposition(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputShown", ExactSpelling = true)] + public static extern SDL_bool IsTextInputShown(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextInputRect", ExactSpelling = true)] + public static extern void SetTextInputRect([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasScreenKeyboardSupport", ExactSpelling = true)] + public static extern SDL_bool HasScreenKeyboardSupport(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenKeyboardShown", ExactSpelling = true)] + public static extern SDL_bool IsScreenKeyboardShown(SDL_Window* window); + + [NativeTypeName("#define SDLK_SCANCODE_MASK (1<<30)")] + public const int SDLK_SCANCODE_MASK = (1 << 30); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseFocus", ExactSpelling = true)] + public static extern SDL_Window* GetMouseFocus(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGlobalMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetGlobalMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseState", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetRelativeMouseState(int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseInWindow", ExactSpelling = true)] + public static extern void WarpMouseInWindow(SDL_Window* window, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseGlobal", ExactSpelling = true)] + public static extern int WarpMouseGlobal(int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRelativeMouseMode", ExactSpelling = true)] + public static extern int SetRelativeMouseMode(SDL_bool enabled); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CaptureMouse", ExactSpelling = true)] + public static extern int CaptureMouse(SDL_bool enabled); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseMode", ExactSpelling = true)] + public static extern SDL_bool GetRelativeMouseMode(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateColorCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSystemCursor", ExactSpelling = true)] + public static extern SDL_Cursor* CreateSystemCursor(SDL_SystemCursor id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetCursor", ExactSpelling = true)] + public static extern void SetCursor(SDL_Cursor* cursor); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCursor", ExactSpelling = true)] + public static extern SDL_Cursor* GetCursor(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultCursor", ExactSpelling = true)] + public static extern SDL_Cursor* GetDefaultCursor(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeCursor", ExactSpelling = true)] + public static extern void FreeCursor(SDL_Cursor* cursor); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowCursor", ExactSpelling = true)] + public static extern int ShowCursor(int toggle); + + [NativeTypeName("#define SDL_BUTTON_LEFT 1")] + public const int SDL_BUTTON_LEFT = 1; + + [NativeTypeName("#define SDL_BUTTON_MIDDLE 2")] + public const int SDL_BUTTON_MIDDLE = 2; + + [NativeTypeName("#define SDL_BUTTON_RIGHT 3")] + public const int SDL_BUTTON_RIGHT = 3; + + [NativeTypeName("#define SDL_BUTTON_X1 4")] + public const int SDL_BUTTON_X1 = 4; + + [NativeTypeName("#define SDL_BUTTON_X2 5")] + public const int SDL_BUTTON_X2 = 5; + + [NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)")] + public const int SDL_BUTTON_LMASK = (1 << ((1) - 1)); + + [NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)")] + public const int SDL_BUTTON_MMASK = (1 << ((2) - 1)); + + [NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)")] + public const int SDL_BUTTON_RMASK = (1 << ((3) - 1)); + + [NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)")] + public const int SDL_BUTTON_X1MASK = (1 << ((4) - 1)); + + [NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)")] + public const int SDL_BUTTON_X2MASK = (1 << ((5) - 1)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetPixelFormatName([NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PixelFormatEnumToMasks", ExactSpelling = true)] + public static extern SDL_bool PixelFormatEnumToMasks([NativeTypeName("Uint32")] uint format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MasksToPixelFormatEnum", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MasksToPixelFormatEnum(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocFormat", ExactSpelling = true)] + public static extern SDL_PixelFormat* AllocFormat([NativeTypeName("Uint32")] uint pixel_format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeFormat", ExactSpelling = true)] + public static extern void FreeFormat(SDL_PixelFormat* format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocPalette", ExactSpelling = true)] + public static extern SDL_Palette* AllocPalette(int ncolors); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPixelFormatPalette", ExactSpelling = true)] + public static extern int SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPaletteColors", ExactSpelling = true)] + public static extern int SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreePalette", ExactSpelling = true)] + public static extern void FreePalette(SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGB", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGBA", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGB", ExactSpelling = true)] + public static extern void GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGBA", ExactSpelling = true)] + public static extern void 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); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CalculateGammaRamp", ExactSpelling = true)] + public static extern void CalculateGammaRamp(float gamma, [NativeTypeName("Uint16 *")] ushort* ramp); + + [NativeTypeName("#define SDL_ALPHA_OPAQUE 255")] + public const int SDL_ALPHA_OPAQUE = 255; + + [NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")] + public const int SDL_ALPHA_TRANSPARENT = 0; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumRenderDrivers", ExactSpelling = true)] + public static extern int GetNumRenderDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDriverInfo", ExactSpelling = true)] + public static extern int GetRenderDriverInfo(int index, SDL_RendererInfo* info); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowAndRenderer", ExactSpelling = true)] + public static extern int CreateWindowAndRenderer(int width, int height, [NativeTypeName("Uint32")] uint window_flags, SDL_Window** window, SDL_Renderer** renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* CreateRenderer(SDL_Window* window, int index, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSoftwareRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* CreateSoftwareRenderer(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderer", ExactSpelling = true)] + public static extern SDL_Renderer* GetRenderer(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetWindow", ExactSpelling = true)] + public static extern SDL_Window* RenderGetWindow(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererInfo", ExactSpelling = true)] + public static extern int GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererOutputSize", ExactSpelling = true)] + public static extern int GetRendererOutputSize(SDL_Renderer* renderer, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTexture", ExactSpelling = true)] + public static extern SDL_Texture* CreateTexture(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint format, int access, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTextureFromSurface", ExactSpelling = true)] + public static extern SDL_Texture* CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueryTexture", ExactSpelling = true)] + public static extern int QueryTexture(SDL_Texture* texture, [NativeTypeName("Uint32 *")] uint* format, int* access, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureColorMod", ExactSpelling = true)] + public static extern int SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureColorMod", ExactSpelling = true)] + public static extern int GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureAlphaMod", ExactSpelling = true)] + public static extern int SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureAlphaMod", ExactSpelling = true)] + public static extern int GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureBlendMode", ExactSpelling = true)] + public static extern int SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureBlendMode", ExactSpelling = true)] + public static extern int GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureScaleMode", ExactSpelling = true)] + public static extern int SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureScaleMode", ExactSpelling = true)] + public static extern int GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureUserData", ExactSpelling = true)] + public static extern int SetTextureUserData(SDL_Texture* texture, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureUserData", ExactSpelling = true)] + public static extern void* GetTextureUserData(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateTexture", ExactSpelling = true)] + public static extern int UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] void* pixels, int pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateYUVTexture", ExactSpelling = true)] + public static extern int UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateNVTexture", ExactSpelling = true)] + public static extern int UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTexture", ExactSpelling = true)] + public static extern int LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, void** pixels, int* pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTextureToSurface", ExactSpelling = true)] + public static extern int LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockTexture", ExactSpelling = true)] + public static extern void UnlockTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderTargetSupported", ExactSpelling = true)] + public static extern SDL_bool RenderTargetSupported(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderTarget", ExactSpelling = true)] + public static extern int SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderTarget", ExactSpelling = true)] + public static extern SDL_Texture* GetRenderTarget(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetLogicalSize", ExactSpelling = true)] + public static extern int RenderSetLogicalSize(SDL_Renderer* renderer, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetLogicalSize", ExactSpelling = true)] + public static extern void RenderGetLogicalSize(SDL_Renderer* renderer, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetIntegerScale", ExactSpelling = true)] + public static extern int RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetIntegerScale", ExactSpelling = true)] + public static extern SDL_bool RenderGetIntegerScale(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetViewport", ExactSpelling = true)] + public static extern int RenderSetViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetViewport", ExactSpelling = true)] + public static extern void RenderGetViewport(SDL_Renderer* renderer, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetClipRect", ExactSpelling = true)] + public static extern int RenderSetClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetClipRect", ExactSpelling = true)] + public static extern void RenderGetClipRect(SDL_Renderer* renderer, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderIsClipEnabled", ExactSpelling = true)] + public static extern SDL_bool RenderIsClipEnabled(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetScale", ExactSpelling = true)] + public static extern int RenderSetScale(SDL_Renderer* renderer, float scaleX, float scaleY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetScale", ExactSpelling = true)] + public static extern void RenderGetScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderWindowToLogical", ExactSpelling = true)] + public static extern void RenderWindowToLogical(SDL_Renderer* renderer, int windowX, int windowY, float* logicalX, float* logicalY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderLogicalToWindow", ExactSpelling = true)] + public static extern void RenderLogicalToWindow(SDL_Renderer* renderer, float logicalX, float logicalY, int* windowX, int* windowY); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawColor", ExactSpelling = true)] + public static extern int SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawColor", ExactSpelling = true)] + public static extern int GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawBlendMode", ExactSpelling = true)] + public static extern int SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawBlendMode", ExactSpelling = true)] + public static extern int GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderClear", ExactSpelling = true)] + public static extern int RenderClear(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoint", ExactSpelling = true)] + public static extern int RenderDrawPoint(SDL_Renderer* renderer, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoints", ExactSpelling = true)] + public static extern int RenderDrawPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLine", ExactSpelling = true)] + public static extern int RenderDrawLine(SDL_Renderer* renderer, int x1, int y1, int x2, int y2); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLines", ExactSpelling = true)] + public static extern int RenderDrawLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRect", ExactSpelling = true)] + public static extern int RenderDrawRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRects", ExactSpelling = true)] + public static extern int RenderDrawRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRect", ExactSpelling = true)] + public static extern int RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRects", ExactSpelling = true)] + public static extern int RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopy", ExactSpelling = true)] + public static extern int RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyEx", ExactSpelling = true)] + public static extern int RenderCopyEx(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_Point *")] SDL_Point* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointF", ExactSpelling = true)] + public static extern int RenderDrawPointF(SDL_Renderer* renderer, float x, float y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointsF", ExactSpelling = true)] + public static extern int RenderDrawPointsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLineF", ExactSpelling = true)] + public static extern int RenderDrawLineF(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLinesF", ExactSpelling = true)] + public static extern int RenderDrawLinesF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectF", ExactSpelling = true)] + public static extern int RenderDrawRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectsF", ExactSpelling = true)] + public static extern int RenderDrawRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectF", ExactSpelling = true)] + public static extern int RenderFillRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectsF", ExactSpelling = true)] + public static extern int RenderFillRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyF", ExactSpelling = true)] + public static extern int RenderCopyF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyExF", ExactSpelling = true)] + public static extern int RenderCopyExF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometry", ExactSpelling = true)] + public static extern int 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("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometryRaw", ExactSpelling = true)] + public static extern int 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 *")] void* indices, int num_indices, int size_indices); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderReadPixels", ExactSpelling = true)] + public static extern int RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint format, void* pixels, int pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderPresent", ExactSpelling = true)] + public static extern void RenderPresent(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyTexture", ExactSpelling = true)] + public static extern void DestroyTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyRenderer", ExactSpelling = true)] + public static extern void DestroyRenderer(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFlush", ExactSpelling = true)] + public static extern int RenderFlush(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_BindTexture", ExactSpelling = true)] + public static extern int GL_BindTexture(SDL_Texture* texture, float* texw, float* texh); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnbindTexture", ExactSpelling = true)] + public static extern int GL_UnbindTexture(SDL_Texture* texture); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalLayer", ExactSpelling = true)] + public static extern void* RenderGetMetalLayer(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalCommandEncoder", ExactSpelling = true)] + public static extern void* RenderGetMetalCommandEncoder(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetVSync", ExactSpelling = true)] + public static extern int RenderSetVSync(SDL_Renderer* renderer, int vsync); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFile", ExactSpelling = true)] + public static extern SDL_RWops* RWFromFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("const char *")] sbyte* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFP", ExactSpelling = true)] + public static extern SDL_RWops* RWFromFP(void* fp, SDL_bool autoclose); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromMem", ExactSpelling = true)] + public static extern SDL_RWops* RWFromMem(void* mem, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromConstMem", ExactSpelling = true)] + public static extern SDL_RWops* RWFromConstMem([NativeTypeName("const void *")] void* mem, int size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocRW", ExactSpelling = true)] + public static extern SDL_RWops* AllocRW(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeRW", ExactSpelling = true)] + public static extern void FreeRW(SDL_RWops* area); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWsize", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWsize(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWseek", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWseek(SDL_RWops* context, [NativeTypeName("Sint64")] long offset, int whence); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWtell", ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long RWtell(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWread", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint maxnum); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWwrite", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint num); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWclose", ExactSpelling = true)] + public static extern int RWclose(SDL_RWops* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile_RW", ExactSpelling = true)] + public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] nuint* datasize, int freesrc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile", ExactSpelling = true)] + public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] nuint* datasize); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadU8", ExactSpelling = true)] + [return: NativeTypeName("Uint8")] + public static extern byte ReadU8(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE16", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort ReadLE16(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE16", ExactSpelling = true)] + [return: NativeTypeName("Uint16")] + public static extern ushort ReadBE16(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE32", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint ReadLE32(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE32", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint ReadBE32(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE64", ExactSpelling = true)] + [return: NativeTypeName("Uint64")] + public static extern ulong ReadLE64(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE64", ExactSpelling = true)] + [return: NativeTypeName("Uint64")] + public static extern ulong ReadBE64(SDL_RWops* src); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteU8", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE16", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE16", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE32", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE32", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE64", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE64", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); + + [NativeTypeName("#define SDL_RWOPS_UNKNOWN 0U")] + public const uint SDL_RWOPS_UNKNOWN = 0U; + + [NativeTypeName("#define SDL_RWOPS_WINFILE 1U")] + public const uint SDL_RWOPS_WINFILE = 1U; + + [NativeTypeName("#define SDL_RWOPS_STDFILE 2U")] + public const uint SDL_RWOPS_STDFILE = 2U; + + [NativeTypeName("#define SDL_RWOPS_JNIFILE 3U")] + public const uint SDL_RWOPS_JNIFILE = 3U; + + [NativeTypeName("#define SDL_RWOPS_MEMORY 4U")] + public const uint SDL_RWOPS_MEMORY = 4U; + + [NativeTypeName("#define SDL_RWOPS_MEMORY_RO 5U")] + public const uint SDL_RWOPS_MEMORY_RO = 5U; + + [NativeTypeName("#define RW_SEEK_SET 0")] + public const int RW_SEEK_SET = 0; + + [NativeTypeName("#define RW_SEEK_CUR 1")] + public const int RW_SEEK_CUR = 1; + + [NativeTypeName("#define RW_SEEK_END 2")] + public const int RW_SEEK_END = 2; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_malloc", ExactSpelling = true)] + public static extern void* malloc([NativeTypeName("size_t")] nuint size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_calloc", ExactSpelling = true)] + public static extern void* calloc([NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_realloc", ExactSpelling = true)] + public static extern void* realloc(void* mem, [NativeTypeName("size_t")] nuint size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)] + public static extern void free(void* mem); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetOriginalMemoryFunctions", ExactSpelling = true)] + public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMemoryFunctions", ExactSpelling = true)] + public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMemoryFunctions", ExactSpelling = true)] + public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl] malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl] calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl] realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl] free_func); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAllocations", ExactSpelling = true)] + public static extern int GetNumAllocations(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strcasestr", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* strcasestr([NativeTypeName("const char *")] sbyte* haystack, [NativeTypeName("const char *")] sbyte* needle); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_open", ExactSpelling = true)] + [return: NativeTypeName("SDL_iconv_t")] + public static extern _SDL_iconv_t* iconv_open([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_close", ExactSpelling = true)] + public static extern int iconv_close([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv", ExactSpelling = true)] + [return: NativeTypeName("size_t")] + public static extern nuint iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] nuint* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] nuint* outbytesleft); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_string", ExactSpelling = true)] + [return: NativeTypeName("char *")] + public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] nuint inbytesleft); + + [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] + public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL; + + [NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")] + public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F)); + + [NativeTypeName("#define SDL_MIN_SINT8 ((Sint8)(~0x7F))")] + public const sbyte SDL_MIN_SINT8 = ((sbyte)(~0x7F)); + + [NativeTypeName("#define SDL_MAX_UINT8 ((Uint8)0xFF)")] + public const byte SDL_MAX_UINT8 = ((byte)(0xFF)); + + [NativeTypeName("#define SDL_MIN_UINT8 ((Uint8)0x00)")] + public const byte SDL_MIN_UINT8 = ((byte)(0x00)); + + [NativeTypeName("#define SDL_MAX_SINT16 ((Sint16)0x7FFF)")] + public const short SDL_MAX_SINT16 = ((short)(0x7FFF)); + + [NativeTypeName("#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF))")] + public const short SDL_MIN_SINT16 = ((short)(~0x7FFF)); + + [NativeTypeName("#define SDL_MAX_UINT16 ((Uint16)0xFFFF)")] + public const ushort SDL_MAX_UINT16 = ((ushort)(0xFFFF)); + + [NativeTypeName("#define SDL_MIN_UINT16 ((Uint16)0x0000)")] + public const ushort SDL_MIN_UINT16 = ((ushort)(0x0000)); + + [NativeTypeName("#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF)")] + public const int SDL_MAX_SINT32 = ((int)(0x7FFFFFFF)); + + [NativeTypeName("#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF))")] + public const int SDL_MIN_SINT32 = ((int)(~0x7FFFFFFF)); + + [NativeTypeName("#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu)")] + public const uint SDL_MAX_UINT32 = ((uint)(0xFFFFFFFFU)); + + [NativeTypeName("#define SDL_MIN_UINT32 ((Uint32)0x00000000)")] + public const uint SDL_MIN_UINT32 = ((uint)(0x00000000)); + + [NativeTypeName("#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll)")] + public const long SDL_MAX_SINT64 = ((long)(0x7FFFFFFFFFFFFFFFL)); + + [NativeTypeName("#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll))")] + public const long SDL_MIN_SINT64 = ((long)(~0x7FFFFFFFFFFFFFFFL)); + + [NativeTypeName("#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull)")] + public const ulong SDL_MAX_UINT64 = ((ulong)(0xFFFFFFFFFFFFFFFFUL)); + + [NativeTypeName("#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull))")] + public const ulong SDL_MIN_UINT64 = ((ulong)(0x0000000000000000UL)); + + [NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")] + public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; + + [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] + public static ReadOnlySpan SDL_PRIs64 => new byte[] { 0x49, 0x36, 0x34, 0x64, 0x00 }; + + [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] + public static ReadOnlySpan SDL_PRIu64 => new byte[] { 0x49, 0x36, 0x34, 0x75, 0x00 }; + + [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] + public static ReadOnlySpan SDL_PRIx64 => new byte[] { 0x49, 0x36, 0x34, 0x78, 0x00 }; + + [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] + public static ReadOnlySpan SDL_PRIX64 => new byte[] { 0x49, 0x36, 0x34, 0x58, 0x00 }; + + [NativeTypeName("#define SDL_PRIs32 \"d\"")] + public static ReadOnlySpan SDL_PRIs32 => new byte[] { 0x64, 0x00 }; + + [NativeTypeName("#define SDL_PRIu32 \"u\"")] + public static ReadOnlySpan SDL_PRIu32 => new byte[] { 0x75, 0x00 }; + + [NativeTypeName("#define SDL_PRIx32 \"x\"")] + public static ReadOnlySpan SDL_PRIx32 => new byte[] { 0x78, 0x00 }; + + [NativeTypeName("#define SDL_PRIX32 \"X\"")] + public static ReadOnlySpan SDL_PRIX32 => new byte[] { 0x58, 0x00 }; + + [NativeTypeName("#define M_PI 3.14159265358979323846264338327950288")] + public const double M_PI = 3.14159265358979323846264338327950288; + + [NativeTypeName("#define SDL_ICONV_ERROR (size_t)-1")] + public static readonly nuint SDL_ICONV_ERROR = unchecked((nuint)(-1)); + + [NativeTypeName("#define SDL_ICONV_E2BIG (size_t)-2")] + public static readonly nuint SDL_ICONV_E2BIG = unchecked((nuint)(-2)); + + [NativeTypeName("#define SDL_ICONV_EILSEQ (size_t)-3")] + public static readonly nuint SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); + + [NativeTypeName("#define SDL_ICONV_EINVAL (size_t)-4")] + public static readonly nuint SDL_ICONV_EINVAL = unchecked((nuint)(-4)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurface", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurface([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormat", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceWithFormat([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceFrom", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormatFrom", ExactSpelling = true)] + public static extern SDL_Surface* CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint format); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeSurface", ExactSpelling = true)] + public static extern void FreeSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfacePalette", ExactSpelling = true)] + public static extern int SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockSurface", ExactSpelling = true)] + public static extern int LockSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockSurface", ExactSpelling = true)] + public static extern void UnlockSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadBMP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SaveBMP_RW", ExactSpelling = true)] + public static extern int SaveBMP_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceRLE", ExactSpelling = true)] + public static extern int SetSurfaceRLE(SDL_Surface* surface, int flag); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasSurfaceRLE", ExactSpelling = true)] + public static extern SDL_bool HasSurfaceRLE(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetColorKey", ExactSpelling = true)] + public static extern int SetColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasColorKey", ExactSpelling = true)] + public static extern SDL_bool HasColorKey(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetColorKey", ExactSpelling = true)] + public static extern int GetColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceColorMod", ExactSpelling = true)] + public static extern int SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceColorMod", ExactSpelling = true)] + public static extern int GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceAlphaMod", ExactSpelling = true)] + public static extern int SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceAlphaMod", ExactSpelling = true)] + public static extern int GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceBlendMode", ExactSpelling = true)] + public static extern int SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceBlendMode", ExactSpelling = true)] + public static extern int GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipRect", ExactSpelling = true)] + public static extern SDL_bool SetClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipRect", ExactSpelling = true)] + public static extern void GetClipRect(SDL_Surface* surface, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DuplicateSurface", ExactSpelling = true)] + public static extern SDL_Surface* DuplicateSurface(SDL_Surface* surface); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurface", ExactSpelling = true)] + public static extern SDL_Surface* ConvertSurface(SDL_Surface* src, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* fmt, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurfaceFormat", ExactSpelling = true)] + public static extern SDL_Surface* ConvertSurfaceFormat(SDL_Surface* src, [NativeTypeName("Uint32")] uint pixel_format, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertPixels", ExactSpelling = true)] + public static extern int ConvertPixels(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PremultiplyAlpha", ExactSpelling = true)] + public static extern int PremultiplyAlpha(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRect", ExactSpelling = true)] + public static extern int FillRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRects", ExactSpelling = true)] + public static extern int FillRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlit", ExactSpelling = true)] + public static extern int UpperBlit(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlit", ExactSpelling = true)] + public static extern int LowerBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretch", ExactSpelling = true)] + public static extern int SoftStretch(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretchLinear", ExactSpelling = true)] + public static extern int SoftStretchLinear(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlitScaled", ExactSpelling = true)] + public static extern int UpperBlitScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlitScaled", ExactSpelling = true)] + public static extern int LowerBlitScaled(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetYUVConversionMode", ExactSpelling = true)] + public static extern void SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionMode", ExactSpelling = true)] + public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionMode(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionModeForResolution", ExactSpelling = true)] + public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); + + [NativeTypeName("#define SDL_SWSURFACE 0")] + public const int SDL_SWSURFACE = 0; + + [NativeTypeName("#define SDL_PREALLOC 0x00000001")] + public const int SDL_PREALLOC = 0x00000001; + + [NativeTypeName("#define SDL_RLEACCEL 0x00000002")] + public const int SDL_RLEACCEL = 0x00000002; + + [NativeTypeName("#define SDL_DONTFREE 0x00000004")] + public const int SDL_DONTFREE = 0x00000004; + + [NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008")] + public const int SDL_SIMD_ALIGNED = 0x00000008; + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowsMessageHook", ExactSpelling = true)] + public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Direct3D9GetAdapterIndex", ExactSpelling = true)] + public static extern int Direct3D9GetAdapterIndex(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D9Device", ExactSpelling = true)] + public static extern IDirect3DDevice9* RenderGetD3D9Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D11Device", ExactSpelling = true)] + public static extern ID3D11Device* RenderGetD3D11Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D12Device", ExactSpelling = true)] + public static extern ID3D12Device* RenderGetD3D12Device(SDL_Renderer* renderer); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DXGIGetOutputInfo", ExactSpelling = true)] + public static extern SDL_bool DXGIGetOutputInfo(int displayIndex, int* adapterIndex, int* outputIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTablet", ExactSpelling = true)] + public static extern SDL_bool IsTablet(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillTerminate", ExactSpelling = true)] + public static extern void OnApplicationWillTerminate(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidReceiveMemoryWarning", ExactSpelling = true)] + public static extern void OnApplicationDidReceiveMemoryWarning(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillResignActive", ExactSpelling = true)] + public static extern void OnApplicationWillResignActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidEnterBackground", ExactSpelling = true)] + public static extern void OnApplicationDidEnterBackground(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillEnterForeground", ExactSpelling = true)] + public static extern void OnApplicationWillEnterForeground(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidBecomeActive", ExactSpelling = true)] + public static extern void OnApplicationDidBecomeActive(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVersion", ExactSpelling = true)] + public static extern void GetVersion(SDL_version* ver); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevision", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetRevision(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevisionNumber", ExactSpelling = true)] + public static extern int GetRevisionNumber(); + + [NativeTypeName("#define SDL_MAJOR_VERSION 2")] + public const int SDL_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_MINOR_VERSION 28")] + public const int SDL_MINOR_VERSION = 28; + + [NativeTypeName("#define SDL_PATCHLEVEL 0")] + public const int SDL_PATCHLEVEL = 0; + + [NativeTypeName("#define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)")] + public const int SDL_COMPILEDVERSION = ((2) * 1000 + (28) * 100 + (0)); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDrivers", ExactSpelling = true)] + public static extern int GetNumVideoDrivers(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVideoDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetVideoDriver(int index); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoInit", ExactSpelling = true)] + public static extern int VideoInit([NativeTypeName("const char *")] sbyte* driver_name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoQuit", ExactSpelling = true)] + public static extern void VideoQuit(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentVideoDriver", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetCurrentVideoDriver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDisplays", ExactSpelling = true)] + public static extern int GetNumVideoDisplays(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetDisplayName(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayBounds", ExactSpelling = true)] + public static extern int GetDisplayBounds(int displayIndex, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayUsableBounds", ExactSpelling = true)] + public static extern int GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayDPI", ExactSpelling = true)] + public static extern int GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayOrientation", ExactSpelling = true)] + public static extern SDL_DisplayOrientation GetDisplayOrientation(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumDisplayModes", ExactSpelling = true)] + public static extern int GetNumDisplayModes(int displayIndex); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayMode", ExactSpelling = true)] + public static extern int GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDesktopDisplayMode", ExactSpelling = true)] + public static extern int GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentDisplayMode", ExactSpelling = true)] + public static extern int GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClosestDisplayMode", ExactSpelling = true)] + public static extern SDL_DisplayMode* GetClosestDisplayMode(int displayIndex, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode, SDL_DisplayMode* closest); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPointDisplayIndex", ExactSpelling = true)] + public static extern int GetPointDisplayIndex([NativeTypeName("const SDL_Point *")] SDL_Point* point); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRectDisplayIndex", ExactSpelling = true)] + public static extern int GetRectDisplayIndex([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayIndex", ExactSpelling = true)] + public static extern int GetWindowDisplayIndex(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowDisplayMode", ExactSpelling = true)] + public static extern int SetWindowDisplayMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayMode", ExactSpelling = true)] + public static extern int GetWindowDisplayMode(SDL_Window* window, SDL_DisplayMode* mode); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowICCProfile", ExactSpelling = true)] + public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] nuint* size); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPixelFormat", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowPixelFormat(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindow", ExactSpelling = true)] + public static extern SDL_Window* CreateWindow([NativeTypeName("const char *")] sbyte* title, int x, int y, int w, int h, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowFrom", ExactSpelling = true)] + public static extern SDL_Window* CreateWindowFrom([NativeTypeName("const void *")] void* data); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowID", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowID(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFromID", ExactSpelling = true)] + public static extern SDL_Window* GetWindowFromID([NativeTypeName("Uint32")] uint id); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFlags", ExactSpelling = true)] + [return: NativeTypeName("Uint32")] + public static extern uint GetWindowFlags(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowTitle", ExactSpelling = true)] + public static extern void SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] sbyte* title); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowTitle", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* GetWindowTitle(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowIcon", ExactSpelling = true)] + public static extern void SetWindowIcon(SDL_Window* window, SDL_Surface* icon); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowData", ExactSpelling = true)] + public static extern void* SetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name, void* userdata); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowData", ExactSpelling = true)] + public static extern void* GetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowPosition", ExactSpelling = true)] + public static extern void SetWindowPosition(SDL_Window* window, int x, int y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPosition", ExactSpelling = true)] + public static extern void GetWindowPosition(SDL_Window* window, int* x, int* y); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowSize", ExactSpelling = true)] + public static extern void SetWindowSize(SDL_Window* window, int w, int h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSize", ExactSpelling = true)] + public static extern void GetWindowSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBordersSize", ExactSpelling = true)] + public static extern int GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSizeInPixels", ExactSpelling = true)] + public static extern void GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMinimumSize", ExactSpelling = true)] + public static extern void SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMinimumSize", ExactSpelling = true)] + public static extern void GetWindowMinimumSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMaximumSize", ExactSpelling = true)] + public static extern void SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMaximumSize", ExactSpelling = true)] + public static extern void GetWindowMaximumSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBordered", ExactSpelling = true)] + public static extern void SetWindowBordered(SDL_Window* window, SDL_bool bordered); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowResizable", ExactSpelling = true)] + public static extern void SetWindowResizable(SDL_Window* window, SDL_bool resizable); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowAlwaysOnTop", ExactSpelling = true)] + public static extern void SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowWindow", ExactSpelling = true)] + public static extern void ShowWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)] + public static extern void HideWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RaiseWindow", ExactSpelling = true)] + public static extern void RaiseWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MaximizeWindow", ExactSpelling = true)] + public static extern void MaximizeWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MinimizeWindow", ExactSpelling = true)] + public static extern void MinimizeWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RestoreWindow", ExactSpelling = true)] + public static extern void RestoreWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowFullscreen", ExactSpelling = true)] + public static extern int SetWindowFullscreen(SDL_Window* window, [NativeTypeName("Uint32")] uint flags); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasWindowSurface", ExactSpelling = true)] + public static extern SDL_bool HasWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSurface", ExactSpelling = true)] + public static extern SDL_Surface* GetWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurface", ExactSpelling = true)] + public static extern int UpdateWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurfaceRects", ExactSpelling = true)] + public static extern int UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindowSurface", ExactSpelling = true)] + public static extern int DestroyWindowSurface(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGrab", ExactSpelling = true)] + public static extern void SetWindowGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowKeyboardGrab", ExactSpelling = true)] + public static extern void SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseGrab", ExactSpelling = true)] + public static extern void SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowKeyboardGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowKeyboardGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseGrab", ExactSpelling = true)] + public static extern SDL_bool GetWindowMouseGrab(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGrabbedWindow", ExactSpelling = true)] + public static extern SDL_Window* GetGrabbedWindow(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseRect", ExactSpelling = true)] + public static extern int SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseRect", ExactSpelling = true)] + [return: NativeTypeName("const SDL_Rect *")] + public static extern SDL_Rect* GetWindowMouseRect(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBrightness", ExactSpelling = true)] + public static extern int SetWindowBrightness(SDL_Window* window, float brightness); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBrightness", ExactSpelling = true)] + public static extern float GetWindowBrightness(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)] + public static extern int SetWindowOpacity(SDL_Window* window, float opacity); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowOpacity", ExactSpelling = true)] + public static extern int GetWindowOpacity(SDL_Window* window, float* out_opacity); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowModalFor", ExactSpelling = true)] + public static extern int SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowInputFocus", ExactSpelling = true)] + public static extern int SetWindowInputFocus(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGammaRamp", ExactSpelling = true)] + public static extern int SetWindowGammaRamp(SDL_Window* window, [NativeTypeName("const Uint16 *")] ushort* red, [NativeTypeName("const Uint16 *")] ushort* green, [NativeTypeName("const Uint16 *")] ushort* blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGammaRamp", ExactSpelling = true)] + public static extern int GetWindowGammaRamp(SDL_Window* window, [NativeTypeName("Uint16 *")] ushort* red, [NativeTypeName("Uint16 *")] ushort* green, [NativeTypeName("Uint16 *")] ushort* blue); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowHitTest", ExactSpelling = true)] + public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl] callback, void* callback_data); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlashWindow", ExactSpelling = true)] + public static extern int FlashWindow(SDL_Window* window, SDL_FlashOperation operation); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindow", ExactSpelling = true)] + public static extern void DestroyWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenSaverEnabled", ExactSpelling = true)] + public static extern SDL_bool IsScreenSaverEnabled(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EnableScreenSaver", ExactSpelling = true)] + public static extern void EnableScreenSaver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)] + public static extern void DisableScreenSaver(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_LoadLibrary", ExactSpelling = true)] + public static extern int GL_LoadLibrary([NativeTypeName("const char *")] sbyte* path); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetProcAddress", ExactSpelling = true)] + public static extern void* GL_GetProcAddress([NativeTypeName("const char *")] sbyte* proc); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnloadLibrary", ExactSpelling = true)] + public static extern void GL_UnloadLibrary(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ExtensionSupported", ExactSpelling = true)] + public static extern SDL_bool GL_ExtensionSupported([NativeTypeName("const char *")] sbyte* extension); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ResetAttributes", ExactSpelling = true)] + public static extern void GL_ResetAttributes(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetAttribute", ExactSpelling = true)] + public static extern int GL_SetAttribute(SDL_GLattr attr, int value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetAttribute", ExactSpelling = true)] + public static extern int GL_GetAttribute(SDL_GLattr attr, int* value); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_CreateContext", ExactSpelling = true)] + [return: NativeTypeName("SDL_GLContext")] + public static extern void* GL_CreateContext(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_MakeCurrent", ExactSpelling = true)] + public static extern int GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] void* context); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentWindow", ExactSpelling = true)] + public static extern SDL_Window* GL_GetCurrentWindow(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentContext", ExactSpelling = true)] + [return: NativeTypeName("SDL_GLContext")] + public static extern void* GL_GetCurrentContext(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetDrawableSize", ExactSpelling = true)] + public static extern void GL_GetDrawableSize(SDL_Window* window, int* w, int* h); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetSwapInterval", ExactSpelling = true)] + public static extern int GL_SetSwapInterval(int interval); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetSwapInterval", ExactSpelling = true)] + public static extern int GL_GetSwapInterval(); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SwapWindow", ExactSpelling = true)] + public static extern void GL_SwapWindow(SDL_Window* window); + + [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_DeleteContext", ExactSpelling = true)] + public static extern void GL_DeleteContext([NativeTypeName("SDL_GLContext")] void* context); + + [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u")] + public const uint SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000U; + + [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)")] + public const uint SDL_WINDOWPOS_UNDEFINED = (0x1FFF0000U | (0)); + + [NativeTypeName("#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u")] + public const uint SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000U; + + [NativeTypeName("#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)")] + public const uint SDL_WINDOWPOS_CENTERED = (0x2FFF0000U | (0)); + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs new file mode 100644 index 00000000..2d13efdf --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_ArrayOrder + { + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioCVT.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioCVT.cs rename to sources/SDL2Sharp.Interop/codegen/default/SDL_AudioCVT.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs new file mode 100644 index 00000000..6a2b4be4 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_AudioDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint8")] + public byte iscapture; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioSpec.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_AudioSpec.cs rename to sources/SDL2Sharp.Interop/codegen/default/SDL_AudioSpec.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs new file mode 100644 index 00000000..c6b63238 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_AudioStatus + { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs new file mode 100644 index 00000000..ac362fd1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BitmapOrder + { + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs new file mode 100644 index 00000000..c4a03b8c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendFactor + { + SDL_BLENDFACTOR_ZERO = 0x1, + SDL_BLENDFACTOR_ONE = 0x2, + SDL_BLENDFACTOR_SRC_COLOR = 0x3, + SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, + SDL_BLENDFACTOR_SRC_ALPHA = 0x5, + SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, + SDL_BLENDFACTOR_DST_COLOR = 0x7, + SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, + SDL_BLENDFACTOR_DST_ALPHA = 0x9, + SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs new file mode 100644 index 00000000..aa717040 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendMode + { + SDL_BLENDMODE_NONE = 0x00000000, + SDL_BLENDMODE_BLEND = 0x00000001, + SDL_BLENDMODE_ADD = 0x00000002, + SDL_BLENDMODE_MOD = 0x00000004, + SDL_BLENDMODE_MUL = 0x00000008, + SDL_BLENDMODE_INVALID = 0x7FFFFFFF, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs new file mode 100644 index 00000000..557a4d0c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendOperation + { + SDL_BLENDOPERATION_ADD = 0x1, + SDL_BLENDOPERATION_SUBTRACT = 0x2, + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, + SDL_BLENDOPERATION_MINIMUM = 0x4, + SDL_BLENDOPERATION_MAXIMUM = 0x5, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs new file mode 100644 index 00000000..d5a0249d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_BlitMap + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs new file mode 100644 index 00000000..f38be379 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Color + { + [NativeTypeName("Uint8")] + public byte r; + + [NativeTypeName("Uint8")] + public byte g; + + [NativeTypeName("Uint8")] + public byte b; + + [NativeTypeName("Uint8")] + public byte a; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs new file mode 100644 index 00000000..318da18f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_CommonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs new file mode 100644 index 00000000..1fdb2b85 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerAxisEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte axis; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short value; + + [NativeTypeName("Uint16")] + public ushort padding4; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs new file mode 100644 index 00000000..6a09ba56 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs new file mode 100644 index 00000000..06b1f09a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs new file mode 100644 index 00000000..2dfb1b42 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_ControllerSensorEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Sint32")] + public int sensor; + + [NativeTypeName("float[3]")] + public fixed float data[3]; + + [NativeTypeName("Uint64")] + public ulong timestamp_us; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs new file mode 100644 index 00000000..e86d5147 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerTouchpadEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Sint32")] + public int touchpad; + + [NativeTypeName("Sint32")] + public int finger; + + public float x; + + public float y; + + public float pressure; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs new file mode 100644 index 00000000..fd3dac2a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Cursor + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs new file mode 100644 index 00000000..20c1d52a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DUMMY_ENUM + { + DUMMY_ENUM_VALUE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs new file mode 100644 index 00000000..a7d53cd7 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs @@ -0,0 +1,49 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_DisplayEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint display; + + [NativeTypeName("Uint8")] + public byte @event; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint32")] + public int data1; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs new file mode 100644 index 00000000..070eb26f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DisplayEventID + { + SDL_DISPLAYEVENT_NONE, + SDL_DISPLAYEVENT_ORIENTATION, + SDL_DISPLAYEVENT_CONNECTED, + SDL_DISPLAYEVENT_DISCONNECTED, + SDL_DISPLAYEVENT_MOVED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs new file mode 100644 index 00000000..0f662cb2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_DisplayMode + { + [NativeTypeName("Uint32")] + public uint format; + + public int w; + + public int h; + + public int refresh_rate; + + public void* driverdata; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs new file mode 100644 index 00000000..5424346b --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DisplayOrientation + { + SDL_ORIENTATION_UNKNOWN, + SDL_ORIENTATION_LANDSCAPE, + SDL_ORIENTATION_LANDSCAPE_FLIPPED, + SDL_ORIENTATION_PORTRAIT, + SDL_ORIENTATION_PORTRAIT_FLIPPED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs new file mode 100644 index 00000000..4a9a2155 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_DollarGestureEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + [NativeTypeName("SDL_GestureID")] + public long gestureId; + + [NativeTypeName("Uint32")] + public uint numFingers; + + public float error; + + public float x; + + public float y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs new file mode 100644 index 00000000..67b47f20 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_DropEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("char *")] + public sbyte* file; + + [NativeTypeName("Uint32")] + public uint windowID; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs new file mode 100644 index 00000000..7db609df --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs @@ -0,0 +1,126 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct SDL_Event + { + [FieldOffset(0)] + [NativeTypeName("Uint32")] + public uint type; + + [FieldOffset(0)] + public SDL_CommonEvent common; + + [FieldOffset(0)] + public SDL_DisplayEvent display; + + [FieldOffset(0)] + public SDL_WindowEvent window; + + [FieldOffset(0)] + public SDL_KeyboardEvent key; + + [FieldOffset(0)] + public SDL_TextEditingEvent edit; + + [FieldOffset(0)] + public SDL_TextEditingExtEvent editExt; + + [FieldOffset(0)] + public SDL_TextInputEvent text; + + [FieldOffset(0)] + public SDL_MouseMotionEvent motion; + + [FieldOffset(0)] + public SDL_MouseButtonEvent button; + + [FieldOffset(0)] + public SDL_MouseWheelEvent wheel; + + [FieldOffset(0)] + public SDL_JoyAxisEvent jaxis; + + [FieldOffset(0)] + public SDL_JoyBallEvent jball; + + [FieldOffset(0)] + public SDL_JoyHatEvent jhat; + + [FieldOffset(0)] + public SDL_JoyButtonEvent jbutton; + + [FieldOffset(0)] + public SDL_JoyDeviceEvent jdevice; + + [FieldOffset(0)] + public SDL_JoyBatteryEvent jbattery; + + [FieldOffset(0)] + public SDL_ControllerAxisEvent caxis; + + [FieldOffset(0)] + public SDL_ControllerButtonEvent cbutton; + + [FieldOffset(0)] + public SDL_ControllerDeviceEvent cdevice; + + [FieldOffset(0)] + public SDL_ControllerTouchpadEvent ctouchpad; + + [FieldOffset(0)] + public SDL_ControllerSensorEvent csensor; + + [FieldOffset(0)] + public SDL_AudioDeviceEvent adevice; + + [FieldOffset(0)] + public SDL_SensorEvent sensor; + + [FieldOffset(0)] + public SDL_QuitEvent quit; + + [FieldOffset(0)] + public SDL_UserEvent user; + + [FieldOffset(0)] + public SDL_SysWMEvent syswm; + + [FieldOffset(0)] + public SDL_TouchFingerEvent tfinger; + + [FieldOffset(0)] + public SDL_MultiGestureEvent mgesture; + + [FieldOffset(0)] + public SDL_DollarGestureEvent dgesture; + + [FieldOffset(0)] + public SDL_DropEvent drop; + + [FieldOffset(0)] + [NativeTypeName("Uint8[56]")] + public fixed byte padding[56]; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs new file mode 100644 index 00000000..422627c3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs @@ -0,0 +1,86 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_EventType : uint + { + SDL_FIRSTEVENT = 0, + SDL_QUIT = 0x100, + SDL_APP_TERMINATING, + SDL_APP_LOWMEMORY, + SDL_APP_WILLENTERBACKGROUND, + SDL_APP_DIDENTERBACKGROUND, + SDL_APP_WILLENTERFOREGROUND, + SDL_APP_DIDENTERFOREGROUND, + SDL_LOCALECHANGED, + SDL_DISPLAYEVENT = 0x150, + SDL_WINDOWEVENT = 0x200, + SDL_SYSWMEVENT, + SDL_KEYDOWN = 0x300, + SDL_KEYUP, + SDL_TEXTEDITING, + SDL_TEXTINPUT, + SDL_KEYMAPCHANGED, + SDL_TEXTEDITING_EXT, + SDL_MOUSEMOTION = 0x400, + SDL_MOUSEBUTTONDOWN, + SDL_MOUSEBUTTONUP, + SDL_MOUSEWHEEL, + SDL_JOYAXISMOTION = 0x600, + SDL_JOYBALLMOTION, + SDL_JOYHATMOTION, + SDL_JOYBUTTONDOWN, + SDL_JOYBUTTONUP, + SDL_JOYDEVICEADDED, + SDL_JOYDEVICEREMOVED, + SDL_JOYBATTERYUPDATED, + SDL_CONTROLLERAXISMOTION = 0x650, + SDL_CONTROLLERBUTTONDOWN, + SDL_CONTROLLERBUTTONUP, + SDL_CONTROLLERDEVICEADDED, + SDL_CONTROLLERDEVICEREMOVED, + SDL_CONTROLLERDEVICEREMAPPED, + SDL_CONTROLLERTOUCHPADDOWN, + SDL_CONTROLLERTOUCHPADMOTION, + SDL_CONTROLLERTOUCHPADUP, + SDL_CONTROLLERSENSORUPDATE, + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + SDL_CLIPBOARDUPDATE = 0x900, + SDL_DROPFILE = 0x1000, + SDL_DROPTEXT, + SDL_DROPBEGIN, + SDL_DROPCOMPLETE, + SDL_AUDIODEVICEADDED = 0x1100, + SDL_AUDIODEVICEREMOVED, + SDL_SENSORUPDATE = 0x1200, + SDL_RENDER_TARGETS_RESET = 0x2000, + SDL_RENDER_DEVICE_RESET, + SDL_POLLSENTINEL = 0x7F00, + SDL_USEREVENT = 0x8000, + SDL_LASTEVENT = 0xFFFF, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs new file mode 100644 index 00000000..49f5b786 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_FPoint + { + public float x; + + public float y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs new file mode 100644 index 00000000..4761637e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_FRect + { + public float x; + + public float y; + + public float w; + + public float h; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs new file mode 100644 index 00000000..d019c1ce --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_FlashOperation + { + SDL_FLASH_CANCEL, + SDL_FLASH_BRIEFLY, + SDL_FLASH_UNTIL_FOCUSED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs new file mode 100644 index 00000000..513410ec --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLContextResetNotification + { + SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, + SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs new file mode 100644 index 00000000..99c7f3e9 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs @@ -0,0 +1,54 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLattr + { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, + SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_CONTEXT_NO_ERROR, + SDL_GL_FLOATBUFFERS, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs new file mode 100644 index 00000000..c3ca834f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLcontextFlag + { + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs new file mode 100644 index 00000000..eb309fc6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLcontextReleaseFlag + { + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs new file mode 100644 index 00000000..cf5f8a36 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLprofile + { + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs new file mode 100644 index 00000000..fb41ca1e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_GUID + { + [NativeTypeName("Uint8[16]")] + public fixed byte data[16]; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs new file mode 100644 index 00000000..55338d44 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_HintPriority + { + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs new file mode 100644 index 00000000..876a0aee --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_HitTestResult + { + SDL_HITTEST_NORMAL, + SDL_HITTEST_DRAGGABLE, + SDL_HITTEST_RESIZE_TOPLEFT, + SDL_HITTEST_RESIZE_TOP, + SDL_HITTEST_RESIZE_TOPRIGHT, + SDL_HITTEST_RESIZE_RIGHT, + SDL_HITTEST_RESIZE_BOTTOMRIGHT, + SDL_HITTEST_RESIZE_BOTTOM, + SDL_HITTEST_RESIZE_BOTTOMLEFT, + SDL_HITTEST_RESIZE_LEFT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs new file mode 100644 index 00000000..c6576305 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyAxisEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte axis; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short value; + + [NativeTypeName("Uint16")] + public ushort padding4; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs new file mode 100644 index 00000000..88536464 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyBallEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte ball; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short xrel; + + [NativeTypeName("Sint16")] + public short yrel; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs new file mode 100644 index 00000000..f8b2098c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyBatteryEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + public SDL_JoystickPowerLevel level; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs new file mode 100644 index 00000000..3ae12b30 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs new file mode 100644 index 00000000..0cd02b89 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs new file mode 100644 index 00000000..6aa8815e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyHatEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte hat; + + [NativeTypeName("Uint8")] + public byte value; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs new file mode 100644 index 00000000..17e0de3c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_JoystickPowerLevel + { + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, + SDL_JOYSTICK_POWER_LOW, + SDL_JOYSTICK_POWER_MEDIUM, + SDL_JOYSTICK_POWER_FULL, + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs new file mode 100644 index 00000000..e1302bcb --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_JoystickType + { + SDL_JOYSTICK_TYPE_UNKNOWN, + SDL_JOYSTICK_TYPE_GAMECONTROLLER, + SDL_JOYSTICK_TYPE_WHEEL, + SDL_JOYSTICK_TYPE_ARCADE_STICK, + SDL_JOYSTICK_TYPE_FLIGHT_STICK, + SDL_JOYSTICK_TYPE_DANCE_PAD, + SDL_JOYSTICK_TYPE_GUITAR, + SDL_JOYSTICK_TYPE_DRUM_KIT, + SDL_JOYSTICK_TYPE_ARCADE_PAD, + SDL_JOYSTICK_TYPE_THROTTLE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs new file mode 100644 index 00000000..3d04b9d6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs @@ -0,0 +1,272 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_Scancode; + +namespace SDL2Sharp.Interop +{ + public enum SDL_KeyCode + { + SDLK_UNKNOWN = 0, + SDLK_RETURN = '\r', + SDLK_ESCAPE = '', + SDLK_BACKSPACE = '', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + SDLK_CAPSLOCK = (SDL_SCANCODE_CAPSLOCK | (1 << 30)), + SDLK_F1 = (SDL_SCANCODE_F1 | (1 << 30)), + SDLK_F2 = (SDL_SCANCODE_F2 | (1 << 30)), + SDLK_F3 = (SDL_SCANCODE_F3 | (1 << 30)), + SDLK_F4 = (SDL_SCANCODE_F4 | (1 << 30)), + SDLK_F5 = (SDL_SCANCODE_F5 | (1 << 30)), + SDLK_F6 = (SDL_SCANCODE_F6 | (1 << 30)), + SDLK_F7 = (SDL_SCANCODE_F7 | (1 << 30)), + SDLK_F8 = (SDL_SCANCODE_F8 | (1 << 30)), + SDLK_F9 = (SDL_SCANCODE_F9 | (1 << 30)), + SDLK_F10 = (SDL_SCANCODE_F10 | (1 << 30)), + SDLK_F11 = (SDL_SCANCODE_F11 | (1 << 30)), + SDLK_F12 = (SDL_SCANCODE_F12 | (1 << 30)), + SDLK_PRINTSCREEN = (SDL_SCANCODE_PRINTSCREEN | (1 << 30)), + SDLK_SCROLLLOCK = (SDL_SCANCODE_SCROLLLOCK | (1 << 30)), + SDLK_PAUSE = (SDL_SCANCODE_PAUSE | (1 << 30)), + SDLK_INSERT = (SDL_SCANCODE_INSERT | (1 << 30)), + SDLK_HOME = (SDL_SCANCODE_HOME | (1 << 30)), + SDLK_PAGEUP = (SDL_SCANCODE_PAGEUP | (1 << 30)), + SDLK_DELETE = '', + SDLK_END = (SDL_SCANCODE_END | (1 << 30)), + SDLK_PAGEDOWN = (SDL_SCANCODE_PAGEDOWN | (1 << 30)), + SDLK_RIGHT = (SDL_SCANCODE_RIGHT | (1 << 30)), + SDLK_LEFT = (SDL_SCANCODE_LEFT | (1 << 30)), + SDLK_DOWN = (SDL_SCANCODE_DOWN | (1 << 30)), + SDLK_UP = (SDL_SCANCODE_UP | (1 << 30)), + SDLK_NUMLOCKCLEAR = (SDL_SCANCODE_NUMLOCKCLEAR | (1 << 30)), + SDLK_KP_DIVIDE = (SDL_SCANCODE_KP_DIVIDE | (1 << 30)), + SDLK_KP_MULTIPLY = (SDL_SCANCODE_KP_MULTIPLY | (1 << 30)), + SDLK_KP_MINUS = (SDL_SCANCODE_KP_MINUS | (1 << 30)), + SDLK_KP_PLUS = (SDL_SCANCODE_KP_PLUS | (1 << 30)), + SDLK_KP_ENTER = (SDL_SCANCODE_KP_ENTER | (1 << 30)), + SDLK_KP_1 = (SDL_SCANCODE_KP_1 | (1 << 30)), + SDLK_KP_2 = (SDL_SCANCODE_KP_2 | (1 << 30)), + SDLK_KP_3 = (SDL_SCANCODE_KP_3 | (1 << 30)), + SDLK_KP_4 = (SDL_SCANCODE_KP_4 | (1 << 30)), + SDLK_KP_5 = (SDL_SCANCODE_KP_5 | (1 << 30)), + SDLK_KP_6 = (SDL_SCANCODE_KP_6 | (1 << 30)), + SDLK_KP_7 = (SDL_SCANCODE_KP_7 | (1 << 30)), + SDLK_KP_8 = (SDL_SCANCODE_KP_8 | (1 << 30)), + SDLK_KP_9 = (SDL_SCANCODE_KP_9 | (1 << 30)), + SDLK_KP_0 = (SDL_SCANCODE_KP_0 | (1 << 30)), + SDLK_KP_PERIOD = (SDL_SCANCODE_KP_PERIOD | (1 << 30)), + SDLK_APPLICATION = (SDL_SCANCODE_APPLICATION | (1 << 30)), + SDLK_POWER = (SDL_SCANCODE_POWER | (1 << 30)), + SDLK_KP_EQUALS = (SDL_SCANCODE_KP_EQUALS | (1 << 30)), + SDLK_F13 = (SDL_SCANCODE_F13 | (1 << 30)), + SDLK_F14 = (SDL_SCANCODE_F14 | (1 << 30)), + SDLK_F15 = (SDL_SCANCODE_F15 | (1 << 30)), + SDLK_F16 = (SDL_SCANCODE_F16 | (1 << 30)), + SDLK_F17 = (SDL_SCANCODE_F17 | (1 << 30)), + SDLK_F18 = (SDL_SCANCODE_F18 | (1 << 30)), + SDLK_F19 = (SDL_SCANCODE_F19 | (1 << 30)), + SDLK_F20 = (SDL_SCANCODE_F20 | (1 << 30)), + SDLK_F21 = (SDL_SCANCODE_F21 | (1 << 30)), + SDLK_F22 = (SDL_SCANCODE_F22 | (1 << 30)), + SDLK_F23 = (SDL_SCANCODE_F23 | (1 << 30)), + SDLK_F24 = (SDL_SCANCODE_F24 | (1 << 30)), + SDLK_EXECUTE = (SDL_SCANCODE_EXECUTE | (1 << 30)), + SDLK_HELP = (SDL_SCANCODE_HELP | (1 << 30)), + SDLK_MENU = (SDL_SCANCODE_MENU | (1 << 30)), + SDLK_SELECT = (SDL_SCANCODE_SELECT | (1 << 30)), + SDLK_STOP = (SDL_SCANCODE_STOP | (1 << 30)), + SDLK_AGAIN = (SDL_SCANCODE_AGAIN | (1 << 30)), + SDLK_UNDO = (SDL_SCANCODE_UNDO | (1 << 30)), + SDLK_CUT = (SDL_SCANCODE_CUT | (1 << 30)), + SDLK_COPY = (SDL_SCANCODE_COPY | (1 << 30)), + SDLK_PASTE = (SDL_SCANCODE_PASTE | (1 << 30)), + SDLK_FIND = (SDL_SCANCODE_FIND | (1 << 30)), + SDLK_MUTE = (SDL_SCANCODE_MUTE | (1 << 30)), + SDLK_VOLUMEUP = (SDL_SCANCODE_VOLUMEUP | (1 << 30)), + SDLK_VOLUMEDOWN = (SDL_SCANCODE_VOLUMEDOWN | (1 << 30)), + SDLK_KP_COMMA = (SDL_SCANCODE_KP_COMMA | (1 << 30)), + SDLK_KP_EQUALSAS400 = (SDL_SCANCODE_KP_EQUALSAS400 | (1 << 30)), + SDLK_ALTERASE = (SDL_SCANCODE_ALTERASE | (1 << 30)), + SDLK_SYSREQ = (SDL_SCANCODE_SYSREQ | (1 << 30)), + SDLK_CANCEL = (SDL_SCANCODE_CANCEL | (1 << 30)), + SDLK_CLEAR = (SDL_SCANCODE_CLEAR | (1 << 30)), + SDLK_PRIOR = (SDL_SCANCODE_PRIOR | (1 << 30)), + SDLK_RETURN2 = (SDL_SCANCODE_RETURN2 | (1 << 30)), + SDLK_SEPARATOR = (SDL_SCANCODE_SEPARATOR | (1 << 30)), + SDLK_OUT = (SDL_SCANCODE_OUT | (1 << 30)), + SDLK_OPER = (SDL_SCANCODE_OPER | (1 << 30)), + SDLK_CLEARAGAIN = (SDL_SCANCODE_CLEARAGAIN | (1 << 30)), + SDLK_CRSEL = (SDL_SCANCODE_CRSEL | (1 << 30)), + SDLK_EXSEL = (SDL_SCANCODE_EXSEL | (1 << 30)), + SDLK_KP_00 = (SDL_SCANCODE_KP_00 | (1 << 30)), + SDLK_KP_000 = (SDL_SCANCODE_KP_000 | (1 << 30)), + SDLK_THOUSANDSSEPARATOR = (SDL_SCANCODE_THOUSANDSSEPARATOR | (1 << 30)), + SDLK_DECIMALSEPARATOR = (SDL_SCANCODE_DECIMALSEPARATOR | (1 << 30)), + SDLK_CURRENCYUNIT = (SDL_SCANCODE_CURRENCYUNIT | (1 << 30)), + SDLK_CURRENCYSUBUNIT = (SDL_SCANCODE_CURRENCYSUBUNIT | (1 << 30)), + SDLK_KP_LEFTPAREN = (SDL_SCANCODE_KP_LEFTPAREN | (1 << 30)), + SDLK_KP_RIGHTPAREN = (SDL_SCANCODE_KP_RIGHTPAREN | (1 << 30)), + SDLK_KP_LEFTBRACE = (SDL_SCANCODE_KP_LEFTBRACE | (1 << 30)), + SDLK_KP_RIGHTBRACE = (SDL_SCANCODE_KP_RIGHTBRACE | (1 << 30)), + SDLK_KP_TAB = (SDL_SCANCODE_KP_TAB | (1 << 30)), + SDLK_KP_BACKSPACE = (SDL_SCANCODE_KP_BACKSPACE | (1 << 30)), + SDLK_KP_A = (SDL_SCANCODE_KP_A | (1 << 30)), + SDLK_KP_B = (SDL_SCANCODE_KP_B | (1 << 30)), + SDLK_KP_C = (SDL_SCANCODE_KP_C | (1 << 30)), + SDLK_KP_D = (SDL_SCANCODE_KP_D | (1 << 30)), + SDLK_KP_E = (SDL_SCANCODE_KP_E | (1 << 30)), + SDLK_KP_F = (SDL_SCANCODE_KP_F | (1 << 30)), + SDLK_KP_XOR = (SDL_SCANCODE_KP_XOR | (1 << 30)), + SDLK_KP_POWER = (SDL_SCANCODE_KP_POWER | (1 << 30)), + SDLK_KP_PERCENT = (SDL_SCANCODE_KP_PERCENT | (1 << 30)), + SDLK_KP_LESS = (SDL_SCANCODE_KP_LESS | (1 << 30)), + SDLK_KP_GREATER = (SDL_SCANCODE_KP_GREATER | (1 << 30)), + SDLK_KP_AMPERSAND = (SDL_SCANCODE_KP_AMPERSAND | (1 << 30)), + SDLK_KP_DBLAMPERSAND = (SDL_SCANCODE_KP_DBLAMPERSAND | (1 << 30)), + SDLK_KP_VERTICALBAR = (SDL_SCANCODE_KP_VERTICALBAR | (1 << 30)), + SDLK_KP_DBLVERTICALBAR = (SDL_SCANCODE_KP_DBLVERTICALBAR | (1 << 30)), + SDLK_KP_COLON = (SDL_SCANCODE_KP_COLON | (1 << 30)), + SDLK_KP_HASH = (SDL_SCANCODE_KP_HASH | (1 << 30)), + SDLK_KP_SPACE = (SDL_SCANCODE_KP_SPACE | (1 << 30)), + SDLK_KP_AT = (SDL_SCANCODE_KP_AT | (1 << 30)), + SDLK_KP_EXCLAM = (SDL_SCANCODE_KP_EXCLAM | (1 << 30)), + SDLK_KP_MEMSTORE = (SDL_SCANCODE_KP_MEMSTORE | (1 << 30)), + SDLK_KP_MEMRECALL = (SDL_SCANCODE_KP_MEMRECALL | (1 << 30)), + SDLK_KP_MEMCLEAR = (SDL_SCANCODE_KP_MEMCLEAR | (1 << 30)), + SDLK_KP_MEMADD = (SDL_SCANCODE_KP_MEMADD | (1 << 30)), + SDLK_KP_MEMSUBTRACT = (SDL_SCANCODE_KP_MEMSUBTRACT | (1 << 30)), + SDLK_KP_MEMMULTIPLY = (SDL_SCANCODE_KP_MEMMULTIPLY | (1 << 30)), + SDLK_KP_MEMDIVIDE = (SDL_SCANCODE_KP_MEMDIVIDE | (1 << 30)), + SDLK_KP_PLUSMINUS = (SDL_SCANCODE_KP_PLUSMINUS | (1 << 30)), + SDLK_KP_CLEAR = (SDL_SCANCODE_KP_CLEAR | (1 << 30)), + SDLK_KP_CLEARENTRY = (SDL_SCANCODE_KP_CLEARENTRY | (1 << 30)), + SDLK_KP_BINARY = (SDL_SCANCODE_KP_BINARY | (1 << 30)), + SDLK_KP_OCTAL = (SDL_SCANCODE_KP_OCTAL | (1 << 30)), + SDLK_KP_DECIMAL = (SDL_SCANCODE_KP_DECIMAL | (1 << 30)), + SDLK_KP_HEXADECIMAL = (SDL_SCANCODE_KP_HEXADECIMAL | (1 << 30)), + SDLK_LCTRL = (SDL_SCANCODE_LCTRL | (1 << 30)), + SDLK_LSHIFT = (SDL_SCANCODE_LSHIFT | (1 << 30)), + SDLK_LALT = (SDL_SCANCODE_LALT | (1 << 30)), + SDLK_LGUI = (SDL_SCANCODE_LGUI | (1 << 30)), + SDLK_RCTRL = (SDL_SCANCODE_RCTRL | (1 << 30)), + SDLK_RSHIFT = (SDL_SCANCODE_RSHIFT | (1 << 30)), + SDLK_RALT = (SDL_SCANCODE_RALT | (1 << 30)), + SDLK_RGUI = (SDL_SCANCODE_RGUI | (1 << 30)), + SDLK_MODE = (SDL_SCANCODE_MODE | (1 << 30)), + SDLK_AUDIONEXT = (SDL_SCANCODE_AUDIONEXT | (1 << 30)), + SDLK_AUDIOPREV = (SDL_SCANCODE_AUDIOPREV | (1 << 30)), + SDLK_AUDIOSTOP = (SDL_SCANCODE_AUDIOSTOP | (1 << 30)), + SDLK_AUDIOPLAY = (SDL_SCANCODE_AUDIOPLAY | (1 << 30)), + SDLK_AUDIOMUTE = (SDL_SCANCODE_AUDIOMUTE | (1 << 30)), + SDLK_MEDIASELECT = (SDL_SCANCODE_MEDIASELECT | (1 << 30)), + SDLK_WWW = (SDL_SCANCODE_WWW | (1 << 30)), + SDLK_MAIL = (SDL_SCANCODE_MAIL | (1 << 30)), + SDLK_CALCULATOR = (SDL_SCANCODE_CALCULATOR | (1 << 30)), + SDLK_COMPUTER = (SDL_SCANCODE_COMPUTER | (1 << 30)), + SDLK_AC_SEARCH = (SDL_SCANCODE_AC_SEARCH | (1 << 30)), + SDLK_AC_HOME = (SDL_SCANCODE_AC_HOME | (1 << 30)), + SDLK_AC_BACK = (SDL_SCANCODE_AC_BACK | (1 << 30)), + SDLK_AC_FORWARD = (SDL_SCANCODE_AC_FORWARD | (1 << 30)), + SDLK_AC_STOP = (SDL_SCANCODE_AC_STOP | (1 << 30)), + SDLK_AC_REFRESH = (SDL_SCANCODE_AC_REFRESH | (1 << 30)), + SDLK_AC_BOOKMARKS = (SDL_SCANCODE_AC_BOOKMARKS | (1 << 30)), + SDLK_BRIGHTNESSDOWN = (SDL_SCANCODE_BRIGHTNESSDOWN | (1 << 30)), + SDLK_BRIGHTNESSUP = (SDL_SCANCODE_BRIGHTNESSUP | (1 << 30)), + SDLK_DISPLAYSWITCH = (SDL_SCANCODE_DISPLAYSWITCH | (1 << 30)), + SDLK_KBDILLUMTOGGLE = (SDL_SCANCODE_KBDILLUMTOGGLE | (1 << 30)), + SDLK_KBDILLUMDOWN = (SDL_SCANCODE_KBDILLUMDOWN | (1 << 30)), + SDLK_KBDILLUMUP = (SDL_SCANCODE_KBDILLUMUP | (1 << 30)), + SDLK_EJECT = (SDL_SCANCODE_EJECT | (1 << 30)), + SDLK_SLEEP = (SDL_SCANCODE_SLEEP | (1 << 30)), + SDLK_APP1 = (SDL_SCANCODE_APP1 | (1 << 30)), + SDLK_APP2 = (SDL_SCANCODE_APP2 | (1 << 30)), + SDLK_AUDIOREWIND = (SDL_SCANCODE_AUDIOREWIND | (1 << 30)), + SDLK_AUDIOFASTFORWARD = (SDL_SCANCODE_AUDIOFASTFORWARD | (1 << 30)), + SDLK_SOFTLEFT = (SDL_SCANCODE_SOFTLEFT | (1 << 30)), + SDLK_SOFTRIGHT = (SDL_SCANCODE_SOFTRIGHT | (1 << 30)), + SDLK_CALL = (SDL_SCANCODE_CALL | (1 << 30)), + SDLK_ENDCALL = (SDL_SCANCODE_ENDCALL | (1 << 30)), + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs new file mode 100644 index 00000000..6ec8a2e3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs @@ -0,0 +1,48 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_KeyboardEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte repeat; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + public SDL_Keysym keysym; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs new file mode 100644 index 00000000..2acca89e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs @@ -0,0 +1,44 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_Keymod + { + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_SCROLL = 0x8000, + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, + KMOD_ALT = KMOD_LALT | KMOD_RALT, + KMOD_GUI = KMOD_LGUI | KMOD_RGUI, + KMOD_RESERVED = KMOD_SCROLL, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs new file mode 100644 index 00000000..d23836a8 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Keysym + { + public SDL_Scancode scancode; + + [NativeTypeName("SDL_Keycode")] + public int sym; + + [NativeTypeName("Uint16")] + public ushort mod; + + [NativeTypeName("Uint32")] + public uint unused; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs new file mode 100644 index 00000000..11d2c76a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_LogCategory + { + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + SDL_LOG_CATEGORY_CUSTOM, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs new file mode 100644 index 00000000..6c754af1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_LogPriority + { + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs new file mode 100644 index 00000000..61c1b959 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs @@ -0,0 +1,55 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte clicks; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs new file mode 100644 index 00000000..df78952e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseMotionEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint32")] + public uint state; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + + [NativeTypeName("Sint32")] + public int xrel; + + [NativeTypeName("Sint32")] + public int yrel; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs new file mode 100644 index 00000000..2bf9e69d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_MouseWheelDirection + { + SDL_MOUSEWHEEL_NORMAL, + SDL_MOUSEWHEEL_FLIPPED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs new file mode 100644 index 00000000..eebc6fe2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs @@ -0,0 +1,56 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseWheelEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + + [NativeTypeName("Uint32")] + public uint direction; + + public float preciseX; + + public float preciseY; + + [NativeTypeName("Sint32")] + public int mouseX; + + [NativeTypeName("Sint32")] + public int mouseY; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs new file mode 100644 index 00000000..6048be59 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs @@ -0,0 +1,48 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MultiGestureEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + public float dTheta; + + public float dDist; + + public float x; + + public float y; + + [NativeTypeName("Uint16")] + public ushort numFingers; + + [NativeTypeName("Uint16")] + public ushort padding; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs new file mode 100644 index 00000000..00176cd6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_OSEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs new file mode 100644 index 00000000..9e38cab3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PackedLayout + { + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs new file mode 100644 index 00000000..abfa0753 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PackedOrder + { + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs new file mode 100644 index 00000000..59b59cbc --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_Palette + { + public int ncolors; + + public SDL_Color* colors; + + [NativeTypeName("Uint32")] + public uint version; + + public int refcount; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs new file mode 100644 index 00000000..fa3c1100 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs @@ -0,0 +1,80 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_PixelFormat + { + [NativeTypeName("Uint32")] + public uint format; + + public SDL_Palette* palette; + + [NativeTypeName("Uint8")] + public byte BitsPerPixel; + + [NativeTypeName("Uint8")] + public byte BytesPerPixel; + + [NativeTypeName("Uint8[2]")] + public fixed byte padding[2]; + + [NativeTypeName("Uint32")] + public uint Rmask; + + [NativeTypeName("Uint32")] + public uint Gmask; + + [NativeTypeName("Uint32")] + public uint Bmask; + + [NativeTypeName("Uint32")] + public uint Amask; + + [NativeTypeName("Uint8")] + public byte Rloss; + + [NativeTypeName("Uint8")] + public byte Gloss; + + [NativeTypeName("Uint8")] + public byte Bloss; + + [NativeTypeName("Uint8")] + public byte Aloss; + + [NativeTypeName("Uint8")] + public byte Rshift; + + [NativeTypeName("Uint8")] + public byte Gshift; + + [NativeTypeName("Uint8")] + public byte Bshift; + + [NativeTypeName("Uint8")] + public byte Ashift; + + public int refcount; + + [NativeTypeName("struct SDL_PixelFormat *")] + public SDL_PixelFormat* next; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs new file mode 100644 index 00000000..03f347b5 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs @@ -0,0 +1,83 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_ArrayOrder; +using static SDL2Sharp.Interop.SDL_BitmapOrder; +using static SDL2Sharp.Interop.SDL_PackedLayout; +using static SDL2Sharp.Interop.SDL_PackedOrder; +using static SDL2Sharp.Interop.SDL_PixelType; + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_PixelFormatEnum : uint + { + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX1MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX4LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX4MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), + 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)), + SDL_PIXELFORMAT_BGRA4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_ARGB1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGBA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_ABGR1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_BGRA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGB565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_BGR565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGB24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_RGB) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), + SDL_PIXELFORMAT_BGR24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_BGR) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), + SDL_PIXELFORMAT_XRGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, + SDL_PIXELFORMAT_RGBX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_XBGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, + SDL_PIXELFORMAT_BGRX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ARGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGBA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ABGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_BGRA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ARGB2101010 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_2101010) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_YV12 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_IYUV = (unchecked(((uint)((byte)('I')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('U')) << 16) | ((uint)((byte)('V')) << 24))), + SDL_PIXELFORMAT_YUY2 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('U')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_UYVY = (unchecked(((uint)((byte)('U')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('V')) << 16) | ((uint)((byte)('Y')) << 24))), + SDL_PIXELFORMAT_YVYU = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('U')) << 24))), + SDL_PIXELFORMAT_NV12 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_NV21 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('2')) << 16) | ((uint)((byte)('1')) << 24))), + SDL_PIXELFORMAT_EXTERNAL_OES = (unchecked(((uint)((byte)('O')) << 0) | ((uint)((byte)('E')) << 8) | ((uint)((byte)('S')) << 16) | ((uint)((byte)(' ')) << 24))), + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs new file mode 100644 index 00000000..9c1afa75 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs @@ -0,0 +1,38 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PixelType + { + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs new file mode 100644 index 00000000..694e3da0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Point + { + public int x; + + public int y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs new file mode 100644 index 00000000..fe0f5025 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_QuitEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RWops.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_RWops.cs rename to sources/SDL2Sharp.Interop/codegen/default/SDL_RWops.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs new file mode 100644 index 00000000..d54b0ea0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Rect + { + public int x; + + public int y; + + public int w; + + public int h; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs new file mode 100644 index 00000000..f7b963ca --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Renderer + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs new file mode 100644 index 00000000..71b6202d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_RendererFlags : uint + { + SDL_RENDERER_SOFTWARE = 0x00000001, + SDL_RENDERER_ACCELERATED = 0x00000002, + SDL_RENDERER_PRESENTVSYNC = 0x00000004, + SDL_RENDERER_TARGETTEXTURE = 0x00000008, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs new file mode 100644 index 00000000..ca274bac --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_RendererFlip + { + SDL_FLIP_NONE = 0x00000000, + SDL_FLIP_HORIZONTAL = 0x00000001, + SDL_FLIP_VERTICAL = 0x00000002, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs new file mode 100644 index 00000000..c21a4ba1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_RendererInfo + { + [NativeTypeName("const char *")] + public sbyte* name; + + [NativeTypeName("Uint32")] + public uint flags; + + [NativeTypeName("Uint32")] + public uint num_texture_formats; + + [NativeTypeName("Uint32[16]")] + public fixed uint texture_formats[16]; + + public int max_texture_width; + + public int max_texture_height; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs new file mode 100644 index 00000000..5f5313e0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_ScaleMode + { + SDL_ScaleModeNearest, + SDL_ScaleModeLinear, + SDL_ScaleModeBest, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs new file mode 100644 index 00000000..e2e09b33 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs @@ -0,0 +1,274 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_Scancode + { + SDL_SCANCODE_UNKNOWN = 0, + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, + SDL_SCANCODE_NONUSHASH = 50, + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + SDL_SCANCODE_CAPSLOCK = 57, + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + SDL_SCANCODE_NUMLOCKCLEAR = 83, + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + SDL_SCANCODE_NONUSBACKSLASH = 100, + SDL_SCANCODE_APPLICATION = 101, + SDL_SCANCODE_POWER = 102, + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + SDL_SCANCODE_INTERNATIONAL1 = 135, + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, + SDL_SCANCODE_LANG2 = 145, + SDL_SCANCODE_LANG3 = 146, + SDL_SCANCODE_LANG4 = 147, + SDL_SCANCODE_LANG5 = 148, + SDL_SCANCODE_LANG6 = 149, + SDL_SCANCODE_LANG7 = 150, + SDL_SCANCODE_LANG8 = 151, + SDL_SCANCODE_LANG9 = 152, + SDL_SCANCODE_ALTERASE = 153, + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, + SDL_SCANCODE_LGUI = 227, + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + 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_SOFTLEFT = 287, + SDL_SCANCODE_SOFTRIGHT = 288, + SDL_SCANCODE_CALL = 289, + SDL_SCANCODE_ENDCALL = 290, + SDL_NUM_SCANCODES = 512, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs new file mode 100644 index 00000000..ce329d9f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs @@ -0,0 +1,40 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_SensorEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + + [NativeTypeName("float[6]")] + public fixed float data[6]; + + [NativeTypeName("Uint64")] + public ulong timestamp_us; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs new file mode 100644 index 00000000..af9d6e71 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_Surface + { + [NativeTypeName("Uint32")] + public uint flags; + + public SDL_PixelFormat* format; + + public int w; + + public int h; + + public int pitch; + + public void* pixels; + + public void* userdata; + + public int locked; + + public void* list_blitmap; + + public SDL_Rect clip_rect; + + public SDL_BlitMap* map; + + public int refcount; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs new file mode 100644 index 00000000..1141d0ec --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_SysWMEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + public SDL_SysWMmsg* msg; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs new file mode 100644 index 00000000..0da87cae --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_SysWMmsg + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs new file mode 100644 index 00000000..3578e6d2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs @@ -0,0 +1,39 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_SystemCursor + { + SDL_SYSTEM_CURSOR_ARROW, + SDL_SYSTEM_CURSOR_IBEAM, + 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_NUM_SYSTEM_CURSORS, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs new file mode 100644 index 00000000..40f05865 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextEditingEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char[32]")] + public fixed sbyte text[32]; + + [NativeTypeName("Sint32")] + public int start; + + [NativeTypeName("Sint32")] + public int length; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs new file mode 100644 index 00000000..13afc1f3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextEditingExtEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char *")] + public sbyte* text; + + [NativeTypeName("Sint32")] + public int start; + + [NativeTypeName("Sint32")] + public int length; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs new file mode 100644 index 00000000..285e9416 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextInputEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char[32]")] + public fixed sbyte text[32]; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs new file mode 100644 index 00000000..4f76e639 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Texture + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs new file mode 100644 index 00000000..adadc839 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_TextureAccess + { + SDL_TEXTUREACCESS_STATIC, + SDL_TEXTUREACCESS_STREAMING, + SDL_TEXTUREACCESS_TARGET, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs new file mode 100644 index 00000000..7a092826 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_TextureModulate + { + SDL_TEXTUREMODULATE_NONE = 0x00000000, + SDL_TEXTUREMODULATE_COLOR = 0x00000001, + SDL_TEXTUREMODULATE_ALPHA = 0x00000002, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs new file mode 100644 index 00000000..f0f603b1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_TouchFingerEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + [NativeTypeName("SDL_FingerID")] + public long fingerId; + + public float x; + + public float y; + + public float dx; + + public float dy; + + public float pressure; + + [NativeTypeName("Uint32")] + public uint windowID; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs new file mode 100644 index 00000000..86342093 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_UserEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Sint32")] + public int code; + + public void* data1; + + public void* data2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs new file mode 100644 index 00000000..bc2349d1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Vertex + { + public SDL_FPoint position; + + public SDL_Color color; + + public SDL_FPoint tex_coord; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_VirtualJoystickDesc.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_VirtualJoystickDesc.cs rename to sources/SDL2Sharp.Interop/codegen/default/SDL_VirtualJoystickDesc.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs new file mode 100644 index 00000000..8a0ea826 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Window + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs new file mode 100644 index 00000000..34ae6ca4 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_WindowEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint8")] + public byte @event; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint32")] + public int data1; + + [NativeTypeName("Sint32")] + public int data2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs new file mode 100644 index 00000000..9ee1dd48 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs @@ -0,0 +1,45 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_WindowEventID + { + SDL_WINDOWEVENT_NONE, + SDL_WINDOWEVENT_SHOWN, + SDL_WINDOWEVENT_HIDDEN, + SDL_WINDOWEVENT_EXPOSED, + SDL_WINDOWEVENT_MOVED, + SDL_WINDOWEVENT_RESIZED, + SDL_WINDOWEVENT_SIZE_CHANGED, + SDL_WINDOWEVENT_MINIMIZED, + SDL_WINDOWEVENT_MAXIMIZED, + SDL_WINDOWEVENT_RESTORED, + SDL_WINDOWEVENT_ENTER, + SDL_WINDOWEVENT_LEAVE, + SDL_WINDOWEVENT_FOCUS_GAINED, + SDL_WINDOWEVENT_FOCUS_LOST, + SDL_WINDOWEVENT_CLOSE, + SDL_WINDOWEVENT_TAKE_FOCUS, + SDL_WINDOWEVENT_HIT_TEST, + SDL_WINDOWEVENT_ICCPROF_CHANGED, + SDL_WINDOWEVENT_DISPLAY_CHANGED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs new file mode 100644 index 00000000..6b93c22f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_WindowFlags + { + SDL_WINDOW_FULLSCREEN = 0x00000001, + SDL_WINDOW_OPENGL = 0x00000002, + SDL_WINDOW_SHOWN = 0x00000004, + SDL_WINDOW_HIDDEN = 0x00000008, + SDL_WINDOW_BORDERLESS = 0x00000010, + SDL_WINDOW_RESIZABLE = 0x00000020, + SDL_WINDOW_MINIMIZED = 0x00000040, + SDL_WINDOW_MAXIMIZED = 0x00000080, + SDL_WINDOW_MOUSE_GRABBED = 0x00000100, + SDL_WINDOW_INPUT_FOCUS = 0x00000200, + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, + SDL_WINDOW_FULLSCREEN_DESKTOP = (SDL_WINDOW_FULLSCREEN | 0x00001000), + SDL_WINDOW_FOREIGN = 0x00000800, + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, + SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, + SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, + SDL_WINDOW_SKIP_TASKBAR = 0x00010000, + SDL_WINDOW_UTILITY = 0x00020000, + SDL_WINDOW_TOOLTIP = 0x00040000, + SDL_WINDOW_POPUP_MENU = 0x00080000, + SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, + SDL_WINDOW_VULKAN = 0x10000000, + SDL_WINDOW_METAL = 0x20000000, + SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs new file mode 100644 index 00000000..ed05fb6c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_YUV_CONVERSION_MODE + { + SDL_YUV_CONVERSION_JPEG, + SDL_YUV_CONVERSION_BT601, + SDL_YUV_CONVERSION_BT709, + SDL_YUV_CONVERSION_AUTOMATIC, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs new file mode 100644 index 00000000..40fb33e9 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_bool + { + SDL_FALSE = 0, + SDL_TRUE = 1, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs new file mode 100644 index 00000000..7f92c831 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_errorcode + { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs new file mode 100644 index 00000000..4464a3e5 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_eventaction + { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs new file mode 100644 index 00000000..49d51362 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_version + { + [NativeTypeName("Uint8")] + public byte major; + + [NativeTypeName("Uint8")] + public byte minor; + + [NativeTypeName("Uint8")] + public byte patch; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/TTF.cs b/sources/SDL2Sharp.Interop/codegen/default/TTF.cs new file mode 100644 index 00000000..234bdde5 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/TTF.cs @@ -0,0 +1,366 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class TTF + { + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Linked_Version", ExactSpelling = true)] + [return: NativeTypeName("const SDL_version *")] + public static extern SDL_version* Linked_Version(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFreeTypeVersion", ExactSpelling = true)] + public static extern void GetFreeTypeVersion(int* major, int* minor, int* patch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetHarfBuzzVersion", ExactSpelling = true)] + public static extern void GetHarfBuzzVersion(int* major, int* minor, int* patch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_ByteSwappedUNICODE", ExactSpelling = true)] + public static extern void ByteSwappedUNICODE(SDL_bool swapped); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Init", ExactSpelling = true)] + public static extern int Init(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFont", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFont([NativeTypeName("const char *")] sbyte* file, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndex", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndex([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontRW(SDL_RWops* src, int freesrc, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPI", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPI", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPIRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPIRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSize", ExactSpelling = true)] + public static extern int SetFontSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSizeDPI", ExactSpelling = true)] + public static extern int SetFontSizeDPI([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontStyle", ExactSpelling = true)] + public static extern int GetFontStyle([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontStyle", ExactSpelling = true)] + public static extern void SetFontStyle([NativeTypeName("TTF_Font *")] _TTF_Font* font, int style); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontOutline", ExactSpelling = true)] + public static extern int GetFontOutline([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontOutline", ExactSpelling = true)] + public static extern void SetFontOutline([NativeTypeName("TTF_Font *")] _TTF_Font* font, int outline); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontHinting", ExactSpelling = true)] + public static extern int GetFontHinting([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontHinting", ExactSpelling = true)] + public static extern void SetFontHinting([NativeTypeName("TTF_Font *")] _TTF_Font* font, int hinting); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontWrappedAlign", ExactSpelling = true)] + public static extern int GetFontWrappedAlign([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontWrappedAlign", ExactSpelling = true)] + public static extern void SetFontWrappedAlign([NativeTypeName("TTF_Font *")] _TTF_Font* font, int align); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontHeight", ExactSpelling = true)] + public static extern int FontHeight([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontAscent", ExactSpelling = true)] + public static extern int FontAscent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontDescent", ExactSpelling = true)] + public static extern int FontDescent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontLineSkip", ExactSpelling = true)] + public static extern int FontLineSkip([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerning", ExactSpelling = true)] + public static extern int GetFontKerning([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontKerning", ExactSpelling = true)] + public static extern void SetFontKerning([NativeTypeName("TTF_Font *")] _TTF_Font* font, int allowed); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaces", ExactSpelling = true)] + [return: NativeTypeName("long")] + public static extern int FontFaces([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceIsFixedWidth", ExactSpelling = true)] + public static extern int FontFaceIsFixedWidth([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceFamilyName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* FontFaceFamilyName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceStyleName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* FontFaceStyleName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided", ExactSpelling = true)] + public static extern int GlyphIsProvided([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided32", ExactSpelling = true)] + public static extern int GlyphIsProvided32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics", ExactSpelling = true)] + public static extern int GlyphMetrics([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics32", ExactSpelling = true)] + public static extern int GlyphMetrics32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeText", ExactSpelling = true)] + public static extern int SizeText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUTF8", ExactSpelling = true)] + public static extern int SizeUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUNICODE", ExactSpelling = true)] + public static extern int SizeUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureText", ExactSpelling = true)] + public static extern int MeasureText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUTF8", ExactSpelling = true)] + public static extern int MeasureUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUNICODE", ExactSpelling = true)] + public static extern int MeasureUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_CloseFont", ExactSpelling = true)] + public static extern void CloseFont([NativeTypeName("TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_WasInit", ExactSpelling = true)] + public static extern int WasInit(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSize", ExactSpelling = true)] + public static extern int GetFontKerningSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int prev_index, int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs", ExactSpelling = true)] + public static extern int GetFontKerningSizeGlyphs([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort previous_ch, [NativeTypeName("Uint16")] ushort ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs32", ExactSpelling = true)] + public static extern int GetFontKerningSizeGlyphs32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint previous_ch, [NativeTypeName("Uint32")] uint ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSDF", ExactSpelling = true)] + public static extern int SetFontSDF([NativeTypeName("TTF_Font *")] _TTF_Font* font, SDL_bool on_off); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontSDF", ExactSpelling = true)] + public static extern SDL_bool GetFontSDF([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetDirection", ExactSpelling = true)] + public static extern int SetDirection(int direction); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetScript", ExactSpelling = true)] + public static extern int SetScript(int script); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontDirection", ExactSpelling = true)] + public static extern int SetFontDirection([NativeTypeName("TTF_Font *")] _TTF_Font* font, TTF_Direction direction); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontScriptName", ExactSpelling = true)] + public static extern int SetFontScriptName([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* script); + + [NativeTypeName("#define SDL_TTF_MAJOR_VERSION 2")] + public const int SDL_TTF_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_TTF_MINOR_VERSION 20")] + public const int SDL_TTF_MINOR_VERSION = 20; + + [NativeTypeName("#define SDL_TTF_PATCHLEVEL 2")] + public const int SDL_TTF_PATCHLEVEL = 2; + + [NativeTypeName("#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION")] + public const int TTF_MAJOR_VERSION = 2; + + [NativeTypeName("#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION")] + public const int TTF_MINOR_VERSION = 20; + + [NativeTypeName("#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL")] + public const int TTF_PATCHLEVEL = 2; + + [NativeTypeName("#define SDL_TTF_COMPILEDVERSION SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL)")] + public const int SDL_TTF_COMPILEDVERSION = ((2) * 1000 + (20) * 100 + (2)); + + [NativeTypeName("#define UNICODE_BOM_NATIVE 0xFEFF")] + public const int UNICODE_BOM_NATIVE = 0xFEFF; + + [NativeTypeName("#define UNICODE_BOM_SWAPPED 0xFFFE")] + public const int UNICODE_BOM_SWAPPED = 0xFFFE; + + [NativeTypeName("#define TTF_STYLE_NORMAL 0x00")] + public const int TTF_STYLE_NORMAL = 0x00; + + [NativeTypeName("#define TTF_STYLE_BOLD 0x01")] + public const int TTF_STYLE_BOLD = 0x01; + + [NativeTypeName("#define TTF_STYLE_ITALIC 0x02")] + public const int TTF_STYLE_ITALIC = 0x02; + + [NativeTypeName("#define TTF_STYLE_UNDERLINE 0x04")] + public const int TTF_STYLE_UNDERLINE = 0x04; + + [NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")] + public const int TTF_STYLE_STRIKETHROUGH = 0x08; + + [NativeTypeName("#define TTF_HINTING_NORMAL 0")] + public const int TTF_HINTING_NORMAL = 0; + + [NativeTypeName("#define TTF_HINTING_LIGHT 1")] + public const int TTF_HINTING_LIGHT = 1; + + [NativeTypeName("#define TTF_HINTING_MONO 2")] + public const int TTF_HINTING_MONO = 2; + + [NativeTypeName("#define TTF_HINTING_NONE 3")] + public const int TTF_HINTING_NONE = 3; + + [NativeTypeName("#define TTF_HINTING_LIGHT_SUBPIXEL 4")] + public const int TTF_HINTING_LIGHT_SUBPIXEL = 4; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_LEFT 0")] + public const int TTF_WRAPPED_ALIGN_LEFT = 0; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_CENTER 1")] + public const int TTF_WRAPPED_ALIGN_CENTER = 1; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_RIGHT 2")] + public const int TTF_WRAPPED_ALIGN_RIGHT = 2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs new file mode 100644 index 00000000..2d791c45 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum TTF_Direction + { + TTF_DIRECTION_LTR = 0, + TTF_DIRECTION_RTL, + TTF_DIRECTION_TTB, + TTF_DIRECTION_BTT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs new file mode 100644 index 00000000..ad322b94 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_AudioStream + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs new file mode 100644 index 00000000..d1280ec2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_Joystick + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs new file mode 100644 index 00000000..35f63f7c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_iconv_t + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs new file mode 100644 index 00000000..e62766cf --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _TTF_Font + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs new file mode 100644 index 00000000..8ea3fc3a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct ID3D11Device + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs new file mode 100644 index 00000000..ade1cb11 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct ID3D12Device + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs new file mode 100644 index 00000000..42715080 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct IDirect3DDevice9 + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs new file mode 100644 index 00000000..33f72853 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs @@ -0,0 +1,214 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class IMG + { + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Linked_Version", ExactSpelling = true)] + [return: NativeTypeName("const SDL_version *")] + public static extern SDL_version* Linked_Version(); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Init", ExactSpelling = true)] + public static extern int Init(int flags); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTyped_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load", ExactSpelling = true)] + public static extern SDL_Surface* Load([NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load_RW", ExactSpelling = true)] + public static extern SDL_Surface* Load_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture", ExactSpelling = true)] + public static extern SDL_Texture* LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture_RW", ExactSpelling = true)] + public static extern SDL_Texture* LoadTexture_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTextureTyped_RW", ExactSpelling = true)] + public static extern SDL_Texture* LoadTextureTyped_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isAVIF", ExactSpelling = true)] + public static extern int isAVIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isICO", ExactSpelling = true)] + public static extern int isICO(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isCUR", ExactSpelling = true)] + public static extern int isCUR(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isBMP", ExactSpelling = true)] + public static extern int isBMP(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isGIF", ExactSpelling = true)] + public static extern int isGIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJPG", ExactSpelling = true)] + public static extern int isJPG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJXL", ExactSpelling = true)] + public static extern int isJXL(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isLBM", ExactSpelling = true)] + public static extern int isLBM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPCX", ExactSpelling = true)] + public static extern int isPCX(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNG", ExactSpelling = true)] + public static extern int isPNG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNM", ExactSpelling = true)] + public static extern int isPNM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isSVG", ExactSpelling = true)] + public static extern int isSVG(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isQOI", ExactSpelling = true)] + public static extern int isQOI(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isTIF", ExactSpelling = true)] + public static extern int isTIF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXCF", ExactSpelling = true)] + public static extern int isXCF(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXPM", ExactSpelling = true)] + public static extern int isXPM(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXV", ExactSpelling = true)] + public static extern int isXV(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isWEBP", ExactSpelling = true)] + public static extern int isWEBP(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAVIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadAVIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadICO_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadICO_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadCUR_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadCUR_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadBMP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadGIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJPG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadJPG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJXL_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadJXL_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadLBM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadLBM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPCX_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPCX_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPNG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadPNM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSVG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadSVG_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadQOI_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadQOI_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTGA_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTGA_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTIF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadTIF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXCF_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXCF_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXPM_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXPM_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXV_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadXV_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadWEBP_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadWEBP_RW(SDL_RWops* src); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSizedSVG_RW", ExactSpelling = true)] + public static extern SDL_Surface* LoadSizedSVG_RW(SDL_RWops* src, int width, int height); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArray", ExactSpelling = true)] + public static extern SDL_Surface* ReadXPMFromArray([NativeTypeName("char **")] sbyte** xpm); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArrayToRGB888", ExactSpelling = true)] + public static extern SDL_Surface* ReadXPMFromArrayToRGB888([NativeTypeName("char **")] sbyte** xpm); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG", ExactSpelling = true)] + public static extern int SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG_RW", ExactSpelling = true)] + public static extern int SavePNG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG", ExactSpelling = true)] + public static extern int SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file, int quality); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG_RW", ExactSpelling = true)] + public static extern int SaveJPG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst, int quality); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimation([NativeTypeName("const char *")] sbyte* file); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimation_RW(SDL_RWops* src, int freesrc); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimationTyped_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadAnimationTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_FreeAnimation", ExactSpelling = true)] + public static extern void FreeAnimation(IMG_Animation* anim); + + [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIFAnimation_RW", ExactSpelling = true)] + public static extern IMG_Animation* LoadGIFAnimation_RW(SDL_RWops* src); + + [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 2")] + public const int SDL_IMAGE_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 6")] + public const int SDL_IMAGE_MINOR_VERSION = 6; + + [NativeTypeName("#define SDL_IMAGE_PATCHLEVEL 3")] + public const int SDL_IMAGE_PATCHLEVEL = 3; + + [NativeTypeName("#define SDL_IMAGE_COMPILEDVERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL)")] + public const int SDL_IMAGE_COMPILEDVERSION = ((2) * 1000 + (6) * 100 + (3)); + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs new file mode 100644 index 00000000..ad4f4be3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct IMG_Animation + { + public int w; + + public int h; + + public int count; + + public SDL_Surface** frames; + + public int* delays; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs new file mode 100644 index 00000000..01d7abbb --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum IMG_InitFlags + { + IMG_INIT_JPG = 0x00000001, + IMG_INIT_PNG = 0x00000002, + IMG_INIT_TIF = 0x00000004, + IMG_INIT_WEBP = 0x00000008, + IMG_INIT_JXL = 0x00000010, + IMG_INIT_AVIF = 0x00000020, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs new file mode 100644 index 00000000..2d13efdf --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_ArrayOrder + { + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs new file mode 100644 index 00000000..541c3ca4 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs @@ -0,0 +1,79 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.CompilerServices; + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_AudioCVT + { + public int needed; + + [NativeTypeName("SDL_AudioFormat")] + public ushort src_format; + + [NativeTypeName("SDL_AudioFormat")] + public ushort dst_format; + + public double rate_incr; + + [NativeTypeName("Uint8 *")] + public byte* buf; + + public int len; + + public int len_cvt; + + public int len_mult; + + public double len_ratio; + + [NativeTypeName("SDL_AudioFilter[10]")] + public _filters_e__FixedBuffer filters; + + public int filter_index; + + public unsafe partial struct _filters_e__FixedBuffer + { + public delegate* unmanaged[Cdecl] e0; + public delegate* unmanaged[Cdecl] e1; + public delegate* unmanaged[Cdecl] e2; + public delegate* unmanaged[Cdecl] e3; + public delegate* unmanaged[Cdecl] e4; + public delegate* unmanaged[Cdecl] e5; + public delegate* unmanaged[Cdecl] e6; + public delegate* unmanaged[Cdecl] e7; + public delegate* unmanaged[Cdecl] e8; + public delegate* unmanaged[Cdecl] e9; + + public ref delegate* unmanaged[Cdecl] this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + fixed (delegate* unmanaged[Cdecl]* pThis = &e0) + { + return ref pThis[index]; + } + } + } + } + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs new file mode 100644 index 00000000..19851f45 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_AudioCallback(void* userdata, [NativeTypeName("Uint8 *")] byte* stream, int len); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs new file mode 100644 index 00000000..6a2b4be4 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_AudioDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint8")] + public byte iscapture; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs new file mode 100644 index 00000000..6d696655 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_AudioFilter([NativeTypeName("struct SDL_AudioCVT *")] SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort format); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs new file mode 100644 index 00000000..17080911 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_AudioSpec + { + public int freq; + + [NativeTypeName("SDL_AudioFormat")] + public ushort format; + + [NativeTypeName("Uint8")] + public byte channels; + + [NativeTypeName("Uint8")] + public byte silence; + + [NativeTypeName("Uint16")] + public ushort samples; + + [NativeTypeName("Uint16")] + public ushort padding; + + [NativeTypeName("Uint32")] + public uint size; + + [NativeTypeName("SDL_AudioCallback")] + public delegate* unmanaged[Cdecl] callback; + + public void* userdata; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs new file mode 100644 index 00000000..c6b63238 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_AudioStatus + { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs new file mode 100644 index 00000000..ac362fd1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BitmapOrder + { + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs new file mode 100644 index 00000000..c4a03b8c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendFactor + { + SDL_BLENDFACTOR_ZERO = 0x1, + SDL_BLENDFACTOR_ONE = 0x2, + SDL_BLENDFACTOR_SRC_COLOR = 0x3, + SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, + SDL_BLENDFACTOR_SRC_ALPHA = 0x5, + SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, + SDL_BLENDFACTOR_DST_COLOR = 0x7, + SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, + SDL_BLENDFACTOR_DST_ALPHA = 0x9, + SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs new file mode 100644 index 00000000..aa717040 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendMode + { + SDL_BLENDMODE_NONE = 0x00000000, + SDL_BLENDMODE_BLEND = 0x00000001, + SDL_BLENDMODE_ADD = 0x00000002, + SDL_BLENDMODE_MOD = 0x00000004, + SDL_BLENDMODE_MUL = 0x00000008, + SDL_BLENDMODE_INVALID = 0x7FFFFFFF, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs new file mode 100644 index 00000000..557a4d0c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_BlendOperation + { + SDL_BLENDOPERATION_ADD = 0x1, + SDL_BLENDOPERATION_SUBTRACT = 0x2, + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, + SDL_BLENDOPERATION_MINIMUM = 0x4, + SDL_BLENDOPERATION_MAXIMUM = 0x5, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs new file mode 100644 index 00000000..d5a0249d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_BlitMap + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs new file mode 100644 index 00000000..f38be379 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Color + { + [NativeTypeName("Uint8")] + public byte r; + + [NativeTypeName("Uint8")] + public byte g; + + [NativeTypeName("Uint8")] + public byte b; + + [NativeTypeName("Uint8")] + public byte a; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs new file mode 100644 index 00000000..318da18f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_CommonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs new file mode 100644 index 00000000..1fdb2b85 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerAxisEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte axis; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short value; + + [NativeTypeName("Uint16")] + public ushort padding4; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs new file mode 100644 index 00000000..6a09ba56 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs new file mode 100644 index 00000000..06b1f09a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerSensorEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_ControllerSensorEvent.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerSensorEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs new file mode 100644 index 00000000..e86d5147 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_ControllerTouchpadEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Sint32")] + public int touchpad; + + [NativeTypeName("Sint32")] + public int finger; + + public float x; + + public float y; + + public float pressure; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs new file mode 100644 index 00000000..fd3dac2a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Cursor + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs new file mode 100644 index 00000000..20c1d52a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DUMMY_ENUM + { + DUMMY_ENUM_VALUE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs new file mode 100644 index 00000000..a7d53cd7 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs @@ -0,0 +1,49 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_DisplayEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint display; + + [NativeTypeName("Uint8")] + public byte @event; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint32")] + public int data1; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs new file mode 100644 index 00000000..070eb26f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DisplayEventID + { + SDL_DISPLAYEVENT_NONE, + SDL_DISPLAYEVENT_ORIENTATION, + SDL_DISPLAYEVENT_CONNECTED, + SDL_DISPLAYEVENT_DISCONNECTED, + SDL_DISPLAYEVENT_MOVED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs new file mode 100644 index 00000000..0f662cb2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_DisplayMode + { + [NativeTypeName("Uint32")] + public uint format; + + public int w; + + public int h; + + public int refresh_rate; + + public void* driverdata; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs new file mode 100644 index 00000000..5424346b --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_DisplayOrientation + { + SDL_ORIENTATION_UNKNOWN, + SDL_ORIENTATION_LANDSCAPE, + SDL_ORIENTATION_LANDSCAPE_FLIPPED, + SDL_ORIENTATION_PORTRAIT, + SDL_ORIENTATION_PORTRAIT_FLIPPED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs new file mode 100644 index 00000000..4a9a2155 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_DollarGestureEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + [NativeTypeName("SDL_GestureID")] + public long gestureId; + + [NativeTypeName("Uint32")] + public uint numFingers; + + public float error; + + public float x; + + public float y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs new file mode 100644 index 00000000..67b47f20 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_DropEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("char *")] + public sbyte* file; + + [NativeTypeName("Uint32")] + public uint windowID; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Event.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_Event.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_Event.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs new file mode 100644 index 00000000..21f529a8 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int SDL_EventFilter(void* userdata, SDL_Event* @event); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs new file mode 100644 index 00000000..422627c3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs @@ -0,0 +1,86 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_EventType : uint + { + SDL_FIRSTEVENT = 0, + SDL_QUIT = 0x100, + SDL_APP_TERMINATING, + SDL_APP_LOWMEMORY, + SDL_APP_WILLENTERBACKGROUND, + SDL_APP_DIDENTERBACKGROUND, + SDL_APP_WILLENTERFOREGROUND, + SDL_APP_DIDENTERFOREGROUND, + SDL_LOCALECHANGED, + SDL_DISPLAYEVENT = 0x150, + SDL_WINDOWEVENT = 0x200, + SDL_SYSWMEVENT, + SDL_KEYDOWN = 0x300, + SDL_KEYUP, + SDL_TEXTEDITING, + SDL_TEXTINPUT, + SDL_KEYMAPCHANGED, + SDL_TEXTEDITING_EXT, + SDL_MOUSEMOTION = 0x400, + SDL_MOUSEBUTTONDOWN, + SDL_MOUSEBUTTONUP, + SDL_MOUSEWHEEL, + SDL_JOYAXISMOTION = 0x600, + SDL_JOYBALLMOTION, + SDL_JOYHATMOTION, + SDL_JOYBUTTONDOWN, + SDL_JOYBUTTONUP, + SDL_JOYDEVICEADDED, + SDL_JOYDEVICEREMOVED, + SDL_JOYBATTERYUPDATED, + SDL_CONTROLLERAXISMOTION = 0x650, + SDL_CONTROLLERBUTTONDOWN, + SDL_CONTROLLERBUTTONUP, + SDL_CONTROLLERDEVICEADDED, + SDL_CONTROLLERDEVICEREMOVED, + SDL_CONTROLLERDEVICEREMAPPED, + SDL_CONTROLLERTOUCHPADDOWN, + SDL_CONTROLLERTOUCHPADMOTION, + SDL_CONTROLLERTOUCHPADUP, + SDL_CONTROLLERSENSORUPDATE, + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + SDL_CLIPBOARDUPDATE = 0x900, + SDL_DROPFILE = 0x1000, + SDL_DROPTEXT, + SDL_DROPBEGIN, + SDL_DROPCOMPLETE, + SDL_AUDIODEVICEADDED = 0x1100, + SDL_AUDIODEVICEREMOVED, + SDL_SENSORUPDATE = 0x1200, + SDL_RENDER_TARGETS_RESET = 0x2000, + SDL_RENDER_DEVICE_RESET, + SDL_POLLSENTINEL = 0x7F00, + SDL_USEREVENT = 0x8000, + SDL_LASTEVENT = 0xFFFF, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs new file mode 100644 index 00000000..49f5b786 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_FPoint + { + public float x; + + public float y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs new file mode 100644 index 00000000..4761637e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_FRect + { + public float x; + + public float y; + + public float w; + + public float h; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs new file mode 100644 index 00000000..d019c1ce --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_FlashOperation + { + SDL_FLASH_CANCEL, + SDL_FLASH_BRIEFLY, + SDL_FLASH_UNTIL_FOCUSED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs new file mode 100644 index 00000000..513410ec --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLContextResetNotification + { + SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, + SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs new file mode 100644 index 00000000..99c7f3e9 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs @@ -0,0 +1,54 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLattr + { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, + SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_CONTEXT_NO_ERROR, + SDL_GL_FLOATBUFFERS, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs new file mode 100644 index 00000000..c3ca834f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLcontextFlag + { + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs new file mode 100644 index 00000000..eb309fc6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLcontextReleaseFlag + { + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs new file mode 100644 index 00000000..cf5f8a36 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_GLprofile + { + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GUID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_GUID.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_GUID.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs new file mode 100644 index 00000000..799a0d49 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_HintCallback(void* userdata, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* oldValue, [NativeTypeName("const char *")] sbyte* newValue); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs new file mode 100644 index 00000000..55338d44 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_HintPriority + { + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs new file mode 100644 index 00000000..fd412ad2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate SDL_HitTestResult SDL_HitTest(SDL_Window* win, [NativeTypeName("const SDL_Point *")] SDL_Point* area, void* data); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs new file mode 100644 index 00000000..876a0aee --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_HitTestResult + { + SDL_HITTEST_NORMAL, + SDL_HITTEST_DRAGGABLE, + SDL_HITTEST_RESIZE_TOPLEFT, + SDL_HITTEST_RESIZE_TOP, + SDL_HITTEST_RESIZE_TOPRIGHT, + SDL_HITTEST_RESIZE_RIGHT, + SDL_HITTEST_RESIZE_BOTTOMRIGHT, + SDL_HITTEST_RESIZE_BOTTOM, + SDL_HITTEST_RESIZE_BOTTOMLEFT, + SDL_HITTEST_RESIZE_LEFT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs new file mode 100644 index 00000000..c6576305 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyAxisEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte axis; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short value; + + [NativeTypeName("Uint16")] + public ushort padding4; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs new file mode 100644 index 00000000..88536464 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyBallEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte ball; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint16")] + public short xrel; + + [NativeTypeName("Sint16")] + public short yrel; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs new file mode 100644 index 00000000..f8b2098c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyBatteryEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + public SDL_JoystickPowerLevel level; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs new file mode 100644 index 00000000..3ae12b30 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs new file mode 100644 index 00000000..0cd02b89 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyDeviceEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Sint32")] + public int which; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs new file mode 100644 index 00000000..6aa8815e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_JoyHatEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_JoystickID")] + public int which; + + [NativeTypeName("Uint8")] + public byte hat; + + [NativeTypeName("Uint8")] + public byte value; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs new file mode 100644 index 00000000..17e0de3c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_JoystickPowerLevel + { + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, + SDL_JOYSTICK_POWER_LOW, + SDL_JOYSTICK_POWER_MEDIUM, + SDL_JOYSTICK_POWER_FULL, + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs new file mode 100644 index 00000000..e1302bcb --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_JoystickType + { + SDL_JOYSTICK_TYPE_UNKNOWN, + SDL_JOYSTICK_TYPE_GAMECONTROLLER, + SDL_JOYSTICK_TYPE_WHEEL, + SDL_JOYSTICK_TYPE_ARCADE_STICK, + SDL_JOYSTICK_TYPE_FLIGHT_STICK, + SDL_JOYSTICK_TYPE_DANCE_PAD, + SDL_JOYSTICK_TYPE_GUITAR, + SDL_JOYSTICK_TYPE_DRUM_KIT, + SDL_JOYSTICK_TYPE_ARCADE_PAD, + SDL_JOYSTICK_TYPE_THROTTLE, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs new file mode 100644 index 00000000..3d04b9d6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs @@ -0,0 +1,272 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_Scancode; + +namespace SDL2Sharp.Interop +{ + public enum SDL_KeyCode + { + SDLK_UNKNOWN = 0, + SDLK_RETURN = '\r', + SDLK_ESCAPE = '', + SDLK_BACKSPACE = '', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + SDLK_CAPSLOCK = (SDL_SCANCODE_CAPSLOCK | (1 << 30)), + SDLK_F1 = (SDL_SCANCODE_F1 | (1 << 30)), + SDLK_F2 = (SDL_SCANCODE_F2 | (1 << 30)), + SDLK_F3 = (SDL_SCANCODE_F3 | (1 << 30)), + SDLK_F4 = (SDL_SCANCODE_F4 | (1 << 30)), + SDLK_F5 = (SDL_SCANCODE_F5 | (1 << 30)), + SDLK_F6 = (SDL_SCANCODE_F6 | (1 << 30)), + SDLK_F7 = (SDL_SCANCODE_F7 | (1 << 30)), + SDLK_F8 = (SDL_SCANCODE_F8 | (1 << 30)), + SDLK_F9 = (SDL_SCANCODE_F9 | (1 << 30)), + SDLK_F10 = (SDL_SCANCODE_F10 | (1 << 30)), + SDLK_F11 = (SDL_SCANCODE_F11 | (1 << 30)), + SDLK_F12 = (SDL_SCANCODE_F12 | (1 << 30)), + SDLK_PRINTSCREEN = (SDL_SCANCODE_PRINTSCREEN | (1 << 30)), + SDLK_SCROLLLOCK = (SDL_SCANCODE_SCROLLLOCK | (1 << 30)), + SDLK_PAUSE = (SDL_SCANCODE_PAUSE | (1 << 30)), + SDLK_INSERT = (SDL_SCANCODE_INSERT | (1 << 30)), + SDLK_HOME = (SDL_SCANCODE_HOME | (1 << 30)), + SDLK_PAGEUP = (SDL_SCANCODE_PAGEUP | (1 << 30)), + SDLK_DELETE = '', + SDLK_END = (SDL_SCANCODE_END | (1 << 30)), + SDLK_PAGEDOWN = (SDL_SCANCODE_PAGEDOWN | (1 << 30)), + SDLK_RIGHT = (SDL_SCANCODE_RIGHT | (1 << 30)), + SDLK_LEFT = (SDL_SCANCODE_LEFT | (1 << 30)), + SDLK_DOWN = (SDL_SCANCODE_DOWN | (1 << 30)), + SDLK_UP = (SDL_SCANCODE_UP | (1 << 30)), + SDLK_NUMLOCKCLEAR = (SDL_SCANCODE_NUMLOCKCLEAR | (1 << 30)), + SDLK_KP_DIVIDE = (SDL_SCANCODE_KP_DIVIDE | (1 << 30)), + SDLK_KP_MULTIPLY = (SDL_SCANCODE_KP_MULTIPLY | (1 << 30)), + SDLK_KP_MINUS = (SDL_SCANCODE_KP_MINUS | (1 << 30)), + SDLK_KP_PLUS = (SDL_SCANCODE_KP_PLUS | (1 << 30)), + SDLK_KP_ENTER = (SDL_SCANCODE_KP_ENTER | (1 << 30)), + SDLK_KP_1 = (SDL_SCANCODE_KP_1 | (1 << 30)), + SDLK_KP_2 = (SDL_SCANCODE_KP_2 | (1 << 30)), + SDLK_KP_3 = (SDL_SCANCODE_KP_3 | (1 << 30)), + SDLK_KP_4 = (SDL_SCANCODE_KP_4 | (1 << 30)), + SDLK_KP_5 = (SDL_SCANCODE_KP_5 | (1 << 30)), + SDLK_KP_6 = (SDL_SCANCODE_KP_6 | (1 << 30)), + SDLK_KP_7 = (SDL_SCANCODE_KP_7 | (1 << 30)), + SDLK_KP_8 = (SDL_SCANCODE_KP_8 | (1 << 30)), + SDLK_KP_9 = (SDL_SCANCODE_KP_9 | (1 << 30)), + SDLK_KP_0 = (SDL_SCANCODE_KP_0 | (1 << 30)), + SDLK_KP_PERIOD = (SDL_SCANCODE_KP_PERIOD | (1 << 30)), + SDLK_APPLICATION = (SDL_SCANCODE_APPLICATION | (1 << 30)), + SDLK_POWER = (SDL_SCANCODE_POWER | (1 << 30)), + SDLK_KP_EQUALS = (SDL_SCANCODE_KP_EQUALS | (1 << 30)), + SDLK_F13 = (SDL_SCANCODE_F13 | (1 << 30)), + SDLK_F14 = (SDL_SCANCODE_F14 | (1 << 30)), + SDLK_F15 = (SDL_SCANCODE_F15 | (1 << 30)), + SDLK_F16 = (SDL_SCANCODE_F16 | (1 << 30)), + SDLK_F17 = (SDL_SCANCODE_F17 | (1 << 30)), + SDLK_F18 = (SDL_SCANCODE_F18 | (1 << 30)), + SDLK_F19 = (SDL_SCANCODE_F19 | (1 << 30)), + SDLK_F20 = (SDL_SCANCODE_F20 | (1 << 30)), + SDLK_F21 = (SDL_SCANCODE_F21 | (1 << 30)), + SDLK_F22 = (SDL_SCANCODE_F22 | (1 << 30)), + SDLK_F23 = (SDL_SCANCODE_F23 | (1 << 30)), + SDLK_F24 = (SDL_SCANCODE_F24 | (1 << 30)), + SDLK_EXECUTE = (SDL_SCANCODE_EXECUTE | (1 << 30)), + SDLK_HELP = (SDL_SCANCODE_HELP | (1 << 30)), + SDLK_MENU = (SDL_SCANCODE_MENU | (1 << 30)), + SDLK_SELECT = (SDL_SCANCODE_SELECT | (1 << 30)), + SDLK_STOP = (SDL_SCANCODE_STOP | (1 << 30)), + SDLK_AGAIN = (SDL_SCANCODE_AGAIN | (1 << 30)), + SDLK_UNDO = (SDL_SCANCODE_UNDO | (1 << 30)), + SDLK_CUT = (SDL_SCANCODE_CUT | (1 << 30)), + SDLK_COPY = (SDL_SCANCODE_COPY | (1 << 30)), + SDLK_PASTE = (SDL_SCANCODE_PASTE | (1 << 30)), + SDLK_FIND = (SDL_SCANCODE_FIND | (1 << 30)), + SDLK_MUTE = (SDL_SCANCODE_MUTE | (1 << 30)), + SDLK_VOLUMEUP = (SDL_SCANCODE_VOLUMEUP | (1 << 30)), + SDLK_VOLUMEDOWN = (SDL_SCANCODE_VOLUMEDOWN | (1 << 30)), + SDLK_KP_COMMA = (SDL_SCANCODE_KP_COMMA | (1 << 30)), + SDLK_KP_EQUALSAS400 = (SDL_SCANCODE_KP_EQUALSAS400 | (1 << 30)), + SDLK_ALTERASE = (SDL_SCANCODE_ALTERASE | (1 << 30)), + SDLK_SYSREQ = (SDL_SCANCODE_SYSREQ | (1 << 30)), + SDLK_CANCEL = (SDL_SCANCODE_CANCEL | (1 << 30)), + SDLK_CLEAR = (SDL_SCANCODE_CLEAR | (1 << 30)), + SDLK_PRIOR = (SDL_SCANCODE_PRIOR | (1 << 30)), + SDLK_RETURN2 = (SDL_SCANCODE_RETURN2 | (1 << 30)), + SDLK_SEPARATOR = (SDL_SCANCODE_SEPARATOR | (1 << 30)), + SDLK_OUT = (SDL_SCANCODE_OUT | (1 << 30)), + SDLK_OPER = (SDL_SCANCODE_OPER | (1 << 30)), + SDLK_CLEARAGAIN = (SDL_SCANCODE_CLEARAGAIN | (1 << 30)), + SDLK_CRSEL = (SDL_SCANCODE_CRSEL | (1 << 30)), + SDLK_EXSEL = (SDL_SCANCODE_EXSEL | (1 << 30)), + SDLK_KP_00 = (SDL_SCANCODE_KP_00 | (1 << 30)), + SDLK_KP_000 = (SDL_SCANCODE_KP_000 | (1 << 30)), + SDLK_THOUSANDSSEPARATOR = (SDL_SCANCODE_THOUSANDSSEPARATOR | (1 << 30)), + SDLK_DECIMALSEPARATOR = (SDL_SCANCODE_DECIMALSEPARATOR | (1 << 30)), + SDLK_CURRENCYUNIT = (SDL_SCANCODE_CURRENCYUNIT | (1 << 30)), + SDLK_CURRENCYSUBUNIT = (SDL_SCANCODE_CURRENCYSUBUNIT | (1 << 30)), + SDLK_KP_LEFTPAREN = (SDL_SCANCODE_KP_LEFTPAREN | (1 << 30)), + SDLK_KP_RIGHTPAREN = (SDL_SCANCODE_KP_RIGHTPAREN | (1 << 30)), + SDLK_KP_LEFTBRACE = (SDL_SCANCODE_KP_LEFTBRACE | (1 << 30)), + SDLK_KP_RIGHTBRACE = (SDL_SCANCODE_KP_RIGHTBRACE | (1 << 30)), + SDLK_KP_TAB = (SDL_SCANCODE_KP_TAB | (1 << 30)), + SDLK_KP_BACKSPACE = (SDL_SCANCODE_KP_BACKSPACE | (1 << 30)), + SDLK_KP_A = (SDL_SCANCODE_KP_A | (1 << 30)), + SDLK_KP_B = (SDL_SCANCODE_KP_B | (1 << 30)), + SDLK_KP_C = (SDL_SCANCODE_KP_C | (1 << 30)), + SDLK_KP_D = (SDL_SCANCODE_KP_D | (1 << 30)), + SDLK_KP_E = (SDL_SCANCODE_KP_E | (1 << 30)), + SDLK_KP_F = (SDL_SCANCODE_KP_F | (1 << 30)), + SDLK_KP_XOR = (SDL_SCANCODE_KP_XOR | (1 << 30)), + SDLK_KP_POWER = (SDL_SCANCODE_KP_POWER | (1 << 30)), + SDLK_KP_PERCENT = (SDL_SCANCODE_KP_PERCENT | (1 << 30)), + SDLK_KP_LESS = (SDL_SCANCODE_KP_LESS | (1 << 30)), + SDLK_KP_GREATER = (SDL_SCANCODE_KP_GREATER | (1 << 30)), + SDLK_KP_AMPERSAND = (SDL_SCANCODE_KP_AMPERSAND | (1 << 30)), + SDLK_KP_DBLAMPERSAND = (SDL_SCANCODE_KP_DBLAMPERSAND | (1 << 30)), + SDLK_KP_VERTICALBAR = (SDL_SCANCODE_KP_VERTICALBAR | (1 << 30)), + SDLK_KP_DBLVERTICALBAR = (SDL_SCANCODE_KP_DBLVERTICALBAR | (1 << 30)), + SDLK_KP_COLON = (SDL_SCANCODE_KP_COLON | (1 << 30)), + SDLK_KP_HASH = (SDL_SCANCODE_KP_HASH | (1 << 30)), + SDLK_KP_SPACE = (SDL_SCANCODE_KP_SPACE | (1 << 30)), + SDLK_KP_AT = (SDL_SCANCODE_KP_AT | (1 << 30)), + SDLK_KP_EXCLAM = (SDL_SCANCODE_KP_EXCLAM | (1 << 30)), + SDLK_KP_MEMSTORE = (SDL_SCANCODE_KP_MEMSTORE | (1 << 30)), + SDLK_KP_MEMRECALL = (SDL_SCANCODE_KP_MEMRECALL | (1 << 30)), + SDLK_KP_MEMCLEAR = (SDL_SCANCODE_KP_MEMCLEAR | (1 << 30)), + SDLK_KP_MEMADD = (SDL_SCANCODE_KP_MEMADD | (1 << 30)), + SDLK_KP_MEMSUBTRACT = (SDL_SCANCODE_KP_MEMSUBTRACT | (1 << 30)), + SDLK_KP_MEMMULTIPLY = (SDL_SCANCODE_KP_MEMMULTIPLY | (1 << 30)), + SDLK_KP_MEMDIVIDE = (SDL_SCANCODE_KP_MEMDIVIDE | (1 << 30)), + SDLK_KP_PLUSMINUS = (SDL_SCANCODE_KP_PLUSMINUS | (1 << 30)), + SDLK_KP_CLEAR = (SDL_SCANCODE_KP_CLEAR | (1 << 30)), + SDLK_KP_CLEARENTRY = (SDL_SCANCODE_KP_CLEARENTRY | (1 << 30)), + SDLK_KP_BINARY = (SDL_SCANCODE_KP_BINARY | (1 << 30)), + SDLK_KP_OCTAL = (SDL_SCANCODE_KP_OCTAL | (1 << 30)), + SDLK_KP_DECIMAL = (SDL_SCANCODE_KP_DECIMAL | (1 << 30)), + SDLK_KP_HEXADECIMAL = (SDL_SCANCODE_KP_HEXADECIMAL | (1 << 30)), + SDLK_LCTRL = (SDL_SCANCODE_LCTRL | (1 << 30)), + SDLK_LSHIFT = (SDL_SCANCODE_LSHIFT | (1 << 30)), + SDLK_LALT = (SDL_SCANCODE_LALT | (1 << 30)), + SDLK_LGUI = (SDL_SCANCODE_LGUI | (1 << 30)), + SDLK_RCTRL = (SDL_SCANCODE_RCTRL | (1 << 30)), + SDLK_RSHIFT = (SDL_SCANCODE_RSHIFT | (1 << 30)), + SDLK_RALT = (SDL_SCANCODE_RALT | (1 << 30)), + SDLK_RGUI = (SDL_SCANCODE_RGUI | (1 << 30)), + SDLK_MODE = (SDL_SCANCODE_MODE | (1 << 30)), + SDLK_AUDIONEXT = (SDL_SCANCODE_AUDIONEXT | (1 << 30)), + SDLK_AUDIOPREV = (SDL_SCANCODE_AUDIOPREV | (1 << 30)), + SDLK_AUDIOSTOP = (SDL_SCANCODE_AUDIOSTOP | (1 << 30)), + SDLK_AUDIOPLAY = (SDL_SCANCODE_AUDIOPLAY | (1 << 30)), + SDLK_AUDIOMUTE = (SDL_SCANCODE_AUDIOMUTE | (1 << 30)), + SDLK_MEDIASELECT = (SDL_SCANCODE_MEDIASELECT | (1 << 30)), + SDLK_WWW = (SDL_SCANCODE_WWW | (1 << 30)), + SDLK_MAIL = (SDL_SCANCODE_MAIL | (1 << 30)), + SDLK_CALCULATOR = (SDL_SCANCODE_CALCULATOR | (1 << 30)), + SDLK_COMPUTER = (SDL_SCANCODE_COMPUTER | (1 << 30)), + SDLK_AC_SEARCH = (SDL_SCANCODE_AC_SEARCH | (1 << 30)), + SDLK_AC_HOME = (SDL_SCANCODE_AC_HOME | (1 << 30)), + SDLK_AC_BACK = (SDL_SCANCODE_AC_BACK | (1 << 30)), + SDLK_AC_FORWARD = (SDL_SCANCODE_AC_FORWARD | (1 << 30)), + SDLK_AC_STOP = (SDL_SCANCODE_AC_STOP | (1 << 30)), + SDLK_AC_REFRESH = (SDL_SCANCODE_AC_REFRESH | (1 << 30)), + SDLK_AC_BOOKMARKS = (SDL_SCANCODE_AC_BOOKMARKS | (1 << 30)), + SDLK_BRIGHTNESSDOWN = (SDL_SCANCODE_BRIGHTNESSDOWN | (1 << 30)), + SDLK_BRIGHTNESSUP = (SDL_SCANCODE_BRIGHTNESSUP | (1 << 30)), + SDLK_DISPLAYSWITCH = (SDL_SCANCODE_DISPLAYSWITCH | (1 << 30)), + SDLK_KBDILLUMTOGGLE = (SDL_SCANCODE_KBDILLUMTOGGLE | (1 << 30)), + SDLK_KBDILLUMDOWN = (SDL_SCANCODE_KBDILLUMDOWN | (1 << 30)), + SDLK_KBDILLUMUP = (SDL_SCANCODE_KBDILLUMUP | (1 << 30)), + SDLK_EJECT = (SDL_SCANCODE_EJECT | (1 << 30)), + SDLK_SLEEP = (SDL_SCANCODE_SLEEP | (1 << 30)), + SDLK_APP1 = (SDL_SCANCODE_APP1 | (1 << 30)), + SDLK_APP2 = (SDL_SCANCODE_APP2 | (1 << 30)), + SDLK_AUDIOREWIND = (SDL_SCANCODE_AUDIOREWIND | (1 << 30)), + SDLK_AUDIOFASTFORWARD = (SDL_SCANCODE_AUDIOFASTFORWARD | (1 << 30)), + SDLK_SOFTLEFT = (SDL_SCANCODE_SOFTLEFT | (1 << 30)), + SDLK_SOFTRIGHT = (SDL_SCANCODE_SOFTRIGHT | (1 << 30)), + SDLK_CALL = (SDL_SCANCODE_CALL | (1 << 30)), + SDLK_ENDCALL = (SDL_SCANCODE_ENDCALL | (1 << 30)), + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs new file mode 100644 index 00000000..6ec8a2e3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs @@ -0,0 +1,48 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_KeyboardEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte repeat; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + public SDL_Keysym keysym; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs new file mode 100644 index 00000000..2acca89e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs @@ -0,0 +1,44 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_Keymod + { + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_SCROLL = 0x8000, + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, + KMOD_ALT = KMOD_LALT | KMOD_RALT, + KMOD_GUI = KMOD_LGUI | KMOD_RGUI, + KMOD_RESERVED = KMOD_SCROLL, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs new file mode 100644 index 00000000..d23836a8 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Keysym + { + public SDL_Scancode scancode; + + [NativeTypeName("SDL_Keycode")] + public int sym; + + [NativeTypeName("Uint16")] + public ushort mod; + + [NativeTypeName("Uint32")] + public uint unused; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs new file mode 100644 index 00000000..11d2c76a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs @@ -0,0 +1,46 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_LogCategory + { + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + SDL_LOG_CATEGORY_CUSTOM, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs new file mode 100644 index 00000000..08b8f567 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_LogOutputFunction(void* userdata, int category, SDL_LogPriority priority, [NativeTypeName("const char *")] sbyte* message); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs new file mode 100644 index 00000000..6c754af1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_LogPriority + { + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs new file mode 100644 index 00000000..61c1b959 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs @@ -0,0 +1,55 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseButtonEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint8")] + public byte button; + + [NativeTypeName("Uint8")] + public byte state; + + [NativeTypeName("Uint8")] + public byte clicks; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs new file mode 100644 index 00000000..df78952e --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseMotionEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Uint32")] + public uint state; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + + [NativeTypeName("Sint32")] + public int xrel; + + [NativeTypeName("Sint32")] + public int yrel; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs new file mode 100644 index 00000000..2bf9e69d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_MouseWheelDirection + { + SDL_MOUSEWHEEL_NORMAL, + SDL_MOUSEWHEEL_FLIPPED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs new file mode 100644 index 00000000..eebc6fe2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs @@ -0,0 +1,56 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MouseWheelEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint32")] + public uint which; + + [NativeTypeName("Sint32")] + public int x; + + [NativeTypeName("Sint32")] + public int y; + + [NativeTypeName("Uint32")] + public uint direction; + + public float preciseX; + + public float preciseY; + + [NativeTypeName("Sint32")] + public int mouseX; + + [NativeTypeName("Sint32")] + public int mouseY; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs new file mode 100644 index 00000000..6048be59 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs @@ -0,0 +1,48 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_MultiGestureEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + public float dTheta; + + public float dDist; + + public float x; + + public float y; + + [NativeTypeName("Uint16")] + public ushort numFingers; + + [NativeTypeName("Uint16")] + public ushort padding; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs new file mode 100644 index 00000000..00176cd6 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_OSEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs new file mode 100644 index 00000000..9e38cab3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PackedLayout + { + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs new file mode 100644 index 00000000..abfa0753 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PackedOrder + { + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs new file mode 100644 index 00000000..59b59cbc --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_Palette + { + public int ncolors; + + public SDL_Color* colors; + + [NativeTypeName("Uint32")] + public uint version; + + public int refcount; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormat.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_PixelFormat.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormat.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs new file mode 100644 index 00000000..03f347b5 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs @@ -0,0 +1,83 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using static SDL2Sharp.Interop.SDL_ArrayOrder; +using static SDL2Sharp.Interop.SDL_BitmapOrder; +using static SDL2Sharp.Interop.SDL_PackedLayout; +using static SDL2Sharp.Interop.SDL_PackedOrder; +using static SDL2Sharp.Interop.SDL_PixelType; + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_PixelFormatEnum : uint + { + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX1MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX4LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), + SDL_PIXELFORMAT_INDEX4MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), + 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)), + SDL_PIXELFORMAT_BGRA4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_ARGB1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGBA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_ABGR1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_BGRA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGB565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_BGR565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), + SDL_PIXELFORMAT_RGB24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_RGB) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), + SDL_PIXELFORMAT_BGR24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_BGR) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), + SDL_PIXELFORMAT_XRGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, + SDL_PIXELFORMAT_RGBX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_XBGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, + SDL_PIXELFORMAT_BGRX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ARGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGBA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ABGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_BGRA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_ARGB2101010 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_2101010) << 16) | ((32) << 8) | ((4) << 0)), + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_YV12 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_IYUV = (unchecked(((uint)((byte)('I')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('U')) << 16) | ((uint)((byte)('V')) << 24))), + SDL_PIXELFORMAT_YUY2 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('U')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_UYVY = (unchecked(((uint)((byte)('U')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('V')) << 16) | ((uint)((byte)('Y')) << 24))), + SDL_PIXELFORMAT_YVYU = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('U')) << 24))), + SDL_PIXELFORMAT_NV12 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), + SDL_PIXELFORMAT_NV21 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('2')) << 16) | ((uint)((byte)('1')) << 24))), + SDL_PIXELFORMAT_EXTERNAL_OES = (unchecked(((uint)((byte)('O')) << 0) | ((uint)((byte)('E')) << 8) | ((uint)((byte)('S')) << 16) | ((uint)((byte)(' ')) << 24))), + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs new file mode 100644 index 00000000..9c1afa75 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs @@ -0,0 +1,38 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_PixelType + { + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs new file mode 100644 index 00000000..694e3da0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Point + { + public int x; + + public int y; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs new file mode 100644 index 00000000..fe0f5025 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_QuitEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs new file mode 100644 index 00000000..945a6527 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs @@ -0,0 +1,104 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_RWops + { + [NativeTypeName("Sint64 (*)(struct SDL_RWops *) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] size; + + [NativeTypeName("Sint64 (*)(struct SDL_RWops *, Sint64, int) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] seek; + + [NativeTypeName("size_t (*)(struct SDL_RWops *, void *, size_t, size_t) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] read; + + [NativeTypeName("size_t (*)(struct SDL_RWops *, const void *, size_t, size_t) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] write; + + [NativeTypeName("int (*)(struct SDL_RWops *) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] close; + + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("__AnonymousRecord_SDL_rwops_L94_C5")] + public _hidden_e__Union hidden; + + [StructLayout(LayoutKind.Explicit)] + public partial struct _hidden_e__Union + { + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L102_C9")] + public _windowsio_e__Struct windowsio; + + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L122_C9")] + public _mem_e__Struct mem; + + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_SDL_rwops_L128_C9")] + public _unknown_e__Struct unknown; + + public unsafe partial struct _windowsio_e__Struct + { + public SDL_bool append; + + public void* h; + + [NativeTypeName("__AnonymousRecord_SDL_rwops_L106_C13")] + public _buffer_e__Struct buffer; + + public unsafe partial struct _buffer_e__Struct + { + public void* data; + + [NativeTypeName("size_t")] + public nuint size; + + [NativeTypeName("size_t")] + public nuint left; + } + } + + public unsafe partial struct _mem_e__Struct + { + [NativeTypeName("Uint8 *")] + public byte* @base; + + [NativeTypeName("Uint8 *")] + public byte* here; + + [NativeTypeName("Uint8 *")] + public byte* stop; + } + + public unsafe partial struct _unknown_e__Struct + { + public void* data1; + + public void* data2; + } + } + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs new file mode 100644 index 00000000..d54b0ea0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Rect + { + public int x; + + public int y; + + public int w; + + public int h; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs new file mode 100644 index 00000000..f7b963ca --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Renderer + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs new file mode 100644 index 00000000..71b6202d --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + [NativeTypeName("int")] + public enum SDL_RendererFlags : uint + { + SDL_RENDERER_SOFTWARE = 0x00000001, + SDL_RENDERER_ACCELERATED = 0x00000002, + SDL_RENDERER_PRESENTVSYNC = 0x00000004, + SDL_RENDERER_TARGETTEXTURE = 0x00000008, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs new file mode 100644 index 00000000..ca274bac --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_RendererFlip + { + SDL_FLIP_NONE = 0x00000000, + SDL_FLIP_HORIZONTAL = 0x00000001, + SDL_FLIP_VERTICAL = 0x00000002, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererInfo.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_RendererInfo.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererInfo.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs new file mode 100644 index 00000000..5f5313e0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_ScaleMode + { + SDL_ScaleModeNearest, + SDL_ScaleModeLinear, + SDL_ScaleModeBest, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs new file mode 100644 index 00000000..e2e09b33 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs @@ -0,0 +1,274 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_Scancode + { + SDL_SCANCODE_UNKNOWN = 0, + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, + SDL_SCANCODE_NONUSHASH = 50, + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + SDL_SCANCODE_CAPSLOCK = 57, + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + SDL_SCANCODE_NUMLOCKCLEAR = 83, + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + SDL_SCANCODE_NONUSBACKSLASH = 100, + SDL_SCANCODE_APPLICATION = 101, + SDL_SCANCODE_POWER = 102, + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + SDL_SCANCODE_INTERNATIONAL1 = 135, + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, + SDL_SCANCODE_LANG2 = 145, + SDL_SCANCODE_LANG3 = 146, + SDL_SCANCODE_LANG4 = 147, + SDL_SCANCODE_LANG5 = 148, + SDL_SCANCODE_LANG6 = 149, + SDL_SCANCODE_LANG7 = 150, + SDL_SCANCODE_LANG8 = 151, + SDL_SCANCODE_LANG9 = 152, + SDL_SCANCODE_ALTERASE = 153, + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, + SDL_SCANCODE_LGUI = 227, + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + 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_SOFTLEFT = 287, + SDL_SCANCODE_SOFTRIGHT = 288, + SDL_SCANCODE_CALL = 289, + SDL_SCANCODE_ENDCALL = 290, + SDL_NUM_SCANCODES = 512, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SensorEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_SensorEvent.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_SensorEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs new file mode 100644 index 00000000..af9d6e71 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_Surface + { + [NativeTypeName("Uint32")] + public uint flags; + + public SDL_PixelFormat* format; + + public int w; + + public int h; + + public int pitch; + + public void* pixels; + + public void* userdata; + + public int locked; + + public void* list_blitmap; + + public SDL_Rect clip_rect; + + public SDL_BlitMap* map; + + public int refcount; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs new file mode 100644 index 00000000..1141d0ec --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs @@ -0,0 +1,33 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_SysWMEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + public SDL_SysWMmsg* msg; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs new file mode 100644 index 00000000..0da87cae --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_SysWMmsg + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs new file mode 100644 index 00000000..3578e6d2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs @@ -0,0 +1,39 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_SystemCursor + { + SDL_SYSTEM_CURSOR_ARROW, + SDL_SYSTEM_CURSOR_IBEAM, + 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_NUM_SYSTEM_CURSORS, + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TextEditingEvent.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs new file mode 100644 index 00000000..13afc1f3 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs @@ -0,0 +1,43 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_TextEditingExtEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("char *")] + public sbyte* text; + + [NativeTypeName("Sint32")] + public int start; + + [NativeTypeName("Sint32")] + public int length; + } +} diff --git a/sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextInputEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/SDL_TextInputEvent.cs rename to sources/SDL2Sharp.Interop/codegen/latest/SDL_TextInputEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs new file mode 100644 index 00000000..4f76e639 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Texture + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs new file mode 100644 index 00000000..adadc839 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_TextureAccess + { + SDL_TEXTUREACCESS_STATIC, + SDL_TEXTUREACCESS_STREAMING, + SDL_TEXTUREACCESS_TARGET, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs new file mode 100644 index 00000000..7a092826 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_TextureModulate + { + SDL_TEXTUREMODULATE_NONE = 0x00000000, + SDL_TEXTUREMODULATE_COLOR = 0x00000001, + SDL_TEXTUREMODULATE_ALPHA = 0x00000002, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs new file mode 100644 index 00000000..f0f603b1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_TouchFingerEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("SDL_TouchID")] + public long touchId; + + [NativeTypeName("SDL_FingerID")] + public long fingerId; + + public float x; + + public float y; + + public float dx; + + public float dy; + + public float pressure; + + [NativeTypeName("Uint32")] + public uint windowID; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs new file mode 100644 index 00000000..86342093 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs @@ -0,0 +1,41 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_UserEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Sint32")] + public int code; + + public void* data1; + + public void* data2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs new file mode 100644 index 00000000..bc2349d1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs @@ -0,0 +1,31 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Vertex + { + public SDL_FPoint position; + + public SDL_Color color; + + public SDL_FPoint tex_coord; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs new file mode 100644 index 00000000..4a75f501 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs @@ -0,0 +1,78 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public unsafe partial struct SDL_VirtualJoystickDesc + { + [NativeTypeName("Uint16")] + public ushort version; + + [NativeTypeName("Uint16")] + public ushort type; + + [NativeTypeName("Uint16")] + public ushort naxes; + + [NativeTypeName("Uint16")] + public ushort nbuttons; + + [NativeTypeName("Uint16")] + public ushort nhats; + + [NativeTypeName("Uint16")] + public ushort vendor_id; + + [NativeTypeName("Uint16")] + public ushort product_id; + + [NativeTypeName("Uint16")] + public ushort padding; + + [NativeTypeName("Uint32")] + public uint button_mask; + + [NativeTypeName("Uint32")] + public uint axis_mask; + + [NativeTypeName("const char *")] + public sbyte* name; + + public void* userdata; + + [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] Update; + + [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] SetPlayerIndex; + + [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] Rumble; + + [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] RumbleTriggers; + + [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] SetLED; + + [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] + public delegate* unmanaged[Cdecl] SendEffect; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs new file mode 100644 index 00000000..8a0ea826 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_Window + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs new file mode 100644 index 00000000..34ae6ca4 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs @@ -0,0 +1,52 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_WindowEvent + { + [NativeTypeName("Uint32")] + public uint type; + + [NativeTypeName("Uint32")] + public uint timestamp; + + [NativeTypeName("Uint32")] + public uint windowID; + + [NativeTypeName("Uint8")] + public byte @event; + + [NativeTypeName("Uint8")] + public byte padding1; + + [NativeTypeName("Uint8")] + public byte padding2; + + [NativeTypeName("Uint8")] + public byte padding3; + + [NativeTypeName("Sint32")] + public int data1; + + [NativeTypeName("Sint32")] + public int data2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs new file mode 100644 index 00000000..9ee1dd48 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs @@ -0,0 +1,45 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_WindowEventID + { + SDL_WINDOWEVENT_NONE, + SDL_WINDOWEVENT_SHOWN, + SDL_WINDOWEVENT_HIDDEN, + SDL_WINDOWEVENT_EXPOSED, + SDL_WINDOWEVENT_MOVED, + SDL_WINDOWEVENT_RESIZED, + SDL_WINDOWEVENT_SIZE_CHANGED, + SDL_WINDOWEVENT_MINIMIZED, + SDL_WINDOWEVENT_MAXIMIZED, + SDL_WINDOWEVENT_RESTORED, + SDL_WINDOWEVENT_ENTER, + SDL_WINDOWEVENT_LEAVE, + SDL_WINDOWEVENT_FOCUS_GAINED, + SDL_WINDOWEVENT_FOCUS_LOST, + SDL_WINDOWEVENT_CLOSE, + SDL_WINDOWEVENT_TAKE_FOCUS, + SDL_WINDOWEVENT_HIT_TEST, + SDL_WINDOWEVENT_ICCPROF_CHANGED, + SDL_WINDOWEVENT_DISPLAY_CHANGED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs new file mode 100644 index 00000000..6b93c22f --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_WindowFlags + { + SDL_WINDOW_FULLSCREEN = 0x00000001, + SDL_WINDOW_OPENGL = 0x00000002, + SDL_WINDOW_SHOWN = 0x00000004, + SDL_WINDOW_HIDDEN = 0x00000008, + SDL_WINDOW_BORDERLESS = 0x00000010, + SDL_WINDOW_RESIZABLE = 0x00000020, + SDL_WINDOW_MINIMIZED = 0x00000040, + SDL_WINDOW_MAXIMIZED = 0x00000080, + SDL_WINDOW_MOUSE_GRABBED = 0x00000100, + SDL_WINDOW_INPUT_FOCUS = 0x00000200, + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, + SDL_WINDOW_FULLSCREEN_DESKTOP = (SDL_WINDOW_FULLSCREEN | 0x00001000), + SDL_WINDOW_FOREIGN = 0x00000800, + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, + SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, + SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, + SDL_WINDOW_SKIP_TASKBAR = 0x00010000, + SDL_WINDOW_UTILITY = 0x00020000, + SDL_WINDOW_TOOLTIP = 0x00040000, + SDL_WINDOW_POPUP_MENU = 0x00080000, + SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, + SDL_WINDOW_VULKAN = 0x10000000, + SDL_WINDOW_METAL = 0x20000000, + SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs new file mode 100644 index 00000000..fda93f33 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_WindowsMessageHook(void* userdata, void* hWnd, [NativeTypeName("unsigned int")] uint message, [NativeTypeName("Uint64")] ulong wParam, [NativeTypeName("Sint64")] long lParam); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs new file mode 100644 index 00000000..ed05fb6c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_YUV_CONVERSION_MODE + { + SDL_YUV_CONVERSION_JPEG, + SDL_YUV_CONVERSION_BT601, + SDL_YUV_CONVERSION_BT709, + SDL_YUV_CONVERSION_AUTOMATIC, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs new file mode 100644 index 00000000..35ece88a --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int SDL_blit([NativeTypeName("struct SDL_Surface *")] SDL_Surface* src, SDL_Rect* srcrect, [NativeTypeName("struct SDL_Surface *")] SDL_Surface* dst, SDL_Rect* dstrect); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs new file mode 100644 index 00000000..40fb33e9 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_bool + { + SDL_FALSE = 0, + SDL_TRUE = 1, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs new file mode 100644 index 00000000..968f9973 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void* SDL_calloc_func([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs new file mode 100644 index 00000000..7f92c831 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_errorcode + { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs new file mode 100644 index 00000000..4464a3e5 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs @@ -0,0 +1,29 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum SDL_eventaction + { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs new file mode 100644 index 00000000..e4cc9387 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void SDL_free_func(void* mem); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs new file mode 100644 index 00000000..8bbd3a31 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void* SDL_malloc_func([NativeTypeName("size_t")] UIntPtr size); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs new file mode 100644 index 00000000..322a5eb0 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs @@ -0,0 +1,28 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void* SDL_realloc_func(void* mem, [NativeTypeName("size_t")] UIntPtr size); +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs new file mode 100644 index 00000000..49d51362 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct SDL_version + { + [NativeTypeName("Uint8")] + public byte major; + + [NativeTypeName("Uint8")] + public byte minor; + + [NativeTypeName("Uint8")] + public byte patch; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs b/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs new file mode 100644 index 00000000..4f6a1fc1 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs @@ -0,0 +1,366 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; + +namespace SDL2Sharp.Interop +{ + public static unsafe partial class TTF + { + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Linked_Version", ExactSpelling = true)] + [return: NativeTypeName("const SDL_version *")] + public static extern SDL_version* Linked_Version(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFreeTypeVersion", ExactSpelling = true)] + public static extern void GetFreeTypeVersion(int* major, int* minor, int* patch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetHarfBuzzVersion", ExactSpelling = true)] + public static extern void GetHarfBuzzVersion(int* major, int* minor, int* patch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_ByteSwappedUNICODE", ExactSpelling = true)] + public static extern void ByteSwappedUNICODE(SDL_bool swapped); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Init", ExactSpelling = true)] + public static extern int Init(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFont", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFont([NativeTypeName("const char *")] sbyte* file, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndex", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndex([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontRW(SDL_RWops* src, int freesrc, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPI", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPI", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPIRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPIRW", ExactSpelling = true)] + [return: NativeTypeName("TTF_Font *")] + public static extern _TTF_Font* OpenFontIndexDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSize", ExactSpelling = true)] + public static extern int SetFontSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSizeDPI", ExactSpelling = true)] + public static extern int SetFontSizeDPI([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontStyle", ExactSpelling = true)] + public static extern int GetFontStyle([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontStyle", ExactSpelling = true)] + public static extern void SetFontStyle([NativeTypeName("TTF_Font *")] _TTF_Font* font, int style); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontOutline", ExactSpelling = true)] + public static extern int GetFontOutline([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontOutline", ExactSpelling = true)] + public static extern void SetFontOutline([NativeTypeName("TTF_Font *")] _TTF_Font* font, int outline); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontHinting", ExactSpelling = true)] + public static extern int GetFontHinting([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontHinting", ExactSpelling = true)] + public static extern void SetFontHinting([NativeTypeName("TTF_Font *")] _TTF_Font* font, int hinting); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontWrappedAlign", ExactSpelling = true)] + public static extern int GetFontWrappedAlign([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontWrappedAlign", ExactSpelling = true)] + public static extern void SetFontWrappedAlign([NativeTypeName("TTF_Font *")] _TTF_Font* font, int align); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontHeight", ExactSpelling = true)] + public static extern int FontHeight([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontAscent", ExactSpelling = true)] + public static extern int FontAscent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontDescent", ExactSpelling = true)] + public static extern int FontDescent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontLineSkip", ExactSpelling = true)] + public static extern int FontLineSkip([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerning", ExactSpelling = true)] + public static extern int GetFontKerning([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontKerning", ExactSpelling = true)] + public static extern void SetFontKerning([NativeTypeName("TTF_Font *")] _TTF_Font* font, int allowed); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaces", ExactSpelling = true)] + [return: NativeTypeName("long")] + public static extern int FontFaces([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceIsFixedWidth", ExactSpelling = true)] + public static extern int FontFaceIsFixedWidth([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceFamilyName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* FontFaceFamilyName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceStyleName", ExactSpelling = true)] + [return: NativeTypeName("const char *")] + public static extern sbyte* FontFaceStyleName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided", ExactSpelling = true)] + public static extern int GlyphIsProvided([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided32", ExactSpelling = true)] + public static extern int GlyphIsProvided32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics", ExactSpelling = true)] + public static extern int GlyphMetrics([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics32", ExactSpelling = true)] + public static extern int GlyphMetrics32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeText", ExactSpelling = true)] + public static extern int SizeText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUTF8", ExactSpelling = true)] + public static extern int SizeUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUNICODE", ExactSpelling = true)] + public static extern int SizeUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int* w, int* h); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureText", ExactSpelling = true)] + public static extern int MeasureText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUTF8", ExactSpelling = true)] + public static extern int MeasureUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUNICODE", ExactSpelling = true)] + public static extern int MeasureUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int measure_width, int* extent, int* count); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Solid", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Shaded", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Blended", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderText_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUTF8_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD_Wrapped", ExactSpelling = true)] + public static extern SDL_Surface* RenderUNICODE_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_LCD", ExactSpelling = true)] + public static extern SDL_Surface* RenderGlyph32_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_CloseFont", ExactSpelling = true)] + public static extern void CloseFont([NativeTypeName("TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Quit", ExactSpelling = true)] + public static extern void Quit(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_WasInit", ExactSpelling = true)] + public static extern int WasInit(); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSize", ExactSpelling = true)] + public static extern int GetFontKerningSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int prev_index, int index); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs", ExactSpelling = true)] + public static extern int GetFontKerningSizeGlyphs([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort previous_ch, [NativeTypeName("Uint16")] ushort ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs32", ExactSpelling = true)] + public static extern int GetFontKerningSizeGlyphs32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint previous_ch, [NativeTypeName("Uint32")] uint ch); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSDF", ExactSpelling = true)] + public static extern int SetFontSDF([NativeTypeName("TTF_Font *")] _TTF_Font* font, SDL_bool on_off); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontSDF", ExactSpelling = true)] + public static extern SDL_bool GetFontSDF([NativeTypeName("const TTF_Font *")] _TTF_Font* font); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetDirection", ExactSpelling = true)] + public static extern int SetDirection(int direction); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetScript", ExactSpelling = true)] + public static extern int SetScript(int script); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontDirection", ExactSpelling = true)] + public static extern int SetFontDirection([NativeTypeName("TTF_Font *")] _TTF_Font* font, TTF_Direction direction); + + [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontScriptName", ExactSpelling = true)] + public static extern int SetFontScriptName([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* script); + + [NativeTypeName("#define SDL_TTF_MAJOR_VERSION 2")] + public const int SDL_TTF_MAJOR_VERSION = 2; + + [NativeTypeName("#define SDL_TTF_MINOR_VERSION 20")] + public const int SDL_TTF_MINOR_VERSION = 20; + + [NativeTypeName("#define SDL_TTF_PATCHLEVEL 2")] + public const int SDL_TTF_PATCHLEVEL = 2; + + [NativeTypeName("#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION")] + public const int TTF_MAJOR_VERSION = 2; + + [NativeTypeName("#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION")] + public const int TTF_MINOR_VERSION = 20; + + [NativeTypeName("#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL")] + public const int TTF_PATCHLEVEL = 2; + + [NativeTypeName("#define SDL_TTF_COMPILEDVERSION SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL)")] + public const int SDL_TTF_COMPILEDVERSION = ((2) * 1000 + (20) * 100 + (2)); + + [NativeTypeName("#define UNICODE_BOM_NATIVE 0xFEFF")] + public const int UNICODE_BOM_NATIVE = 0xFEFF; + + [NativeTypeName("#define UNICODE_BOM_SWAPPED 0xFFFE")] + public const int UNICODE_BOM_SWAPPED = 0xFFFE; + + [NativeTypeName("#define TTF_STYLE_NORMAL 0x00")] + public const int TTF_STYLE_NORMAL = 0x00; + + [NativeTypeName("#define TTF_STYLE_BOLD 0x01")] + public const int TTF_STYLE_BOLD = 0x01; + + [NativeTypeName("#define TTF_STYLE_ITALIC 0x02")] + public const int TTF_STYLE_ITALIC = 0x02; + + [NativeTypeName("#define TTF_STYLE_UNDERLINE 0x04")] + public const int TTF_STYLE_UNDERLINE = 0x04; + + [NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")] + public const int TTF_STYLE_STRIKETHROUGH = 0x08; + + [NativeTypeName("#define TTF_HINTING_NORMAL 0")] + public const int TTF_HINTING_NORMAL = 0; + + [NativeTypeName("#define TTF_HINTING_LIGHT 1")] + public const int TTF_HINTING_LIGHT = 1; + + [NativeTypeName("#define TTF_HINTING_MONO 2")] + public const int TTF_HINTING_MONO = 2; + + [NativeTypeName("#define TTF_HINTING_NONE 3")] + public const int TTF_HINTING_NONE = 3; + + [NativeTypeName("#define TTF_HINTING_LIGHT_SUBPIXEL 4")] + public const int TTF_HINTING_LIGHT_SUBPIXEL = 4; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_LEFT 0")] + public const int TTF_WRAPPED_ALIGN_LEFT = 0; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_CENTER 1")] + public const int TTF_WRAPPED_ALIGN_CENTER = 1; + + [NativeTypeName("#define TTF_WRAPPED_ALIGN_RIGHT 2")] + public const int TTF_WRAPPED_ALIGN_RIGHT = 2; + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs new file mode 100644 index 00000000..2d791c45 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs @@ -0,0 +1,30 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public enum TTF_Direction + { + TTF_DIRECTION_LTR = 0, + TTF_DIRECTION_RTL, + TTF_DIRECTION_TTB, + TTF_DIRECTION_BTT, + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs new file mode 100644 index 00000000..ad322b94 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_AudioStream + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs new file mode 100644 index 00000000..d1280ec2 --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_Joystick + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs new file mode 100644 index 00000000..35f63f7c --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _SDL_iconv_t + { + } +} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs new file mode 100644 index 00000000..e62766cf --- /dev/null +++ b/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Interop +{ + public partial struct _TTF_Font + { + } +} diff --git a/sources/SDL2Sharp/Audio/AudioSubsystem.cs b/sources/SDL2Sharp/Audio/AudioSubsystem.cs index 88101ca0..221ffef7 100644 --- a/sources/SDL2Sharp/Audio/AudioSubsystem.cs +++ b/sources/SDL2Sharp/Audio/AudioSubsystem.cs @@ -41,27 +41,37 @@ public void Dispose() SDL.QuitSubSystem(InitSubsystemFlags); } +#pragma warning disable CA1822 // Mark members as static public AudioDevice CreateDevice() +#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(); } +#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) +#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples); } +#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) +#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples, callback); } +#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) +#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); } +#pragma warning disable CA1822 // Mark members as static public WaveFile OpenWaveFile(string filename) +#pragma warning restore CA1822 // Mark members as static { return new WaveFile(filename); } diff --git a/tests/SDL2Sharp.Interop.Tests/App.config b/tests/SDL2Sharp.Interop.Tests/App.config deleted file mode 100644 index 7c16b080..00000000 --- a/tests/SDL2Sharp.Interop.Tests/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj index d0241604..9dd54568 100644 --- a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj +++ b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj @@ -1,14 +1,46 @@  - net8.0 + net8.0;net7.0;net6.0;net481;net48;net472;net471;net47;net462 false AnyCPU false - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs new file mode 100644 index 00000000..b09ed038 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class ID3D11DeviceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(ID3D11Device), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(ID3D11Device).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(ID3D11Device)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs new file mode 100644 index 00000000..1b556ba4 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class ID3D12DeviceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(ID3D12Device), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(ID3D12Device).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(ID3D12Device)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs new file mode 100644 index 00000000..a26be6ac --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class IDirect3DDevice9Tests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(IDirect3DDevice9), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(IDirect3DDevice9).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(IDirect3DDevice9)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs new file mode 100644 index 00000000..59c1f784 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class IMG_AnimationTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(IMG_Animation), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(IMG_Animation).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(IMG_Animation)); + } + else + { + Assert.Equal(20, sizeof(IMG_Animation)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs new file mode 100644 index 00000000..1b531da1 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioCVTTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioCVT), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioCVT).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(136, sizeof(SDL_AudioCVT)); + } + else + { + Assert.Equal(88, sizeof(SDL_AudioCVT)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs new file mode 100644 index 00000000..65e37b33 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_AudioDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs new file mode 100644 index 00000000..70c0419b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioSpecTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioSpec), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioSpec).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_AudioSpec)); + } + else + { + Assert.Equal(24, sizeof(SDL_AudioSpec)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs new file mode 100644 index 00000000..65b9912d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_BlitMapTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_BlitMap), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_BlitMap).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_BlitMap)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs new file mode 100644 index 00000000..fe3aa3a9 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ColorTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Color), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Color).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(4, sizeof(SDL_Color)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs new file mode 100644 index 00000000..12a4bebe --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_CommonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_CommonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_CommonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_CommonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs new file mode 100644 index 00000000..d212730f --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerAxisEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerAxisEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerAxisEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_ControllerAxisEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs new file mode 100644 index 00000000..ff457408 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_ControllerButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs new file mode 100644 index 00000000..1815dae9 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(12, sizeof(SDL_ControllerDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs new file mode 100644 index 00000000..2ebab759 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerSensorEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerSensorEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerSensorEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_ControllerSensorEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs new file mode 100644 index 00000000..ef0e793c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerTouchpadEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerTouchpadEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerTouchpadEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(32, sizeof(SDL_ControllerTouchpadEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs new file mode 100644 index 00000000..f34ab0cc --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_CursorTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Cursor), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Cursor).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Cursor)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs new file mode 100644 index 00000000..dcddfb63 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DisplayEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DisplayEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DisplayEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_DisplayEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs new file mode 100644 index 00000000..b0af4e4c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DisplayModeTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DisplayMode), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DisplayMode).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_DisplayMode)); + } + else + { + Assert.Equal(20, sizeof(SDL_DisplayMode)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs new file mode 100644 index 00000000..35a91ba7 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DollarGestureEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DollarGestureEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DollarGestureEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_DollarGestureEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs new file mode 100644 index 00000000..87bf5ceb --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DropEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DropEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DropEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_DropEvent)); + } + else + { + Assert.Equal(16, sizeof(SDL_DropEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs new file mode 100644 index 00000000..f9f2e6ab --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_EventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Event), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutExplicitTest() + { + Assert.True(typeof(SDL_Event).IsExplicitLayout); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(56, sizeof(SDL_Event)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs new file mode 100644 index 00000000..bbb20815 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_FPointTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_FPoint), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_FPoint).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_FPoint)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs new file mode 100644 index 00000000..5756f915 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_FRectTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_FRect), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_FRect).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_FRect)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs new file mode 100644 index 00000000..7760fccf --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_GUIDTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_GUID), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_GUID).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_GUID)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs new file mode 100644 index 00000000..48785e1a --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyAxisEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyAxisEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyAxisEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_JoyAxisEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs new file mode 100644 index 00000000..6ec2d277 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyBallEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyBallEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyBallEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_JoyBallEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs new file mode 100644 index 00000000..2a78c742 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyBatteryEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyBatteryEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyBatteryEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyBatteryEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs new file mode 100644 index 00000000..b6b95d1d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs new file mode 100644 index 00000000..4f9d2cc5 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(12, sizeof(SDL_JoyDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs new file mode 100644 index 00000000..a9cca4ca --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyHatEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyHatEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyHatEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyHatEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs new file mode 100644 index 00000000..af353cbb --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_KeyboardEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_KeyboardEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_KeyboardEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(32, sizeof(SDL_KeyboardEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs new file mode 100644 index 00000000..7f411b4c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_KeysymTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Keysym), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Keysym).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_Keysym)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs new file mode 100644 index 00000000..929d5374 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(28, sizeof(SDL_MouseButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs new file mode 100644 index 00000000..ae086b9d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseMotionEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseMotionEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseMotionEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(36, sizeof(SDL_MouseMotionEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs new file mode 100644 index 00000000..4130b6c6 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseWheelEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseWheelEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseWheelEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(44, sizeof(SDL_MouseWheelEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs new file mode 100644 index 00000000..a29b6e21 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MultiGestureEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MultiGestureEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MultiGestureEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_MultiGestureEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs new file mode 100644 index 00000000..af26566b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_OSEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_OSEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_OSEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_OSEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs new file mode 100644 index 00000000..14eaf236 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PaletteTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Palette), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Palette).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_Palette)); + } + else + { + Assert.Equal(16, sizeof(SDL_Palette)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs new file mode 100644 index 00000000..54d58a49 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PixelFormatTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_PixelFormat), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_PixelFormat).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(56, sizeof(SDL_PixelFormat)); + } + else + { + Assert.Equal(44, sizeof(SDL_PixelFormat)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs new file mode 100644 index 00000000..8350c2c1 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PointTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Point), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Point).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_Point)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs new file mode 100644 index 00000000..61667e01 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_QuitEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_QuitEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_QuitEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_QuitEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs new file mode 100644 index 00000000..668aa727 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RWopsTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_RWops), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_RWops).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_RWops)); + } + else + { + Assert.Equal(44, sizeof(SDL_RWops)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs new file mode 100644 index 00000000..78b861a0 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RectTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Rect), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Rect).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_Rect)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs new file mode 100644 index 00000000..653f1156 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RendererInfoTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_RendererInfo), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_RendererInfo).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_RendererInfo)); + } + else + { + Assert.Equal(84, sizeof(SDL_RendererInfo)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs new file mode 100644 index 00000000..dc309548 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RendererTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Renderer), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Renderer).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Renderer)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs new file mode 100644 index 00000000..faa132ff --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SensorEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SensorEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SensorEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(48, sizeof(SDL_SensorEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs new file mode 100644 index 00000000..64c0e525 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SurfaceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Surface), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Surface).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(96, sizeof(SDL_Surface)); + } + else + { + Assert.Equal(60, sizeof(SDL_Surface)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs new file mode 100644 index 00000000..fad39a04 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SysWMEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SysWMEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SysWMEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(16, sizeof(SDL_SysWMEvent)); + } + else + { + Assert.Equal(12, sizeof(SDL_SysWMEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs new file mode 100644 index 00000000..ee8e49b2 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SysWMmsgTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SysWMmsg), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SysWMmsg).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_SysWMmsg)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs new file mode 100644 index 00000000..2d8ebb60 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextEditingEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextEditingEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextEditingEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(52, sizeof(SDL_TextEditingEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs new file mode 100644 index 00000000..b19b7643 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextEditingExtEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextEditingExtEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextEditingExtEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_TextEditingExtEvent)); + } + else + { + Assert.Equal(24, sizeof(SDL_TextEditingExtEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs new file mode 100644 index 00000000..beb5bfb0 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextInputEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextInputEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextInputEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(44, sizeof(SDL_TextInputEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs new file mode 100644 index 00000000..18f5a908 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextureTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Texture), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Texture).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Texture)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs new file mode 100644 index 00000000..78dec80d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TouchFingerEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TouchFingerEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TouchFingerEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(48, sizeof(SDL_TouchFingerEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs new file mode 100644 index 00000000..31998d00 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_UserEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_UserEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_UserEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_UserEvent)); + } + else + { + Assert.Equal(24, sizeof(SDL_UserEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs new file mode 100644 index 00000000..2617b17b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_VertexTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Vertex), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Vertex).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_Vertex)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs new file mode 100644 index 00000000..4f4c2c9c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_VirtualJoystickDescTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_VirtualJoystickDesc), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_VirtualJoystickDesc).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_VirtualJoystickDesc)); + } + else + { + Assert.Equal(56, sizeof(SDL_VirtualJoystickDesc)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs new file mode 100644 index 00000000..8f1b1dfd --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_WindowEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_WindowEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_WindowEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(24, sizeof(SDL_WindowEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs new file mode 100644 index 00000000..ee124144 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_WindowTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Window), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Window).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Window)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs new file mode 100644 index 00000000..788f36bd --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_versionTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_version), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_version).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(3, sizeof(SDL_version)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs new file mode 100644 index 00000000..4d7861f3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_AudioStreamTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_AudioStream), Marshal.SizeOf<_SDL_AudioStream>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_AudioStream).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_AudioStream)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs new file mode 100644 index 00000000..1627d0c3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_JoystickTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_Joystick), Marshal.SizeOf<_SDL_Joystick>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_Joystick).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_Joystick)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs new file mode 100644 index 00000000..9d323452 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_iconv_tTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_iconv_t), Marshal.SizeOf<_SDL_iconv_t>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_iconv_t).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_iconv_t)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs new file mode 100644 index 00000000..96c515c3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _TTF_FontTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_TTF_Font), Marshal.SizeOf<_TTF_Font>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_TTF_Font).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_TTF_Font)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs new file mode 100644 index 00000000..b09ed038 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class ID3D11DeviceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(ID3D11Device), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(ID3D11Device).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(ID3D11Device)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs new file mode 100644 index 00000000..1b556ba4 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class ID3D12DeviceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(ID3D12Device), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(ID3D12Device).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(ID3D12Device)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs new file mode 100644 index 00000000..a26be6ac --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class IDirect3DDevice9Tests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(IDirect3DDevice9), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(IDirect3DDevice9).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(IDirect3DDevice9)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs new file mode 100644 index 00000000..59c1f784 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class IMG_AnimationTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(IMG_Animation), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(IMG_Animation).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(IMG_Animation)); + } + else + { + Assert.Equal(20, sizeof(IMG_Animation)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs new file mode 100644 index 00000000..1b531da1 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioCVTTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioCVT), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioCVT).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(136, sizeof(SDL_AudioCVT)); + } + else + { + Assert.Equal(88, sizeof(SDL_AudioCVT)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs new file mode 100644 index 00000000..65e37b33 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_AudioDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs new file mode 100644 index 00000000..70c0419b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_AudioSpecTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_AudioSpec), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_AudioSpec).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_AudioSpec)); + } + else + { + Assert.Equal(24, sizeof(SDL_AudioSpec)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs new file mode 100644 index 00000000..65b9912d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_BlitMapTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_BlitMap), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_BlitMap).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_BlitMap)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs new file mode 100644 index 00000000..fe3aa3a9 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ColorTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Color), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Color).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(4, sizeof(SDL_Color)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs new file mode 100644 index 00000000..12a4bebe --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_CommonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_CommonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_CommonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_CommonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs new file mode 100644 index 00000000..d212730f --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerAxisEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerAxisEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerAxisEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_ControllerAxisEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs new file mode 100644 index 00000000..ff457408 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_ControllerButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs new file mode 100644 index 00000000..1815dae9 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(12, sizeof(SDL_ControllerDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs new file mode 100644 index 00000000..2ebab759 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerSensorEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerSensorEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerSensorEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_ControllerSensorEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs new file mode 100644 index 00000000..ef0e793c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_ControllerTouchpadEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_ControllerTouchpadEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_ControllerTouchpadEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(32, sizeof(SDL_ControllerTouchpadEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs new file mode 100644 index 00000000..f34ab0cc --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_CursorTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Cursor), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Cursor).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Cursor)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs new file mode 100644 index 00000000..dcddfb63 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DisplayEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DisplayEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DisplayEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_DisplayEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs new file mode 100644 index 00000000..b0af4e4c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DisplayModeTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DisplayMode), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DisplayMode).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_DisplayMode)); + } + else + { + Assert.Equal(20, sizeof(SDL_DisplayMode)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs new file mode 100644 index 00000000..35a91ba7 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DollarGestureEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DollarGestureEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DollarGestureEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_DollarGestureEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs new file mode 100644 index 00000000..87bf5ceb --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_DropEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_DropEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_DropEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_DropEvent)); + } + else + { + Assert.Equal(16, sizeof(SDL_DropEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs new file mode 100644 index 00000000..f9f2e6ab --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_EventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Event), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutExplicitTest() + { + Assert.True(typeof(SDL_Event).IsExplicitLayout); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(56, sizeof(SDL_Event)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs new file mode 100644 index 00000000..bbb20815 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_FPointTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_FPoint), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_FPoint).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_FPoint)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs new file mode 100644 index 00000000..5756f915 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_FRectTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_FRect), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_FRect).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_FRect)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs new file mode 100644 index 00000000..7760fccf --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_GUIDTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_GUID), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_GUID).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_GUID)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs new file mode 100644 index 00000000..48785e1a --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyAxisEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyAxisEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyAxisEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_JoyAxisEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs new file mode 100644 index 00000000..6ec2d277 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyBallEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyBallEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyBallEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_JoyBallEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs new file mode 100644 index 00000000..2a78c742 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyBatteryEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyBatteryEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyBatteryEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyBatteryEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs new file mode 100644 index 00000000..b6b95d1d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs new file mode 100644 index 00000000..4f9d2cc5 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyDeviceEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyDeviceEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyDeviceEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(12, sizeof(SDL_JoyDeviceEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs new file mode 100644 index 00000000..a9cca4ca --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_JoyHatEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_JoyHatEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_JoyHatEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_JoyHatEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs new file mode 100644 index 00000000..af353cbb --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_KeyboardEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_KeyboardEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_KeyboardEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(32, sizeof(SDL_KeyboardEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs new file mode 100644 index 00000000..7f411b4c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_KeysymTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Keysym), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Keysym).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_Keysym)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs new file mode 100644 index 00000000..929d5374 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseButtonEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseButtonEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseButtonEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(28, sizeof(SDL_MouseButtonEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs new file mode 100644 index 00000000..ae086b9d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseMotionEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseMotionEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseMotionEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(36, sizeof(SDL_MouseMotionEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs new file mode 100644 index 00000000..4130b6c6 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MouseWheelEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MouseWheelEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MouseWheelEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(44, sizeof(SDL_MouseWheelEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs new file mode 100644 index 00000000..a29b6e21 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_MultiGestureEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_MultiGestureEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_MultiGestureEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(40, sizeof(SDL_MultiGestureEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs new file mode 100644 index 00000000..af26566b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_OSEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_OSEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_OSEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_OSEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs new file mode 100644 index 00000000..14eaf236 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PaletteTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Palette), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Palette).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(24, sizeof(SDL_Palette)); + } + else + { + Assert.Equal(16, sizeof(SDL_Palette)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs new file mode 100644 index 00000000..54d58a49 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PixelFormatTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_PixelFormat), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_PixelFormat).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(56, sizeof(SDL_PixelFormat)); + } + else + { + Assert.Equal(44, sizeof(SDL_PixelFormat)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs new file mode 100644 index 00000000..8350c2c1 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_PointTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Point), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Point).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_Point)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs new file mode 100644 index 00000000..61667e01 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_QuitEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_QuitEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_QuitEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(8, sizeof(SDL_QuitEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs new file mode 100644 index 00000000..668aa727 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RWopsTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_RWops), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_RWops).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_RWops)); + } + else + { + Assert.Equal(44, sizeof(SDL_RWops)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs new file mode 100644 index 00000000..78b861a0 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RectTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Rect), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Rect).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(16, sizeof(SDL_Rect)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs new file mode 100644 index 00000000..653f1156 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RendererInfoTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_RendererInfo), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_RendererInfo).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_RendererInfo)); + } + else + { + Assert.Equal(84, sizeof(SDL_RendererInfo)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs new file mode 100644 index 00000000..dc309548 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_RendererTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Renderer), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Renderer).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Renderer)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs new file mode 100644 index 00000000..faa132ff --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SensorEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SensorEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SensorEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(48, sizeof(SDL_SensorEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs new file mode 100644 index 00000000..64c0e525 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SurfaceTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Surface), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Surface).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(96, sizeof(SDL_Surface)); + } + else + { + Assert.Equal(60, sizeof(SDL_Surface)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs new file mode 100644 index 00000000..fad39a04 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SysWMEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SysWMEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SysWMEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(16, sizeof(SDL_SysWMEvent)); + } + else + { + Assert.Equal(12, sizeof(SDL_SysWMEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs new file mode 100644 index 00000000..ee8e49b2 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_SysWMmsgTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_SysWMmsg), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_SysWMmsg).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_SysWMmsg)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs new file mode 100644 index 00000000..2d8ebb60 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextEditingEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextEditingEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextEditingEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(52, sizeof(SDL_TextEditingEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs new file mode 100644 index 00000000..b19b7643 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextEditingExtEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextEditingExtEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextEditingExtEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_TextEditingExtEvent)); + } + else + { + Assert.Equal(24, sizeof(SDL_TextEditingExtEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs new file mode 100644 index 00000000..beb5bfb0 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextInputEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TextInputEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TextInputEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(44, sizeof(SDL_TextInputEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs new file mode 100644 index 00000000..18f5a908 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TextureTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Texture), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Texture).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Texture)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs new file mode 100644 index 00000000..78dec80d --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_TouchFingerEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_TouchFingerEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_TouchFingerEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(48, sizeof(SDL_TouchFingerEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs new file mode 100644 index 00000000..31998d00 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_UserEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_UserEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_UserEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(32, sizeof(SDL_UserEvent)); + } + else + { + Assert.Equal(24, sizeof(SDL_UserEvent)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs new file mode 100644 index 00000000..2617b17b --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_VertexTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Vertex), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Vertex).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(20, sizeof(SDL_Vertex)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs new file mode 100644 index 00000000..4f4c2c9c --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs @@ -0,0 +1,58 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_VirtualJoystickDescTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_VirtualJoystickDesc), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_VirtualJoystickDesc).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.Equal(88, sizeof(SDL_VirtualJoystickDesc)); + } + else + { + Assert.Equal(56, sizeof(SDL_VirtualJoystickDesc)); + } + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs new file mode 100644 index 00000000..8f1b1dfd --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_WindowEventTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_WindowEvent), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_WindowEvent).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(24, sizeof(SDL_WindowEvent)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs new file mode 100644 index 00000000..ee124144 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_WindowTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_Window), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_Window).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(SDL_Window)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs new file mode 100644 index 00000000..788f36bd --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class SDL_versionTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(SDL_version), Marshal.SizeOf()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(SDL_version).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(3, sizeof(SDL_version)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs new file mode 100644 index 00000000..4d7861f3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_AudioStreamTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_AudioStream), Marshal.SizeOf<_SDL_AudioStream>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_AudioStream).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_AudioStream)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs new file mode 100644 index 00000000..1627d0c3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_JoystickTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_Joystick), Marshal.SizeOf<_SDL_Joystick>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_Joystick).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_Joystick)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs new file mode 100644 index 00000000..9d323452 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _SDL_iconv_tTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_SDL_iconv_t), Marshal.SizeOf<_SDL_iconv_t>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_SDL_iconv_t).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_SDL_iconv_t)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs new file mode 100644 index 00000000..96c515c3 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs @@ -0,0 +1,50 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Runtime.InteropServices; +using Xunit; + +namespace SDL2Sharp.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe partial class _TTF_FontTests + { + /// Validates that the struct is blittable. + [Fact] + public static void IsBlittableTest() + { + Assert.Equal(sizeof(_TTF_Font), Marshal.SizeOf<_TTF_Font>()); + } + + /// Validates that the struct has the right . + [Fact] + public static void IsLayoutSequentialTest() + { + Assert.True(typeof(_TTF_Font).IsLayoutSequential); + } + + /// Validates that the struct has the correct size. + [Fact] + public static void SizeOfTest() + { + Assert.Equal(1, sizeof(_TTF_Font)); + } + } +} diff --git a/tests/SDL2Sharp.Interop.Tests/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/ID3D11DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/ID3D12DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/IDirect3DDevice9Tests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/IMG_AnimationTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_AudioCVTTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_AudioDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_AudioSpecTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_BlitMapTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ColorTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_CommonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ControllerAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ControllerButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ControllerDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ControllerSensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_ControllerTouchpadEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_CursorTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_DisplayEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_DisplayModeTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_DollarGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_DropEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_EventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_FPointTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_FRectTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_GUIDTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyBallEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyBatteryEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_JoyHatEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_KeyboardEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_KeysymTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_MouseButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_MouseMotionEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_MouseWheelEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_MultiGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_OSEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_PaletteTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_PixelFormatTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_PointTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_QuitEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_RWopsTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_RectTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_RendererInfoTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_RendererTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_SensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_SurfaceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_SysWMEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_SysWMmsgTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_TextEditingEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_TextEditingExtEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_TextInputEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_TextureTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_TouchFingerEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_UserEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_VertexTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_VirtualJoystickDescTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_WindowEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_WindowTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/SDL_versionTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/_SDL_AudioStreamTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/_SDL_JoystickTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/_SDL_iconv_tTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/_TTF_FontTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/xunit.runner.json b/tests/SDL2Sharp.Interop.Tests/xunit.runner.json new file mode 100644 index 00000000..be78ad92 --- /dev/null +++ b/tests/SDL2Sharp.Interop.Tests/xunit.runner.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "shadowCopy": false, + "parallelizeAssembly": false, + "parallelizeTestCollections": false +} diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs index 27ad3a7c..ce2f3bac 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -154,14 +154,14 @@ public static void WriteAndReadBgra8888() => WriteAndRead( ) ); - [Fact] - public static void WriteAndReadRgb332() => WriteAndRead( - () => Rgb332.FromRGB( - r: (byte)_random.Next(0, 256), - g: (byte)_random.Next(0, 256), - b: (byte)_random.Next(0, 256) - ) - ); + //[Fact] + //public static void WriteAndReadRgb332() => WriteAndRead( + // () => Rgb332.FromRGB( + // r: (byte)_random.Next(0, 256), + // g: (byte)_random.Next(0, 256), + // b: (byte)_random.Next(0, 256) + // ) + //); [Fact] public static void WriteAndReadRgb565() => WriteAndRead( From a0e19047a002671f7437fad76b4fc961f937ff68 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 11 Aug 2024 15:25:17 +0200 Subject: [PATCH 44/62] Replace generic NV* classes with specific NV12* and NV21* classes. --- .../Video/{NvImage.cs => Nv12Image.cs} | 10 +- sources/SDL2Sharp/Video/Nv12MemoryImage.cs | 71 ++++++++++ sources/SDL2Sharp/Video/Nv12Texture.cs | 133 ++++++++++++++++++ sources/SDL2Sharp/Video/Nv21Image.cs | 80 +++++++++++ .../{NvMemoryImage.cs => Nv21MemoryImage.cs} | 10 +- .../Video/{NvTexture.cs => Nv21Texture.cs} | 16 +-- sources/SDL2Sharp/Video/RendererExtensions.cs | 32 +++++ sources/SDL2Sharp/Video/TextureExtensions.cs | 8 +- 8 files changed, 338 insertions(+), 22 deletions(-) rename sources/SDL2Sharp/Video/{NvImage.cs => Nv12Image.cs} (86%) create mode 100644 sources/SDL2Sharp/Video/Nv12MemoryImage.cs create mode 100644 sources/SDL2Sharp/Video/Nv12Texture.cs create mode 100644 sources/SDL2Sharp/Video/Nv21Image.cs rename sources/SDL2Sharp/Video/{NvMemoryImage.cs => Nv21MemoryImage.cs} (86%) rename sources/SDL2Sharp/Video/{NvTexture.cs => Nv21Texture.cs} (87%) diff --git a/sources/SDL2Sharp/Video/NvImage.cs b/sources/SDL2Sharp/Video/Nv12Image.cs similarity index 86% rename from sources/SDL2Sharp/Video/NvImage.cs rename to sources/SDL2Sharp/Video/Nv12Image.cs index c2f04ed1..138c2f47 100644 --- a/sources/SDL2Sharp/Video/NvImage.cs +++ b/sources/SDL2Sharp/Video/Nv12Image.cs @@ -24,15 +24,15 @@ namespace SDL2Sharp.Video { - public readonly ref struct NvImage where TUvPixel : struct + public readonly ref struct Nv12Image { private readonly ImagePlane _yPlane; - private readonly ImagePlane _uvPlane; + private readonly ImagePlane _uvPlane; public ImagePlane Y => _yPlane; - public ImagePlane UV => _uvPlane; + public ImagePlane UV => _uvPlane; public readonly int Width { @@ -46,7 +46,7 @@ public readonly int Height get => _yPlane.Height; } - public unsafe NvImage(void* pixels, int width, int height, int pitch) + public unsafe Nv12Image(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -74,7 +74,7 @@ public unsafe NvImage(void* pixels, int width, int height, int pitch) _yPlane = new ImagePlane(pixels, width, height, pitch); var uvPlanePixels = Unsafe.Add(pixels, height * pitch); - _uvPlane = new ImagePlane(uvPlanePixels, width / 2, height / 2, pitch / 2); + _uvPlane = new ImagePlane(uvPlanePixels, width / 2, height / 2, pitch / 2); } } } diff --git a/sources/SDL2Sharp/Video/Nv12MemoryImage.cs b/sources/SDL2Sharp/Video/Nv12MemoryImage.cs new file mode 100644 index 00000000..d9211a38 --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv12MemoryImage.cs @@ -0,0 +1,71 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; + +namespace SDL2Sharp.Video +{ + public sealed class Nv12MemoryImage + { + private readonly ImageMemoryPlane _yPlane; + + private readonly ImageMemoryPlane _uvPlane; + + public ImageMemoryPlane Y => _yPlane; + + public ImageMemoryPlane UV => _uvPlane; + + public int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Width; + } + + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Height; + } + + public Nv12MemoryImage(int width, int height) + { + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + _yPlane = new ImageMemoryPlane(width, height); + _uvPlane = new ImageMemoryPlane(width / 2, height / 2); + } + } +} diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/Nv12Texture.cs new file mode 100644 index 00000000..a6983626 --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv12Texture.cs @@ -0,0 +1,133 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using SDL2Sharp.Interop; + +namespace SDL2Sharp.Video +{ + public sealed unsafe class Nv12Texture : IDisposable + { + public delegate void LockCallback(Nv12Image pixels); + + private Texture _texture; + + public PixelFormat Format => _texture.Format; + + public TextureAccess Access => _texture.Access; + + public int Width => _texture.Width; + + public int Height => _texture.Height; + + public BlendMode BlendMode + { + get => _texture.BlendMode; + + set => _texture.BlendMode = value; + } + + public bool IsValid => _texture.IsValid; + + internal Nv12Texture(Texture texture) + { + _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + } + + ~Nv12Texture() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool _) + { + if (_texture is null) return; + _texture.Dispose(); + _texture = null!; + } + + public void WithLock(LockCallback callback) + { + WithLock(0, 0, Width, Height, callback); + } + + public void WithLock(Rectangle rectangle, LockCallback callback) + { + WithLock(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, callback); + } + + public void WithLock(int x, int y, int width, int height, LockCallback callback) + { + ArgumentNullException.ThrowIfNull(callback); + + ThrowWhenDisposed(); + + var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; + void* pixels; + int pitch; + Error.ThrowLastErrorIfNegative( + SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) + ); + + var image = new Nv12Image(pixels, width, height, pitch); + callback.Invoke(image); + SDL.UnlockTexture(_texture.Handle); + } + + public void Update(Nv12Image image) + { + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.UV, image.UV.Pitch) + ); + } + + public void Update(Nv12MemoryImage image) + { + ArgumentNullException.ThrowIfNull(image); + + Error.ThrowLastErrorIfNegative( + SDL.UpdateNVTexture(_texture.Handle, null, + (byte*)image.Y, image.Y.Pitch, + (byte*)image.UV, image.UV.Pitch + ) + ); + } + + private void ThrowWhenDisposed() + { + ObjectDisposedException.ThrowIf(_texture is null, this); + } + + public static implicit operator Texture(Nv12Texture texture) + { + ArgumentNullException.ThrowIfNull(texture); + + return texture._texture; + } + } +} diff --git a/sources/SDL2Sharp/Video/Nv21Image.cs b/sources/SDL2Sharp/Video/Nv21Image.cs new file mode 100644 index 00000000..83a851a8 --- /dev/null +++ b/sources/SDL2Sharp/Video/Nv21Image.cs @@ -0,0 +1,80 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Runtime.CompilerServices; +using SDL2Sharp.Video.Colors; + +namespace SDL2Sharp.Video +{ + public readonly ref struct Nv21Image + { + private readonly ImagePlane _yPlane; + + private readonly ImagePlane _uvPlane; + + public ImagePlane Y => _yPlane; + + public ImagePlane UV => _uvPlane; + + public readonly int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Width; + } + + public readonly int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _yPlane.Height; + } + + public unsafe Nv21Image(void* pixels, int width, int height, int pitch) + { + if (height < 0) + { + throw new ArgumentOutOfRangeException( + nameof(height), + height, + "height cannot be less than zero"); + } + + if (width < 0) + { + throw new ArgumentOutOfRangeException( + nameof(width), + width, + "height cannot be less than zero"); + } + + if (pitch < 0) + { + throw new ArgumentOutOfRangeException( + nameof(pitch), + pitch, + "pitch cannot be less than zero"); + } + + _yPlane = new ImagePlane(pixels, width, height, pitch); + var uvPlanePixels = Unsafe.Add(pixels, height * pitch); + _uvPlane = new ImagePlane(uvPlanePixels, width / 2, height / 2, pitch / 2); + } + } +} diff --git a/sources/SDL2Sharp/Video/NvMemoryImage.cs b/sources/SDL2Sharp/Video/Nv21MemoryImage.cs similarity index 86% rename from sources/SDL2Sharp/Video/NvMemoryImage.cs rename to sources/SDL2Sharp/Video/Nv21MemoryImage.cs index 7313c042..bae970b5 100644 --- a/sources/SDL2Sharp/Video/NvMemoryImage.cs +++ b/sources/SDL2Sharp/Video/Nv21MemoryImage.cs @@ -24,15 +24,15 @@ namespace SDL2Sharp.Video { - public sealed class NvMemoryImage where TUVPixel : struct + public sealed class Nv21MemoryImage { private readonly ImageMemoryPlane _yPlane; - private readonly ImageMemoryPlane _uvPlane; + private readonly ImageMemoryPlane _uvPlane; public ImageMemoryPlane Y => _yPlane; - public ImageMemoryPlane UV => _uvPlane; + public ImageMemoryPlane UV => _uvPlane; public int Width { @@ -46,7 +46,7 @@ public int Height get => _yPlane.Height; } - public NvMemoryImage(int width, int height) + public Nv21MemoryImage(int width, int height) { if (width < 0) { @@ -65,7 +65,7 @@ public NvMemoryImage(int width, int height) } _yPlane = new ImageMemoryPlane(width, height); - _uvPlane = new ImageMemoryPlane(width / 2, height / 2); + _uvPlane = new ImageMemoryPlane(width / 2, height / 2); } } } diff --git a/sources/SDL2Sharp/Video/NvTexture.cs b/sources/SDL2Sharp/Video/Nv21Texture.cs similarity index 87% rename from sources/SDL2Sharp/Video/NvTexture.cs rename to sources/SDL2Sharp/Video/Nv21Texture.cs index 73a1018d..6bd3c6ce 100644 --- a/sources/SDL2Sharp/Video/NvTexture.cs +++ b/sources/SDL2Sharp/Video/Nv21Texture.cs @@ -23,9 +23,9 @@ namespace SDL2Sharp.Video { - public sealed unsafe class NvTexture : IDisposable where TUVPixel : struct + public sealed unsafe class Nv21Texture : IDisposable { - public delegate void LockCallback(NvImage pixels); + public delegate void LockCallback(Nv21Image pixels); private Texture _texture; @@ -46,12 +46,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal NvTexture(Texture texture) + internal Nv21Texture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~NvTexture() + ~Nv21Texture() { Dispose(false); } @@ -92,12 +92,12 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new NvImage(pixels, width, height, pitch); + var image = new Nv21Image(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(NvImage image) + public void Update(Nv21Image image) { Error.ThrowLastErrorIfNegative( SDL.UpdateNVTexture(_texture.Handle, null, @@ -106,7 +106,7 @@ public void Update(NvImage image) ); } - public void Update(NvMemoryImage image) + public void Update(Nv21MemoryImage image) { ArgumentNullException.ThrowIfNull(image); @@ -123,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(NvTexture texture) + public static implicit operator Texture(Nv21Texture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index f642a3e9..7ba3ca47 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -63,6 +63,38 @@ public static YuvTexture CreateYuvTexture(this Renderer return new YuvTexture(texture); } + public static Nv12Texture CreateNv12Texture(this Renderer renderer, TextureAccess access, Size size) + { + ArgumentNullException.ThrowIfNull(renderer); + + return renderer.CreateNv12Texture(access, size.Width, size.Height); + } + + public static Nv12Texture CreateNv12Texture(this Renderer renderer, TextureAccess access, int width, int height) + { + ArgumentNullException.ThrowIfNull(renderer); + + var pixelFormat = PixelFormat.NV12; + var texture = renderer.CreateTexture(pixelFormat, access, width, height); + return new Nv12Texture(texture); + } + + public static Nv21Texture CreateNv21Texture(this Renderer renderer, TextureAccess access, Size size) + { + ArgumentNullException.ThrowIfNull(renderer); + + return renderer.CreateNv21Texture(access, size.Width, size.Height); + } + + public static Nv21Texture CreateNv21Texture(this Renderer renderer, TextureAccess access, int width, int height) + { + ArgumentNullException.ThrowIfNull(renderer); + + var pixelFormat = PixelFormat.NV21; + var texture = renderer.CreateTexture(pixelFormat, access, width, height); + return new Nv21Texture(texture); + } + public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) where TPackedPixel : struct, IPackedPixel { diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index f102e597..3bcf73c6 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -40,22 +40,22 @@ public static YuvTexture AsIYUV(this Texture texture) return new YuvTexture(texture); } - public static NvTexture AsNV12(this Texture texture) + public static Nv12Texture AsNV12(this Texture texture) { if (texture.Format != PixelFormat.NV12) { throw new ArgumentException("Texture is not in NV12 color format.", nameof(texture)); } - return new NvTexture(texture); + return new Nv12Texture(texture); } - public static NvTexture AsNV21(this Texture texture) + public static Nv21Texture AsNV21(this Texture texture) { if (texture.Format != PixelFormat.NV21) { throw new ArgumentException("Texture is not in NV21 color format.", nameof(texture)); } - return new NvTexture(texture); + return new Nv21Texture(texture); } public static YuvTexture AsYV12(this Texture texture) From 679bc5e4b4db6aaf5e58f24e66db2a6804d97a04 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 11 Aug 2024 15:26:52 +0200 Subject: [PATCH 45/62] Remove unnecessary new constraint. --- sources/SDL2Sharp/Video/RendererExtensions.cs | 2 +- sources/SDL2Sharp/Video/YuvImage.cs | 2 +- sources/SDL2Sharp/Video/YuvTexture.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index 7ba3ca47..349bcaec 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -54,7 +54,7 @@ public static YuvTexture CreateYuvTexture(this Renderer } public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TYuvFormat : IYuvFormat, new() + where TYuvFormat : IYuvFormat { ArgumentNullException.ThrowIfNull(renderer); diff --git a/sources/SDL2Sharp/Video/YuvImage.cs b/sources/SDL2Sharp/Video/YuvImage.cs index 5cac030a..d483ae30 100644 --- a/sources/SDL2Sharp/Video/YuvImage.cs +++ b/sources/SDL2Sharp/Video/YuvImage.cs @@ -24,7 +24,7 @@ namespace SDL2Sharp.Video { - public readonly ref struct YuvImage where TYuvFormat : IYuvFormat, new() + public readonly ref struct YuvImage where TYuvFormat : IYuvFormat { private readonly ImagePlane _yPlane; diff --git a/sources/SDL2Sharp/Video/YuvTexture.cs b/sources/SDL2Sharp/Video/YuvTexture.cs index 49cb9a07..7a75935b 100644 --- a/sources/SDL2Sharp/Video/YuvTexture.cs +++ b/sources/SDL2Sharp/Video/YuvTexture.cs @@ -24,7 +24,7 @@ namespace SDL2Sharp.Video { - public sealed unsafe partial class YuvTexture : IDisposable where TYuvFormat : IYuvFormat, new() + public sealed unsafe partial class YuvTexture : IDisposable where TYuvFormat : IYuvFormat { public delegate void LockCallback(YuvImage pixels); From e585100df53368de26a0ca4acd3f89f8c38a3eed Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 12 Aug 2024 22:45:45 +0200 Subject: [PATCH 46/62] Refactor pixel formats (change casing and namespace). --- samples/PlasmaFractal/Program.cs | 26 +++---- samples/RayTracer/Camera.cs | 8 +- samples/RayTracer/IObject.cs | 4 +- samples/RayTracer/Plane.cs | 4 +- samples/RayTracer/PointLight.cs | 4 +- samples/RayTracer/Program.cs | 26 +++---- samples/RayTracer/Sphere.cs | 4 +- samples/RayTracer/World.cs | 12 +-- samples/SwirlStars/Program.cs | 4 +- samples/SwirlStars/Star.cs | 4 +- samples/TunnelEffect/Program.cs | 14 ++-- sources/SDL2Sharp/Fonts/Font.cs | 6 +- .../Video/{Nv12Image.cs => NV12Image.cs} | 6 +- ...{Nv12MemoryImage.cs => NV12MemoryImage.cs} | 6 +- .../Video/{Nv12Texture.cs => NV12Texture.cs} | 16 ++-- .../Video/{Nv21Image.cs => NV21Image.cs} | 6 +- ...{Nv21MemoryImage.cs => NV21MemoryImage.cs} | 6 +- .../Video/{Nv21Texture.cs => NV21Texture.cs} | 16 ++-- sources/SDL2Sharp/Video/PackedTexture.cs | 2 +- .../Abgr1555.cs => PixelFormats/ABGR1555.cs} | 15 ++-- .../Abgr4444.cs => PixelFormats/ABGR4444.cs} | 14 ++-- .../Abgr8888.cs => PixelFormats/ABGR8888.cs} | 16 ++-- .../Argb1555.cs => PixelFormats/ARGB1555.cs} | 14 ++-- .../ARGB2101010.cs} | 14 ++-- .../Argb4444.cs => PixelFormats/ARGB4444.cs} | 14 ++-- .../Argb8888.cs => PixelFormats/ARGB8888.cs} | 16 ++-- .../Bgr24.cs => PixelFormats/BGR24.cs} | 6 +- .../Bgr565.cs => PixelFormats/BGR565.cs} | 14 ++-- .../Bgra4444.cs => PixelFormats/BGRA4444.cs} | 14 ++-- .../Bgra5551.cs => PixelFormats/BGRA5551.cs} | 14 ++-- .../Bgra8888.cs => PixelFormats/BGRA8888.cs} | 18 ++--- .../Bgrx8888.cs => PixelFormats/BGRX8888.cs} | 16 ++-- .../{Colors => PixelFormats}/IPackedPixel.cs | 2 +- .../{Colors/Iyuv.cs => PixelFormats/IYUV.cs} | 4 +- .../IYUVFormat.cs} | 4 +- .../Rgb24.cs => PixelFormats/RGB24.cs} | 6 +- .../Rgb332.cs => PixelFormats/RGB332.cs} | 14 ++-- .../Rgb565.cs => PixelFormats/RGB565.cs} | 14 ++-- .../Rgb96f.cs => PixelFormats/RGB96f.cs} | 78 +++++++++---------- .../RGB96fExtensions.cs} | 20 ++--- .../Rgba4444.cs => PixelFormats/RGBA4444.cs} | 14 ++-- .../Rgba5551.cs => PixelFormats/RGBA5551.cs} | 14 ++-- .../Rgba8888.cs => PixelFormats/RGBA8888.cs} | 16 ++-- .../Rgbx8888.cs => PixelFormats/RGBX8888.cs} | 16 ++-- .../Video/{Colors => PixelFormats}/U8.cs | 2 +- .../Video/{Colors => PixelFormats}/UV88.cs | 2 +- .../{Colors/Uyvy.cs => PixelFormats/UYVY.cs} | 6 +- .../Video/{Colors => PixelFormats}/V8.cs | 2 +- .../Video/{Colors => PixelFormats}/VU88.cs | 2 +- .../Xbgr1555.cs => PixelFormats/XBGR1555.cs} | 14 ++-- .../Xbgr4444.cs => PixelFormats/XBGR4444.cs} | 14 ++-- .../Xbgr8888.cs => PixelFormats/XBGR8888.cs} | 16 ++-- .../Xrgb1555.cs => PixelFormats/XRGB1555.cs} | 14 ++-- .../Xrgb4444.cs => PixelFormats/XRGB4444.cs} | 14 ++-- .../Xrgb8888.cs => PixelFormats/XRGB8888.cs} | 16 ++-- .../Video/{Colors => PixelFormats}/Y8.cs | 2 +- .../{Colors/Yuy2.cs => PixelFormats/YUY2.cs} | 6 +- .../{Colors/Yv12.cs => PixelFormats/YV12.cs} | 4 +- .../{Colors/Yvyu.cs => PixelFormats/YVYU.cs} | 6 +- sources/SDL2Sharp/Video/Renderer.cs | 2 +- sources/SDL2Sharp/Video/RendererExtensions.cs | 32 ++++---- sources/SDL2Sharp/Video/Surface{T}.cs | 2 +- sources/SDL2Sharp/Video/TextureExtensions.cs | 18 ++--- ...ConversionMode.cs => YUVConversionMode.cs} | 2 +- .../Video/{YuvImage.cs => YUVImage.cs} | 12 +-- .../{YuvMemoryImage.cs => YUVMemoryImage.cs} | 6 +- .../Video/{YuvTexture.cs => YUVTexture.cs} | 18 ++--- .../Colors/Argb2101010Tests.cs | 8 +- tests/SDL2Sharp.Tests/PackedTextureTests.cs | 28 +++---- tests/SDL2Sharp.Tests/PlanarTextureTests.cs | 12 +-- tests/SDL2Sharp.Tests/SurfaceTests.cs | 10 +-- tests/SDL2Sharp.Tests/TextureTests.cs | 6 +- 72 files changed, 418 insertions(+), 419 deletions(-) rename sources/SDL2Sharp/Video/{Nv12Image.cs => NV12Image.cs} (94%) rename sources/SDL2Sharp/Video/{Nv12MemoryImage.cs => NV12MemoryImage.cs} (94%) rename sources/SDL2Sharp/Video/{Nv12Texture.cs => NV12Texture.cs} (89%) rename sources/SDL2Sharp/Video/{Nv21Image.cs => NV21Image.cs} (94%) rename sources/SDL2Sharp/Video/{Nv21MemoryImage.cs => NV21MemoryImage.cs} (94%) rename sources/SDL2Sharp/Video/{Nv21Texture.cs => NV21Texture.cs} (89%) rename sources/SDL2Sharp/Video/{Colors/Abgr1555.cs => PixelFormats/ABGR1555.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Abgr4444.cs => PixelFormats/ABGR4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Abgr8888.cs => PixelFormats/ABGR8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors/Argb1555.cs => PixelFormats/ARGB1555.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Argb2101010.cs => PixelFormats/ARGB2101010.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Argb4444.cs => PixelFormats/ARGB4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Argb8888.cs => PixelFormats/ARGB8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors/Bgr24.cs => PixelFormats/BGR24.cs} (91%) rename sources/SDL2Sharp/Video/{Colors/Bgr565.cs => PixelFormats/BGR565.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Bgra4444.cs => PixelFormats/BGRA4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Bgra5551.cs => PixelFormats/BGRA5551.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Bgra8888.cs => PixelFormats/BGRA8888.cs} (77%) rename sources/SDL2Sharp/Video/{Colors/Bgrx8888.cs => PixelFormats/BGRX8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/IPackedPixel.cs (97%) rename sources/SDL2Sharp/Video/{Colors/Iyuv.cs => PixelFormats/IYUV.cs} (96%) rename sources/SDL2Sharp/Video/{Colors/IYuvFormat.cs => PixelFormats/IYUVFormat.cs} (95%) rename sources/SDL2Sharp/Video/{Colors/Rgb24.cs => PixelFormats/RGB24.cs} (91%) rename sources/SDL2Sharp/Video/{Colors/Rgb332.cs => PixelFormats/RGB332.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Rgb565.cs => PixelFormats/RGB565.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Rgb96f.cs => PixelFormats/RGB96f.cs} (68%) rename sources/SDL2Sharp/Video/{Colors/Rgb96fExtensions.cs => PixelFormats/RGB96fExtensions.cs} (76%) rename sources/SDL2Sharp/Video/{Colors/Rgba4444.cs => PixelFormats/RGBA4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Rgba5551.cs => PixelFormats/RGBA5551.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Rgba8888.cs => PixelFormats/RGBA8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors/Rgbx8888.cs => PixelFormats/RGBX8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/U8.cs (96%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/UV88.cs (97%) rename sources/SDL2Sharp/Video/{Colors/Uyvy.cs => PixelFormats/UYVY.cs} (91%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/V8.cs (96%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/VU88.cs (97%) rename sources/SDL2Sharp/Video/{Colors/Xbgr1555.cs => PixelFormats/XBGR1555.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Xbgr4444.cs => PixelFormats/XBGR4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Xbgr8888.cs => PixelFormats/XBGR8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors/Xrgb1555.cs => PixelFormats/XRGB1555.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Xrgb4444.cs => PixelFormats/XRGB4444.cs} (80%) rename sources/SDL2Sharp/Video/{Colors/Xrgb8888.cs => PixelFormats/XRGB8888.cs} (79%) rename sources/SDL2Sharp/Video/{Colors => PixelFormats}/Y8.cs (96%) rename sources/SDL2Sharp/Video/{Colors/Yuy2.cs => PixelFormats/YUY2.cs} (91%) rename sources/SDL2Sharp/Video/{Colors/Yv12.cs => PixelFormats/YV12.cs} (96%) rename sources/SDL2Sharp/Video/{Colors/Yvyu.cs => PixelFormats/YVYU.cs} (91%) rename sources/SDL2Sharp/Video/{YuvConversionMode.cs => YUVConversionMode.cs} (97%) rename sources/SDL2Sharp/Video/{YuvImage.cs => YUVImage.cs} (86%) rename sources/SDL2Sharp/Video/{YuvMemoryImage.cs => YUVMemoryImage.cs} (94%) rename sources/SDL2Sharp/Video/{YuvTexture.cs => YUVTexture.cs} (87%) diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs index cf36c2ef..a70012f4 100644 --- a/samples/PlasmaFractal/Program.cs +++ b/samples/PlasmaFractal/Program.cs @@ -24,7 +24,7 @@ using SDL2Sharp.Input; using SDL2Sharp.Fonts; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using static System.Math; using static SDL2Sharp.Math; @@ -39,10 +39,10 @@ public static void Main() using var window = videoSubystem.CreateWindow("Plasma Fractal", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); - var screenImage = new PackedMemoryImage(renderer.OutputSize); + var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImage = GenerateDiamondSquareImage(renderer.OutputSize); var palette = GeneratePalette(); var reversePaletteRotation = false; @@ -130,21 +130,21 @@ public static void Main() private static readonly Random _random = new(); - private static Palette GeneratePalette() + private static Palette GeneratePalette() { - var palette = new Palette(256); + var palette = new Palette(256); for (var i = 0; i < 32; ++i) { var lo = (byte)(i * 255 / 31); var hi = (byte)(255 - lo); - palette[i] = new Argb8888(0xFF, lo, 0, 0); - palette[i + 32] = new Argb8888(0xFF, hi, 0, 0); - palette[i + 64] = new Argb8888(0xFF, 0, lo, 0); - palette[i + 96] = new Argb8888(0xFF, 0, hi, 0); - palette[i + 128] = new Argb8888(0xFF, 0, 0, lo); - palette[i + 160] = new Argb8888(0xFF, 0, 0, hi); - palette[i + 192] = new Argb8888(0xFF, lo, 0, lo); - palette[i + 224] = new Argb8888(0xFF, hi, 0, hi); + palette[i] = new ARGB8888(0xFF, lo, 0, 0); + palette[i + 32] = new ARGB8888(0xFF, hi, 0, 0); + palette[i + 64] = new ARGB8888(0xFF, 0, lo, 0); + palette[i + 96] = new ARGB8888(0xFF, 0, hi, 0); + palette[i + 128] = new ARGB8888(0xFF, 0, 0, lo); + palette[i + 160] = new ARGB8888(0xFF, 0, 0, hi); + palette[i + 192] = new ARGB8888(0xFF, lo, 0, lo); + palette[i + 224] = new ARGB8888(0xFF, hi, 0, hi); } return palette; } diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index 135d9b11..7b907f95 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -22,7 +22,7 @@ using System.Numerics; using System.Threading.Tasks; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class Camera { @@ -40,7 +40,7 @@ internal sealed class Camera public float FocalLength { get; private set; } - public PackedMemoryImage Snapshot { get; } + public PackedMemoryImage Snapshot { get; } public Camera() { @@ -49,7 +49,7 @@ public Camera() Frustum = new Frustum(-4f / 3f, 4f / 3f, -1f, +1f, float.Epsilon, float.PositiveInfinity); FieldOfView = 90f; FocalLength = (float)(Resolution.Width / Resolution.Height / MathF.Tan(FieldOfView * MathF.PI / 180f / 2f)); - Snapshot = new PackedMemoryImage(Resolution.Width, Resolution.Height); + Snapshot = new PackedMemoryImage(Resolution.Width, Resolution.Height); } public void LookAt(Vector3 position, Vector3 target, Vector3 up) @@ -122,7 +122,7 @@ public void Roll(float radians) _orientation *= rotation; } - public PackedMemoryImage TakeSnapshot(World world) + public PackedMemoryImage TakeSnapshot(World world) { ArgumentNullException.ThrowIfNull(world); diff --git a/samples/RayTracer/IObject.cs b/samples/RayTracer/IObject.cs index 799c91a7..e2d31ccf 100644 --- a/samples/RayTracer/IObject.cs +++ b/samples/RayTracer/IObject.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal interface IObject { @@ -27,7 +27,7 @@ internal interface IObject float DiffuseCoefficient { get; set; } - Rgb96f DiffuseColor { get; set; } + RGB96f DiffuseColor { get; set; } Intersection? Intersect(Ray ray); diff --git a/samples/RayTracer/Plane.cs b/samples/RayTracer/Plane.cs index 3bab5ab1..9ebec646 100644 --- a/samples/RayTracer/Plane.cs +++ b/samples/RayTracer/Plane.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class Plane : IObject { @@ -27,7 +27,7 @@ internal sealed class Plane : IObject public float DiffuseCoefficient { get; set; } = 1f; - public Rgb96f DiffuseColor { get; set; } = Rgb96f.Black; + public RGB96f DiffuseColor { get; set; } = RGB96f.Black; public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); diff --git a/samples/RayTracer/PointLight.cs b/samples/RayTracer/PointLight.cs index 6d2f6148..c92e6209 100644 --- a/samples/RayTracer/PointLight.cs +++ b/samples/RayTracer/PointLight.cs @@ -19,11 +19,11 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class PointLight { public Vector3 Position { get; set; } - public Rgb96f Color { get; set; } + public RGB96f Color { get; set; } } diff --git a/samples/RayTracer/Program.cs b/samples/RayTracer/Program.cs index 106bf600..05b5d764 100644 --- a/samples/RayTracer/Program.cs +++ b/samples/RayTracer/Program.cs @@ -25,7 +25,7 @@ using SDL2Sharp.Input; using SDL2Sharp.Fonts; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal static class Program { @@ -38,12 +38,12 @@ public static void Main() using var window = videoSubystem.CreateWindow("Ray Tracer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); var world = new World { - Ambient = new Rgb96f(0.55f, 0.44f, 0.47f), + Ambient = new RGB96f(0.55f, 0.44f, 0.47f), Objects = { // Backdrop Plane @@ -51,63 +51,63 @@ public static void Main() { Position = new Vector3(0f, 0f, 0f), Normal = new Vector3(0f, 1f, 0f), - DiffuseColor = new Rgb96f(.5f, .5f, .5f) + DiffuseColor = new RGB96f(.5f, .5f, .5f) }, // Large center orange Sphere new Sphere { Position = new Vector3(0f, 5.25f, 0f), Radius = 10.5f / 2f, - DiffuseColor = new Rgb96f(0.89f, 0.48f, 0.42f) + DiffuseColor = new RGB96f(0.89f, 0.48f, 0.42f) }, // Small center yellow Sphere new Sphere { Position = new Vector3(-3.5f, 1.6f, -6.7f), Radius = 3.2f / 2f, - DiffuseColor = new Rgb96f(0.95f, 0.93f, 0.31f) + DiffuseColor = new RGB96f(0.95f, 0.93f, 0.31f) }, // Large back right pink Sphere new Sphere { Position = new Vector3(14f, 7f, 6.5f), Radius = 14f / 2f, - DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) + DiffuseColor = new RGB96f(1f, 0.44f, 0.64f) }, // Small front right orange Sphere new Sphere { Position = new Vector3(8.2f, 3.5f, -6.5f), Radius = 7f / 2f, - DiffuseColor = new Rgb96f(0.89f, 0.48f, 0.42f) + DiffuseColor = new RGB96f(0.89f, 0.48f, 0.42f) }, // Large back left pink Sphere new Sphere { Position = new Vector3(-16.6f, 6.5f, 0f), Radius = 13f / 2f, - DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) + DiffuseColor = new RGB96f(1f, 0.44f, 0.64f) }, // Medium front back left pink Sphere new Sphere { Position = new Vector3(-9.5f, 3f, -6f), Radius = 6f / 2f, - DiffuseColor = new Rgb96f(1f, 0.44f, 0.64f) + DiffuseColor = new RGB96f(1f, 0.44f, 0.64f) }, // Back left yellow Sphere new Sphere { Position = new Vector3(-15f, 3f, 12f), Radius = 6f / 2f, - DiffuseColor = new Rgb96f(0.95f, 0.93f, 0.31f) + DiffuseColor = new RGB96f(0.95f, 0.93f, 0.31f) }, // Far Back right blue Sphere new Sphere { Position = new Vector3(40f, 10f, 175f), Radius = 20f / 2f, - DiffuseColor = new Rgb96f(0.18f, 0.31f, 0.68f) + DiffuseColor = new RGB96f(0.18f, 0.31f, 0.68f) }, }, Lights = @@ -115,7 +115,7 @@ public static void Main() new PointLight { Position = new Vector3(-300f, 350f, 10f), - Color = new Rgb96f(0.70f, 0.689f, 0.6885f) + Color = new RGB96f(0.70f, 0.689f, 0.6885f) }, }, }; diff --git a/samples/RayTracer/Sphere.cs b/samples/RayTracer/Sphere.cs index a5e2964a..1b0b4922 100644 --- a/samples/RayTracer/Sphere.cs +++ b/samples/RayTracer/Sphere.cs @@ -20,7 +20,7 @@ using System; using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class Sphere : IObject { @@ -32,7 +32,7 @@ internal sealed class Sphere : IObject public float DiffuseCoefficient { get; set; } = 1f; - public Rgb96f DiffuseColor { get; set; } = Rgb96f.Black; + public RGB96f DiffuseColor { get; set; } = RGB96f.Black; public Vector3 NormalAt(Vector3 point) { diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index 0ad6e4a3..3fe2a60a 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -21,29 +21,29 @@ using System; using System.Collections.Generic; using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class World { - public Rgb96f Ambient { get; set; } + public RGB96f Ambient { get; set; } public ICollection Objects { get; } = []; public ICollection Lights { get; } = []; - public Rgb96f Trace(Ray ray, int level, float weight) + public RGB96f Trace(Ray ray, int level, float weight) { var nearestIntersection = ray.Intersect(Objects); if (nearestIntersection is not null) { return Shade(nearestIntersection, level, weight); } - return Rgb96f.Black; + return RGB96f.Black; } - private Rgb96f Shade(Intersection intersection, int level, float weight) + private RGB96f Shade(Intersection intersection, int level, float weight) { - var color = Rgb96f.Black; + var color = RGB96f.Black; var @object = intersection.Object; var surfaceNormal = intersection.Normal; var surfacePoint = intersection.Point; diff --git a/samples/SwirlStars/Program.cs b/samples/SwirlStars/Program.cs index 5f1dbdc8..aa0bf271 100644 --- a/samples/SwirlStars/Program.cs +++ b/samples/SwirlStars/Program.cs @@ -25,7 +25,7 @@ using SDL2Sharp; using SDL2Sharp.Video; using SDL2Sharp.Fonts; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using SDL2Sharp.Input; internal static class Program @@ -150,7 +150,7 @@ private static void ResetStar(Star star) x: 0f, y: 0f, z: -(.5f + 4.5f * _randomizer.NextSingle())); - star.Color = new Rgb96f( + star.Color = new RGB96f( r: _randomizer.NextSingle(), g: _randomizer.NextSingle(), b: _randomizer.NextSingle() diff --git a/samples/SwirlStars/Star.cs b/samples/SwirlStars/Star.cs index 2fd2f690..cfbaa3ec 100644 --- a/samples/SwirlStars/Star.cs +++ b/samples/SwirlStars/Star.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; internal sealed class Star { @@ -27,5 +27,5 @@ internal sealed class Star public Vector3 Velocity { get; set; } = Vector3.Zero; - public Rgb96f Color { get; set; } = Rgb96f.Black; + public RGB96f Color { get; set; } = RGB96f.Black; } diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index 6144c4d9..38405f61 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -24,7 +24,7 @@ using SDL2Sharp.Input; using SDL2Sharp.Fonts; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using static System.Math; using static SDL2Sharp.Math; @@ -39,11 +39,11 @@ public static void Main() using var window = videoSubystem.CreateWindow("Tunnel Effect", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); + using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); var screenSize = renderer.OutputSize; - var screenImage = new PackedMemoryImage(renderer.OutputSize); + var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImageSize = NextPowerOfTwo(Max(renderer.OutputWidth, renderer.OutputHeight)); var sourceImage = GenerateXorImage(sourceImageSize); var transformTable = GenerateTransformTable(sourceImageSize); @@ -135,19 +135,19 @@ public static void Main() } } - private static PackedMemoryImage GenerateXorImage(int size) + private static PackedMemoryImage GenerateXorImage(int size) { return GenerateXorImage(size, size); } - private static PackedMemoryImage GenerateXorImage(int width, int height) + private static PackedMemoryImage GenerateXorImage(int width, int height) { - var image = new PackedMemoryImage(width, height); + var image = new PackedMemoryImage(width, height); for (var y = 0; y < height; y++) { for (var x = 0; x < width; x++) { - image[x, y] = new Argb8888( + image[x, y] = new ARGB8888( a: 0xFF, r: 0x00, g: 0x00, diff --git a/sources/SDL2Sharp/Fonts/Font.cs b/sources/SDL2Sharp/Fonts/Font.cs index 2fcb7931..7aebd877 100644 --- a/sources/SDL2Sharp/Fonts/Font.cs +++ b/sources/SDL2Sharp/Fonts/Font.cs @@ -20,7 +20,7 @@ using System; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using SDL2Sharp.Internals; using SDL2Sharp.Interop; @@ -67,13 +67,13 @@ public Surface RenderSolid(string text, Color color) return new Surface(surfaceHandle); } - public Surface RenderBlended(string text, Color color) + public Surface RenderBlended(string text, Color color) { ThrowWhenDisposed(); using var marshaledText = new MarshaledString(text); var surfaceHandle = TTF.RenderText_Blended(_handle, marshaledText, color); - return new Surface(surfaceHandle); + return new Surface(surfaceHandle); } private void ThrowWhenDisposed() diff --git a/sources/SDL2Sharp/Video/Nv12Image.cs b/sources/SDL2Sharp/Video/NV12Image.cs similarity index 94% rename from sources/SDL2Sharp/Video/Nv12Image.cs rename to sources/SDL2Sharp/Video/NV12Image.cs index 138c2f47..fc1794a0 100644 --- a/sources/SDL2Sharp/Video/Nv12Image.cs +++ b/sources/SDL2Sharp/Video/NV12Image.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public readonly ref struct Nv12Image + public readonly ref struct NV12Image { private readonly ImagePlane _yPlane; @@ -46,7 +46,7 @@ public readonly int Height get => _yPlane.Height; } - public unsafe Nv12Image(void* pixels, int width, int height, int pitch) + public unsafe NV12Image(void* pixels, int width, int height, int pitch) { if (height < 0) { diff --git a/sources/SDL2Sharp/Video/Nv12MemoryImage.cs b/sources/SDL2Sharp/Video/NV12MemoryImage.cs similarity index 94% rename from sources/SDL2Sharp/Video/Nv12MemoryImage.cs rename to sources/SDL2Sharp/Video/NV12MemoryImage.cs index d9211a38..d3fd1abe 100644 --- a/sources/SDL2Sharp/Video/Nv12MemoryImage.cs +++ b/sources/SDL2Sharp/Video/NV12MemoryImage.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public sealed class Nv12MemoryImage + public sealed class NV12MemoryImage { private readonly ImageMemoryPlane _yPlane; @@ -46,7 +46,7 @@ public int Height get => _yPlane.Height; } - public Nv12MemoryImage(int width, int height) + public NV12MemoryImage(int width, int height) { if (width < 0) { diff --git a/sources/SDL2Sharp/Video/Nv12Texture.cs b/sources/SDL2Sharp/Video/NV12Texture.cs similarity index 89% rename from sources/SDL2Sharp/Video/Nv12Texture.cs rename to sources/SDL2Sharp/Video/NV12Texture.cs index a6983626..ca579472 100644 --- a/sources/SDL2Sharp/Video/Nv12Texture.cs +++ b/sources/SDL2Sharp/Video/NV12Texture.cs @@ -23,9 +23,9 @@ namespace SDL2Sharp.Video { - public sealed unsafe class Nv12Texture : IDisposable + public sealed unsafe class NV12Texture : IDisposable { - public delegate void LockCallback(Nv12Image pixels); + public delegate void LockCallback(NV12Image pixels); private Texture _texture; @@ -46,12 +46,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal Nv12Texture(Texture texture) + internal NV12Texture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~Nv12Texture() + ~NV12Texture() { Dispose(false); } @@ -92,12 +92,12 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new Nv12Image(pixels, width, height, pitch); + var image = new NV12Image(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(Nv12Image image) + public void Update(NV12Image image) { Error.ThrowLastErrorIfNegative( SDL.UpdateNVTexture(_texture.Handle, null, @@ -106,7 +106,7 @@ public void Update(Nv12Image image) ); } - public void Update(Nv12MemoryImage image) + public void Update(NV12MemoryImage image) { ArgumentNullException.ThrowIfNull(image); @@ -123,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(Nv12Texture texture) + public static implicit operator Texture(NV12Texture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/Video/Nv21Image.cs b/sources/SDL2Sharp/Video/NV21Image.cs similarity index 94% rename from sources/SDL2Sharp/Video/Nv21Image.cs rename to sources/SDL2Sharp/Video/NV21Image.cs index 83a851a8..fc01f999 100644 --- a/sources/SDL2Sharp/Video/Nv21Image.cs +++ b/sources/SDL2Sharp/Video/NV21Image.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public readonly ref struct Nv21Image + public readonly ref struct NV21Image { private readonly ImagePlane _yPlane; @@ -46,7 +46,7 @@ public readonly int Height get => _yPlane.Height; } - public unsafe Nv21Image(void* pixels, int width, int height, int pitch) + public unsafe NV21Image(void* pixels, int width, int height, int pitch) { if (height < 0) { diff --git a/sources/SDL2Sharp/Video/Nv21MemoryImage.cs b/sources/SDL2Sharp/Video/NV21MemoryImage.cs similarity index 94% rename from sources/SDL2Sharp/Video/Nv21MemoryImage.cs rename to sources/SDL2Sharp/Video/NV21MemoryImage.cs index bae970b5..f4df3b52 100644 --- a/sources/SDL2Sharp/Video/Nv21MemoryImage.cs +++ b/sources/SDL2Sharp/Video/NV21MemoryImage.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public sealed class Nv21MemoryImage + public sealed class NV21MemoryImage { private readonly ImageMemoryPlane _yPlane; @@ -46,7 +46,7 @@ public int Height get => _yPlane.Height; } - public Nv21MemoryImage(int width, int height) + public NV21MemoryImage(int width, int height) { if (width < 0) { diff --git a/sources/SDL2Sharp/Video/Nv21Texture.cs b/sources/SDL2Sharp/Video/NV21Texture.cs similarity index 89% rename from sources/SDL2Sharp/Video/Nv21Texture.cs rename to sources/SDL2Sharp/Video/NV21Texture.cs index 6bd3c6ce..51dabb54 100644 --- a/sources/SDL2Sharp/Video/Nv21Texture.cs +++ b/sources/SDL2Sharp/Video/NV21Texture.cs @@ -23,9 +23,9 @@ namespace SDL2Sharp.Video { - public sealed unsafe class Nv21Texture : IDisposable + public sealed unsafe class NV21Texture : IDisposable { - public delegate void LockCallback(Nv21Image pixels); + public delegate void LockCallback(NV21Image pixels); private Texture _texture; @@ -46,12 +46,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal Nv21Texture(Texture texture) + internal NV21Texture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~Nv21Texture() + ~NV21Texture() { Dispose(false); } @@ -92,12 +92,12 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new Nv21Image(pixels, width, height, pitch); + var image = new NV21Image(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(Nv21Image image) + public void Update(NV21Image image) { Error.ThrowLastErrorIfNegative( SDL.UpdateNVTexture(_texture.Handle, null, @@ -106,7 +106,7 @@ public void Update(Nv21Image image) ); } - public void Update(Nv21MemoryImage image) + public void Update(NV21MemoryImage image) { ArgumentNullException.ThrowIfNull(image); @@ -123,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(Nv21Texture texture) + public static implicit operator Texture(NV21Texture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index daf917b5..029e5356 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -23,7 +23,7 @@ using System.Runtime.InteropServices; using Microsoft.Toolkit.HighPerformance; using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { diff --git a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs b/sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Abgr1555.cs rename to sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs index bfb76f0e..f81128df 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr1555.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs @@ -20,11 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { - [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Abgr1555 : IPackedPixel + public readonly record struct ABGR1555 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR1555); @@ -32,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Abgr1555 FromRGB(byte r, byte g, byte b) + public static ABGR1555 FromRGB(byte r, byte g, byte b) { - return new Abgr1555((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new ABGR1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Abgr1555 FromRGBA(byte r, byte g, byte b, byte a) + public static ABGR1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new ABGR1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Abgr1555(ushort value) + private ABGR1555(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs b/sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Abgr4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs index 5e2b8190..4efd499b 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Abgr4444 : IPackedPixel + public readonly record struct ABGR4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR4444); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Abgr4444 FromRGB(byte r, byte g, byte b) + public static ABGR4444 FromRGB(byte r, byte g, byte b) { - return new Abgr4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new ABGR4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Abgr4444 FromRGBA(byte r, byte g, byte b, byte a) + public static ABGR4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new ABGR4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Abgr4444(ushort value) + private ABGR4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs b/sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Abgr8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs index eabc2ed2..6bd5706f 100644 --- a/sources/SDL2Sharp/Video/Colors/Abgr8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Abgr8888 : IPackedPixel + public readonly record struct ABGR8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ABGR8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Abgr8888 FromRGB(byte r, byte g, byte b) + public static ABGR8888 FromRGB(byte r, byte g, byte b) { - return new Abgr8888(_formatDescriptor.MapRGB(r, g, b)); + return new ABGR8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Abgr8888 FromRGBA(byte r, byte g, byte b, byte a) + public static ABGR8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Abgr8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new ABGR8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Abgr8888(byte a, byte b, byte g, byte r) + public ABGR8888(byte a, byte b, byte g, byte r) : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } - private Abgr8888(uint value) + private ABGR8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Argb1555.cs b/sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Argb1555.cs rename to sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs index 14493b69..6f592953 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb1555.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Argb1555 : IPackedPixel + public readonly record struct ARGB1555 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB1555); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Argb1555 FromRGB(byte r, byte g, byte b) + public static ARGB1555 FromRGB(byte r, byte g, byte b) { - return new Argb1555((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new ARGB1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Argb1555 FromRGBA(byte r, byte g, byte b, byte a) + public static ARGB1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new ARGB1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Argb1555(ushort value) + private ARGB1555(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs b/sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Argb2101010.cs rename to sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs index 6ad2b141..9c10017b 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb2101010.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Argb2101010 : IPackedPixel + public readonly record struct ARGB2101010 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB2101010); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Argb2101010 FromRGB(byte r, byte g, byte b) + public static ARGB2101010 FromRGB(byte r, byte g, byte b) { - return new Argb2101010(_formatDescriptor.MapRGB(r, g, b)); + return new ARGB2101010(_formatDescriptor.MapRGB(r, g, b)); } - public static Argb2101010 FromRGBA(byte r, byte g, byte b, byte a) + public static ARGB2101010 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb2101010(_formatDescriptor.MapRGBA(r, g, b, a)); + return new ARGB2101010(_formatDescriptor.MapRGBA(r, g, b, a)); } - private Argb2101010(uint value) + private ARGB2101010(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Argb4444.cs b/sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Argb4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs index 2409a3fc..be3303ec 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Argb4444 : IPackedPixel + public readonly record struct ARGB4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB4444); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Argb4444 FromRGB(byte r, byte g, byte b) + public static ARGB4444 FromRGB(byte r, byte g, byte b) { - return new Argb4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new ARGB4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Argb4444 FromRGBA(byte r, byte g, byte b, byte a) + public static ARGB4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new ARGB4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Argb4444(ushort value) + private ARGB4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Argb8888.cs b/sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Argb8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs index 3851cfa7..e2835029 100644 --- a/sources/SDL2Sharp/Video/Colors/Argb8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Argb8888 : IPackedPixel + public readonly record struct ARGB8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.ARGB8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Argb8888 FromRGB(byte r, byte g, byte b) + public static ARGB8888 FromRGB(byte r, byte g, byte b) { - return new Argb8888(_formatDescriptor.MapRGB(r, g, b)); + return new ARGB8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Argb8888 FromRGBA(byte r, byte g, byte b, byte a) + public static ARGB8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Argb8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new ARGB8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Argb8888(byte a, byte r, byte g, byte b) + public ARGB8888(byte a, byte r, byte g, byte b) : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } - private Argb8888(uint value) + private ARGB8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Bgr24.cs b/sources/SDL2Sharp/Video/PixelFormats/BGR24.cs similarity index 91% rename from sources/SDL2Sharp/Video/Colors/Bgr24.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGR24.cs index 4927ff99..97b08691 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr24.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGR24.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - public readonly record struct Bgr24 + public readonly record struct BGR24 { private readonly byte _r, _g, _b; @@ -33,7 +33,7 @@ public readonly record struct Bgr24 public byte R => _r; - public Bgr24(byte b, byte g, byte r) + public BGR24(byte b, byte g, byte r) { _b = b; _g = g; diff --git a/sources/SDL2Sharp/Video/Colors/Bgr565.cs b/sources/SDL2Sharp/Video/PixelFormats/BGR565.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Bgr565.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGR565.cs index 1cdc8197..99ebf39e 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgr565.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGR565.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Bgr565 : IPackedPixel + public readonly record struct BGR565 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGR565); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Bgr565 FromRGB(byte r, byte g, byte b) + public static BGR565 FromRGB(byte r, byte g, byte b) { - return new Bgr565((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new BGR565((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Bgr565 FromRGBA(byte r, byte g, byte b, byte a) + public static BGR565 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgr565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new BGR565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Bgr565(ushort value) + private BGR565(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs b/sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Bgra4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs index 1921f91f..9da9518a 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Bgra4444 : IPackedPixel + public readonly record struct BGRA4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA4444); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Bgra4444 FromRGB(byte r, byte g, byte b) + public static BGRA4444 FromRGB(byte r, byte g, byte b) { - return new Bgra4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new BGRA4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Bgra4444 FromRGBA(byte r, byte g, byte b, byte a) + public static BGRA4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new BGRA4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Bgra4444(ushort value) + private BGRA4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs b/sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Bgra5551.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs index 3e2005b4..15ebf9f6 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra5551.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Bgra5551 : IPackedPixel + public readonly record struct BGRA5551 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA5551); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Bgra5551 FromRGB(byte r, byte g, byte b) + public static BGRA5551 FromRGB(byte r, byte g, byte b) { - return new Bgra5551((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new BGRA5551((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Bgra5551 FromRGBA(byte r, byte g, byte b, byte a) + public static BGRA5551 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new BGRA5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Bgra5551(ushort value) + private BGRA5551(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs b/sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs similarity index 77% rename from sources/SDL2Sharp/Video/Colors/Bgra8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs index 80435cb9..df40a367 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgra8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Bgra8888 : IPackedPixel + public readonly record struct BGRA8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRA8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Bgra8888 FromRGBA(byte r, byte g, byte b) + public static BGRA8888 FromRGBA(byte r, byte g, byte b) { - return new Bgra8888(_formatDescriptor.MapRGB(r, g, b)); + return new BGRA8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Bgra8888 FromRGBA(byte r, byte g, byte b, byte a) + public static BGRA8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgra8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new BGRA8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Bgra8888(byte b, byte g, byte r, byte a) + public BGRA8888(byte b, byte g, byte r, byte a) : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } - private Bgra8888(uint value) + private BGRA8888(uint value) { _value = value; } @@ -60,7 +60,7 @@ private Bgra8888(uint value) return _formatDescriptor.GetRGBA(_value); } - public static Bgra8888 FromRGB(byte r, byte g, byte b) + public static BGRA8888 FromRGB(byte r, byte g, byte b) { throw new System.NotImplementedException(); } diff --git a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs b/sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Bgrx8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs index 83fdf29a..4c80e7b8 100644 --- a/sources/SDL2Sharp/Video/Colors/Bgrx8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Bgrx8888 : IPackedPixel + public readonly record struct BGRX8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.BGRX8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Bgrx8888 FromRGB(byte r, byte g, byte b) + public static BGRX8888 FromRGB(byte r, byte g, byte b) { - return new Bgrx8888(_formatDescriptor.MapRGB(r, g, b)); + return new BGRX8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Bgrx8888 FromRGBA(byte r, byte g, byte b, byte a) + public static BGRX8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Bgrx8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new BGRX8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Bgrx8888(byte b, byte g, byte r) + public BGRX8888(byte b, byte g, byte r) : this(_formatDescriptor.MapRGB(r, g, b)) { } - private Bgrx8888(uint value) + private BGRX8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/IPackedPixel.cs b/sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs similarity index 97% rename from sources/SDL2Sharp/Video/Colors/IPackedPixel.cs rename to sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs index 4997ea50..a7b1e871 100644 --- a/sources/SDL2Sharp/Video/Colors/IPackedPixel.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { public interface IPackedPixel where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/Colors/Iyuv.cs b/sources/SDL2Sharp/Video/PixelFormats/IYUV.cs similarity index 96% rename from sources/SDL2Sharp/Video/Colors/Iyuv.cs rename to sources/SDL2Sharp/Video/PixelFormats/IYUV.cs index 1c045137..805fe7e5 100644 --- a/sources/SDL2Sharp/Video/Colors/Iyuv.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/IYUV.cs @@ -20,9 +20,9 @@ using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { - public readonly struct Iyuv : IYuvFormat + public readonly struct IYUV : IYUVFormat { public static PixelFormat PixelFormat => PixelFormat.IYUV; diff --git a/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs b/sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs similarity index 95% rename from sources/SDL2Sharp/Video/Colors/IYuvFormat.cs rename to sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs index 7205e922..71714d36 100644 --- a/sources/SDL2Sharp/Video/Colors/IYuvFormat.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs @@ -18,9 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { - public interface IYuvFormat + public interface IYUVFormat { static abstract PixelFormat PixelFormat { get; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb24.cs b/sources/SDL2Sharp/Video/PixelFormats/RGB24.cs similarity index 91% rename from sources/SDL2Sharp/Video/Colors/Rgb24.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGB24.cs index b0bc339d..404ed0a5 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb24.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGB24.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] - public readonly record struct Rgb24 + public readonly record struct RGB24 { private readonly byte _b, _g, _r; @@ -33,7 +33,7 @@ public readonly record struct Rgb24 public byte B => _b; - public Rgb24(byte r, byte g, byte b) + public RGB24(byte r, byte g, byte b) { _r = r; _g = g; diff --git a/sources/SDL2Sharp/Video/Colors/Rgb332.cs b/sources/SDL2Sharp/Video/PixelFormats/RGB332.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Rgb332.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGB332.cs index f1498e14..f4e91860 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb332.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGB332.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] - public readonly record struct Rgb332 : IPackedPixel + public readonly record struct RGB332 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGB332); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Rgb332 FromRGB(byte r, byte g, byte b) + public static RGB332 FromRGB(byte r, byte g, byte b) { - return new Rgb332((byte)_formatDescriptor.MapRGB(r, g, b)); + return new RGB332((byte)_formatDescriptor.MapRGB(r, g, b)); } - public static Rgb332 FromRGBA(byte r, byte g, byte b, byte a) + public static RGB332 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgb332((byte)_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGB332((byte)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Rgb332(byte value) + private RGB332(byte value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb565.cs b/sources/SDL2Sharp/Video/PixelFormats/RGB565.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Rgb565.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGB565.cs index 701e5d1d..e06703b4 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb565.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGB565.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Rgb565 : IPackedPixel + public readonly record struct RGB565 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGB565); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Rgb565 FromRGB(byte r, byte g, byte b) + public static RGB565 FromRGB(byte r, byte g, byte b) { - return new Rgb565((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new RGB565((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Rgb565 FromRGBA(byte r, byte g, byte b, byte a) + public static RGB565 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgb565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGB565((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Rgb565(ushort value) + private RGB565(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb96f.cs b/sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs similarity index 68% rename from sources/SDL2Sharp/Video/Colors/Rgb96f.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs index 75eea769..664c7af6 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb96f.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs @@ -23,14 +23,14 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] - public readonly struct Rgb96f : IEquatable + public readonly struct RGB96f : IEquatable { - public static Rgb96f Black { get; } = new Rgb96f(0f, 0f, 0f); + public static RGB96f Black { get; } = new RGB96f(0f, 0f, 0f); - public static Rgb96f White { get; } = new Rgb96f(1f, 1f, 1f); + public static RGB96f White { get; } = new RGB96f(1f, 1f, 1f); private readonly Vector3 _components; @@ -62,23 +62,23 @@ public float B } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgb96f(float r, float g, float b) + public RGB96f(float r, float g, float b) : this(new Vector3(r, g, b)) { } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgb96f(Rgb96f other) + public RGB96f(RGB96f other) : this(other._components) { } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private Rgb96f(Vector3 components) + private RGB96f(Vector3 components) { _components = components; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rgb96f other) + public readonly bool Equals(RGB96f other) { return _components.Equals(other._components); } @@ -86,7 +86,7 @@ public readonly bool Equals(Rgb96f other) [MethodImpl(MethodImplOptions.AggressiveInlining)] public override readonly bool Equals(object? obj) { - if (obj is Rgb96f other) + if (obj is RGB96f other) { return Equals(other); } @@ -99,127 +99,127 @@ public override readonly int GetHashCode() } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Negate(Rgb96f value) + public static RGB96f Negate(RGB96f value) { - return new Rgb96f(-value._components); + return new RGB96f(-value._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Add(Rgb96f left, Rgb96f right) + public static RGB96f Add(RGB96f left, RGB96f right) { - return new Rgb96f(left._components + right._components); + return new RGB96f(left._components + right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Subtract(Rgb96f left, Rgb96f right) + public static RGB96f Subtract(RGB96f left, RGB96f right) { - return new Rgb96f(left._components - right._components); + return new RGB96f(left._components - right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Multiply(float left, Rgb96f right) + public static RGB96f Multiply(float left, RGB96f right) { - return new Rgb96f(left * right._components); + return new RGB96f(left * right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Multiply(Rgb96f left, float right) + public static RGB96f Multiply(RGB96f left, float right) { - return new Rgb96f(left._components * right); + return new RGB96f(left._components * right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Multiply(Rgb96f left, Rgb96f right) + public static RGB96f Multiply(RGB96f left, RGB96f right) { - return new Rgb96f(left._components * right._components); + return new RGB96f(left._components * right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Divide(Rgb96f left, Rgb96f right) + public static RGB96f Divide(RGB96f left, RGB96f right) { - return new Rgb96f(left._components / right._components); + return new RGB96f(left._components / right._components); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Divide(Rgb96f left, float right) + public static RGB96f Divide(RGB96f left, float right) { - return new Rgb96f(left._components / right); + return new RGB96f(left._components / right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Clamp(Rgb96f value, Rgb96f min, Rgb96f max) + public static RGB96f Clamp(RGB96f value, RGB96f min, RGB96f max) { - return new Rgb96f(Vector3.Clamp(value._components, min._components, max._components)); + return new RGB96f(Vector3.Clamp(value._components, min._components, max._components)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f Clamp(Rgb96f value) + public static RGB96f Clamp(RGB96f value) { return Clamp(value, Black, White); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator +(Rgb96f value) + public static RGB96f operator +(RGB96f value) { return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator -(Rgb96f value) + public static RGB96f operator -(RGB96f value) { return Negate(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator +(Rgb96f left, Rgb96f right) + public static RGB96f operator +(RGB96f left, RGB96f right) { return Add(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator -(Rgb96f left, Rgb96f right) + public static RGB96f operator -(RGB96f left, RGB96f right) { return Subtract(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator *(float left, Rgb96f right) + public static RGB96f operator *(float left, RGB96f right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator *(Rgb96f left, float right) + public static RGB96f operator *(RGB96f left, float right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator *(Rgb96f left, Rgb96f right) + public static RGB96f operator *(RGB96f left, RGB96f right) { return Multiply(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator /(Rgb96f left, Rgb96f right) + public static RGB96f operator /(RGB96f left, RGB96f right) { return Divide(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rgb96f operator /(Rgb96f left, float right) + public static RGB96f operator /(RGB96f left, float right) { return Divide(left, right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rgb96f left, Rgb96f right) + public static bool operator ==(RGB96f left, RGB96f right) { return left.Equals(right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rgb96f left, Rgb96f right) + public static bool operator !=(RGB96f left, RGB96f right) { return !left.Equals(right); } diff --git a/sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs b/sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs similarity index 76% rename from sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs index 57aecc1f..40ebe06d 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgb96fExtensions.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs @@ -20,13 +20,13 @@ using static System.Math; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { - public static class Rgb96fExtensions + public static class RGB96fExtensions { - public static Color ToColor(this Rgb96f color) + public static Color ToColor(this RGB96f color) { - var clampedColor = Rgb96f.Clamp(color); + var clampedColor = RGB96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); @@ -34,24 +34,24 @@ public static Color ToColor(this Rgb96f color) return new Color(r, g, b, 255); } - public static Rgba8888 ToRgba8888(this Rgb96f color) + public static RGBA8888 ToRgba8888(this RGB96f color) { - var clampedColor = Rgb96f.Clamp(color); + var clampedColor = RGB96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); var b = (byte)Round(scaledColor.B); - return new Rgba8888(r, g, b, 255); + return new RGBA8888(r, g, b, 255); } - public static Argb8888 ToArgb8888(this Rgb96f color) + public static ARGB8888 ToArgb8888(this RGB96f color) { - var clampedColor = Rgb96f.Clamp(color); + var clampedColor = RGB96f.Clamp(color); var scaledColor = clampedColor * 255f; var r = (byte)Round(scaledColor.R); var g = (byte)Round(scaledColor.G); var b = (byte)Round(scaledColor.B); - return new Argb8888(255, r, g, b); + return new ARGB8888(255, r, g, b); } } } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs b/sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Rgba4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs index c56b27d9..4cf18f25 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs @@ -20,28 +20,28 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Rgba4444 : IPackedPixel + public readonly record struct RGBA4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA4444); public static PixelFormat Format => _formatDescriptor.Format; - public static Rgba4444 FromRGB(byte r, byte g, byte b) + public static RGBA4444 FromRGB(byte r, byte g, byte b) { - return new Rgba4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new RGBA4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Rgba4444 FromRGBA(byte r, byte g, byte b, byte a) + public static RGBA4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGBA4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } private readonly ushort _value; - private Rgba4444(ushort value) + private RGBA4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs b/sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Rgba5551.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs index 6909398f..f51ff014 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba5551.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Rgba5551 : IPackedPixel + public readonly record struct RGBA5551 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA5551); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Rgba5551 FromRGB(byte r, byte g, byte b) + public static RGBA5551 FromRGB(byte r, byte g, byte b) { - return new Rgba5551((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new RGBA5551((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Rgba5551 FromRGBA(byte r, byte g, byte b, byte a) + public static RGBA5551 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGBA5551((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Rgba5551(ushort value) + private RGBA5551(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs b/sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Rgba8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs index 6a8ad5ac..fd197786 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgba8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Rgba8888 : IPackedPixel + public readonly record struct RGBA8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBA8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Rgba8888 FromRGB(byte r, byte g, byte b) + public static RGBA8888 FromRGB(byte r, byte g, byte b) { - return new Rgba8888(_formatDescriptor.MapRGB(r, g, b)); + return new RGBA8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Rgba8888 FromRGBA(byte r, byte g, byte b, byte a) + public static RGBA8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgba8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGBA8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Rgba8888(byte r, byte g, byte b, byte a) + public RGBA8888(byte r, byte g, byte b, byte a) : this(_formatDescriptor.MapRGBA(r, g, b, a)) { } - private Rgba8888(uint value) + private RGBA8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs b/sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Rgbx8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs index 0a99c9d2..802ce627 100644 --- a/sources/SDL2Sharp/Video/Colors/Rgbx8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Rgbx8888 : IPackedPixel + public readonly record struct RGBX8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.RGBX8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Rgbx8888 FromRGB(byte r, byte g, byte b) + public static RGBX8888 FromRGB(byte r, byte g, byte b) { - return new Rgbx8888(_formatDescriptor.MapRGB(r, g, b)); + return new RGBX8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Rgbx8888 FromRGBA(byte r, byte g, byte b, byte a) + public static RGBX8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Rgbx8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new RGBX8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Rgbx8888(byte r, byte g, byte b) + public RGBX8888(byte r, byte g, byte b) : this(_formatDescriptor.MapRGB(r, g, b)) { } - private Rgbx8888(uint value) + private RGBX8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/U8.cs b/sources/SDL2Sharp/Video/PixelFormats/U8.cs similarity index 96% rename from sources/SDL2Sharp/Video/Colors/U8.cs rename to sources/SDL2Sharp/Video/PixelFormats/U8.cs index e3746da1..aa369d9d 100644 --- a/sources/SDL2Sharp/Video/Colors/U8.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/U8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct U8 diff --git a/sources/SDL2Sharp/Video/Colors/UV88.cs b/sources/SDL2Sharp/Video/PixelFormats/UV88.cs similarity index 97% rename from sources/SDL2Sharp/Video/Colors/UV88.cs rename to sources/SDL2Sharp/Video/PixelFormats/UV88.cs index 208ffe23..d957633b 100644 --- a/sources/SDL2Sharp/Video/Colors/UV88.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/UV88.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct UV88 diff --git a/sources/SDL2Sharp/Video/Colors/Uyvy.cs b/sources/SDL2Sharp/Video/PixelFormats/UYVY.cs similarity index 91% rename from sources/SDL2Sharp/Video/Colors/Uyvy.cs rename to sources/SDL2Sharp/Video/PixelFormats/UYVY.cs index 1509e75e..76099d6d 100644 --- a/sources/SDL2Sharp/Video/Colors/Uyvy.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/UYVY.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Uyvy + public readonly record struct UYVY { private readonly uint _value; @@ -35,7 +35,7 @@ public readonly record struct Uyvy public byte Y1 => (byte)(_value >> 24 & 0xFF); - public Uyvy(byte u0, byte y0, byte v0, byte y1) + public UYVY(byte u0, byte y0, byte v0, byte y1) { unchecked { diff --git a/sources/SDL2Sharp/Video/Colors/V8.cs b/sources/SDL2Sharp/Video/PixelFormats/V8.cs similarity index 96% rename from sources/SDL2Sharp/Video/Colors/V8.cs rename to sources/SDL2Sharp/Video/PixelFormats/V8.cs index d0887675..eb36cb2c 100644 --- a/sources/SDL2Sharp/Video/Colors/V8.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/V8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct V8 diff --git a/sources/SDL2Sharp/Video/Colors/VU88.cs b/sources/SDL2Sharp/Video/PixelFormats/VU88.cs similarity index 97% rename from sources/SDL2Sharp/Video/Colors/VU88.cs rename to sources/SDL2Sharp/Video/PixelFormats/VU88.cs index 681e0548..8056d4a0 100644 --- a/sources/SDL2Sharp/Video/Colors/VU88.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/VU88.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct VU88 diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs b/sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Xbgr1555.cs rename to sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs index 373ffcda..a305126f 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr1555.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Xbgr1555 : IPackedPixel + public readonly record struct XBGR1555 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR1555); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xbgr1555 FromRGB(byte r, byte g, byte b) + public static XBGR1555 FromRGB(byte r, byte g, byte b) { - return new Xbgr1555((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new XBGR1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Xbgr1555 FromRGBA(byte r, byte g, byte b, byte a) + public static XBGR1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new XBGR1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Xbgr1555(ushort value) + private XBGR1555(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs b/sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Xbgr4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs index e6ae0ef7..703926d8 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Xbgr4444 : IPackedPixel + public readonly record struct XBGR4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR4444); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xbgr4444 FromRGB(byte r, byte g, byte b) + public static XBGR4444 FromRGB(byte r, byte g, byte b) { - return new Xbgr4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new XBGR4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Xbgr4444 FromRGBA(byte r, byte g, byte b, byte a) + public static XBGR4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new XBGR4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Xbgr4444(ushort value) + private XBGR4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs b/sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Xbgr8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs index 3aa17835..7dc8c5c7 100644 --- a/sources/SDL2Sharp/Video/Colors/Xbgr8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Xbgr8888 : IPackedPixel + public readonly record struct XBGR8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XBGR8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xbgr8888 FromRGB(byte r, byte g, byte b) + public static XBGR8888 FromRGB(byte r, byte g, byte b) { - return new Xbgr8888(_formatDescriptor.MapRGB(r, g, b)); + return new XBGR8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Xbgr8888 FromRGBA(byte r, byte g, byte b, byte a) + public static XBGR8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xbgr8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new XBGR8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Xbgr8888(byte b, byte g, byte r) + public XBGR8888(byte b, byte g, byte r) : this(_formatDescriptor.MapRGB(r, g, b)) { } - private Xbgr8888(uint value) + private XBGR8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs b/sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Xrgb1555.cs rename to sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs index c54b4b03..b53ecae9 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb1555.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Xrgb1555 : IPackedPixel + public readonly record struct XRGB1555 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB1555); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xrgb1555 FromRGB(byte r, byte g, byte b) + public static XRGB1555 FromRGB(byte r, byte g, byte b) { - return new Xrgb1555((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new XRGB1555((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Xrgb1555 FromRGBA(byte r, byte g, byte b, byte a) + public static XRGB1555 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new XRGB1555((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Xrgb1555(ushort value) + private XRGB1555(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs b/sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs similarity index 80% rename from sources/SDL2Sharp/Video/Colors/Xrgb4444.cs rename to sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs index ec973709..86a9459c 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb4444.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] - public readonly record struct Xrgb4444 : IPackedPixel + public readonly record struct XRGB4444 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB4444); @@ -31,17 +31,17 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xrgb4444 FromRGB(byte r, byte g, byte b) + public static XRGB4444 FromRGB(byte r, byte g, byte b) { - return new Xrgb4444((ushort)_formatDescriptor.MapRGB(r, g, b)); + return new XRGB4444((ushort)_formatDescriptor.MapRGB(r, g, b)); } - public static Xrgb4444 FromRGBA(byte r, byte g, byte b, byte a) + public static XRGB4444 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); + return new XRGB4444((ushort)_formatDescriptor.MapRGBA(r, g, b, a)); } - private Xrgb4444(ushort value) + private XRGB4444(ushort value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs b/sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs similarity index 79% rename from sources/SDL2Sharp/Video/Colors/Xrgb8888.cs rename to sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs index fcb531eb..ad10ba74 100644 --- a/sources/SDL2Sharp/Video/Colors/Xrgb8888.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Xrgb8888 : IPackedPixel + public readonly record struct XRGB8888 : IPackedPixel { private static readonly PixelFormatDescriptor _formatDescriptor = new(PixelFormat.XRGB8888); @@ -31,21 +31,21 @@ namespace SDL2Sharp.Video.Colors public static PixelFormat Format => _formatDescriptor.Format; - public static Xrgb8888 FromRGB(byte r, byte g, byte b) + public static XRGB8888 FromRGB(byte r, byte g, byte b) { - return new Xrgb8888(_formatDescriptor.MapRGB(r, g, b)); + return new XRGB8888(_formatDescriptor.MapRGB(r, g, b)); } - public static Xrgb8888 FromRGBA(byte r, byte g, byte b, byte a) + public static XRGB8888 FromRGBA(byte r, byte g, byte b, byte a) { - return new Xrgb8888(_formatDescriptor.MapRGBA(r, g, b, a)); + return new XRGB8888(_formatDescriptor.MapRGBA(r, g, b, a)); } - public Xrgb8888(byte r, byte g, byte b) + public XRGB8888(byte r, byte g, byte b) : this(_formatDescriptor.MapRGB(r, g, b)) { } - private Xrgb8888(uint value) + private XRGB8888(uint value) { _value = value; } diff --git a/sources/SDL2Sharp/Video/Colors/Y8.cs b/sources/SDL2Sharp/Video/PixelFormats/Y8.cs similarity index 96% rename from sources/SDL2Sharp/Video/Colors/Y8.cs rename to sources/SDL2Sharp/Video/PixelFormats/Y8.cs index 32292e7e..a86c4460 100644 --- a/sources/SDL2Sharp/Video/Colors/Y8.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/Y8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct Y8 diff --git a/sources/SDL2Sharp/Video/Colors/Yuy2.cs b/sources/SDL2Sharp/Video/PixelFormats/YUY2.cs similarity index 91% rename from sources/SDL2Sharp/Video/Colors/Yuy2.cs rename to sources/SDL2Sharp/Video/PixelFormats/YUY2.cs index ddfc0c71..6ecc8723 100644 --- a/sources/SDL2Sharp/Video/Colors/Yuy2.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/YUY2.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Yuy2 + public readonly record struct YUY2 { private readonly uint _value; @@ -35,7 +35,7 @@ public readonly record struct Yuy2 public byte V0 => (byte)(_value >> 24 & 0xFF); - public Yuy2(byte y0, byte u0, byte y1, byte v0) + public YUY2(byte y0, byte u0, byte y1, byte v0) { unchecked { diff --git a/sources/SDL2Sharp/Video/Colors/Yv12.cs b/sources/SDL2Sharp/Video/PixelFormats/YV12.cs similarity index 96% rename from sources/SDL2Sharp/Video/Colors/Yv12.cs rename to sources/SDL2Sharp/Video/PixelFormats/YV12.cs index 76c60df2..9e2c4d21 100644 --- a/sources/SDL2Sharp/Video/Colors/Yv12.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/YV12.cs @@ -20,9 +20,9 @@ using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { - public readonly struct Yv12 : IYuvFormat + public readonly struct YV12 : IYUVFormat { public static PixelFormat PixelFormat => PixelFormat.YV12; diff --git a/sources/SDL2Sharp/Video/Colors/Yvyu.cs b/sources/SDL2Sharp/Video/PixelFormats/YVYU.cs similarity index 91% rename from sources/SDL2Sharp/Video/Colors/Yvyu.cs rename to sources/SDL2Sharp/Video/PixelFormats/YVYU.cs index 781a5ba5..d2b41144 100644 --- a/sources/SDL2Sharp/Video/Colors/Yvyu.cs +++ b/sources/SDL2Sharp/Video/PixelFormats/YVYU.cs @@ -20,10 +20,10 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.Colors +namespace SDL2Sharp.Video.PixelFormats { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] - public readonly record struct Yvyu + public readonly record struct YVYU { private readonly uint _value; @@ -35,7 +35,7 @@ public readonly record struct Yvyu public byte U0 => (byte)(_value >> 24 & 0xFF); - public Yvyu(byte y0, byte v0, byte y1, byte u0) + public YVYU(byte y0, byte v0, byte y1, byte u0) { unchecked { diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/Video/Renderer.cs index bfcbdc10..53289f30 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/Video/Renderer.cs @@ -22,7 +22,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/Video/RendererExtensions.cs index 349bcaec..ec0fb152 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/Video/RendererExtensions.cs @@ -20,7 +20,7 @@ using System; using SDL2Sharp.Fonts; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using static System.Math; namespace SDL2Sharp.Video @@ -45,54 +45,54 @@ public static PackedTexture CreatePackedTexture(this return new PackedTexture(texture); } - public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, Size size) - where TYuvFormat : IYuvFormat, new() + public static YUVTexture CreateYUVTexture(this Renderer renderer, TextureAccess access, Size size) + where TYUVFormat : IYUVFormat, new() { ArgumentNullException.ThrowIfNull(renderer); - return renderer.CreateYuvTexture(access, size.Width, size.Height); + return renderer.CreateYUVTexture(access, size.Width, size.Height); } - public static YuvTexture CreateYuvTexture(this Renderer renderer, TextureAccess access, int width, int height) - where TYuvFormat : IYuvFormat + public static YUVTexture CreateYUVTexture(this Renderer renderer, TextureAccess access, int width, int height) + where TYUVFormat : IYUVFormat { ArgumentNullException.ThrowIfNull(renderer); - var pixelFormat = TYuvFormat.PixelFormat; + var pixelFormat = TYUVFormat.PixelFormat; var texture = renderer.CreateTexture(pixelFormat, access, width, height); - return new YuvTexture(texture); + return new YUVTexture(texture); } - public static Nv12Texture CreateNv12Texture(this Renderer renderer, TextureAccess access, Size size) + public static NV12Texture CreateNV12Texture(this Renderer renderer, TextureAccess access, Size size) { ArgumentNullException.ThrowIfNull(renderer); - return renderer.CreateNv12Texture(access, size.Width, size.Height); + return renderer.CreateNV12Texture(access, size.Width, size.Height); } - public static Nv12Texture CreateNv12Texture(this Renderer renderer, TextureAccess access, int width, int height) + public static NV12Texture CreateNV12Texture(this Renderer renderer, TextureAccess access, int width, int height) { ArgumentNullException.ThrowIfNull(renderer); var pixelFormat = PixelFormat.NV12; var texture = renderer.CreateTexture(pixelFormat, access, width, height); - return new Nv12Texture(texture); + return new NV12Texture(texture); } - public static Nv21Texture CreateNv21Texture(this Renderer renderer, TextureAccess access, Size size) + public static NV21Texture CreateNV21Texture(this Renderer renderer, TextureAccess access, Size size) { ArgumentNullException.ThrowIfNull(renderer); - return renderer.CreateNv21Texture(access, size.Width, size.Height); + return renderer.CreateNV21Texture(access, size.Width, size.Height); } - public static Nv21Texture CreateNv21Texture(this Renderer renderer, TextureAccess access, int width, int height) + public static NV21Texture CreateNV21Texture(this Renderer renderer, TextureAccess access, int width, int height) { ArgumentNullException.ThrowIfNull(renderer); var pixelFormat = PixelFormat.NV21; var texture = renderer.CreateTexture(pixelFormat, access, width, height); - return new Nv21Texture(texture); + return new NV21Texture(texture); } public static PackedTexture CreateTextureFromSurface(this Renderer renderer, Surface surface) diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs index eb228011..1b5ed378 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -21,7 +21,7 @@ using System; using System.Collections.Generic; using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index 3bcf73c6..f8a41c05 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { @@ -31,40 +31,40 @@ public static PackedTexture AsPacked(this Texture te return new PackedTexture(texture); } - public static YuvTexture AsIYUV(this Texture texture) + public static YUVTexture AsIYUV(this Texture texture) { if (texture.Format != PixelFormat.IYUV) { throw new ArgumentException("Texture is not in IYUV color format.", nameof(texture)); } - return new YuvTexture(texture); + return new YUVTexture(texture); } - public static Nv12Texture AsNV12(this Texture texture) + public static NV12Texture AsNV12(this Texture texture) { if (texture.Format != PixelFormat.NV12) { throw new ArgumentException("Texture is not in NV12 color format.", nameof(texture)); } - return new Nv12Texture(texture); + return new NV12Texture(texture); } - public static Nv21Texture AsNV21(this Texture texture) + public static NV21Texture AsNV21(this Texture texture) { if (texture.Format != PixelFormat.NV21) { throw new ArgumentException("Texture is not in NV21 color format.", nameof(texture)); } - return new Nv21Texture(texture); + return new NV21Texture(texture); } - public static YuvTexture AsYV12(this Texture texture) + public static YUVTexture AsYV12(this Texture texture) { if (texture.Format != PixelFormat.YV12) { throw new ArgumentException("Texture is not in YV12 color format.", nameof(texture)); } - return new YuvTexture(texture); + return new YUVTexture(texture); } } } diff --git a/sources/SDL2Sharp/Video/YuvConversionMode.cs b/sources/SDL2Sharp/Video/YUVConversionMode.cs similarity index 97% rename from sources/SDL2Sharp/Video/YuvConversionMode.cs rename to sources/SDL2Sharp/Video/YUVConversionMode.cs index 0ef0d49f..9154960b 100644 --- a/sources/SDL2Sharp/Video/YuvConversionMode.cs +++ b/sources/SDL2Sharp/Video/YUVConversionMode.cs @@ -20,7 +20,7 @@ namespace SDL2Sharp.Video { - public enum YuvConversionMode + public enum YUVConversionMode { Jpeg = Interop.SDL_YUV_CONVERSION_MODE.SDL_YUV_CONVERSION_JPEG, Bt601 = Interop.SDL_YUV_CONVERSION_MODE.SDL_YUV_CONVERSION_BT601, diff --git a/sources/SDL2Sharp/Video/YuvImage.cs b/sources/SDL2Sharp/Video/YUVImage.cs similarity index 86% rename from sources/SDL2Sharp/Video/YuvImage.cs rename to sources/SDL2Sharp/Video/YUVImage.cs index d483ae30..e1e7aaf1 100644 --- a/sources/SDL2Sharp/Video/YuvImage.cs +++ b/sources/SDL2Sharp/Video/YUVImage.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public readonly ref struct YuvImage where TYuvFormat : IYuvFormat + public readonly ref struct YUVImage where TYUVFormat : IYUVFormat { private readonly ImagePlane _yPlane; @@ -50,7 +50,7 @@ public readonly int Height get => _yPlane.Height; } - public unsafe YuvImage(void* pixels, int width, int height, int pitch) + public unsafe YUVImage(void* pixels, int width, int height, int pitch) { if (height < 0) { @@ -76,9 +76,9 @@ public unsafe YuvImage(void* pixels, int width, int height, int pitch) "pitch cannot be less than zero"); } - _yPlane = TYuvFormat.CreateYPlane(pixels, width, height, pitch); - _uPlane = TYuvFormat.CreateUPlane(pixels, width, height, pitch); - _vPlane = TYuvFormat.CreateVPlane(pixels, width, height, pitch); + _yPlane = TYUVFormat.CreateYPlane(pixels, width, height, pitch); + _uPlane = TYUVFormat.CreateUPlane(pixels, width, height, pitch); + _vPlane = TYUVFormat.CreateVPlane(pixels, width, height, pitch); } } } diff --git a/sources/SDL2Sharp/Video/YuvMemoryImage.cs b/sources/SDL2Sharp/Video/YUVMemoryImage.cs similarity index 94% rename from sources/SDL2Sharp/Video/YuvMemoryImage.cs rename to sources/SDL2Sharp/Video/YUVMemoryImage.cs index 23dd1d75..5d6eaec3 100644 --- a/sources/SDL2Sharp/Video/YuvMemoryImage.cs +++ b/sources/SDL2Sharp/Video/YUVMemoryImage.cs @@ -20,11 +20,11 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public sealed class YuvMemoryImage + public sealed class YUVMemoryImage { private readonly ImageMemoryPlane _yPlane; @@ -50,7 +50,7 @@ public int Height get => _yPlane.Height; } - public YuvMemoryImage(int width, int height) + public YUVMemoryImage(int width, int height) { if (width < 0) { diff --git a/sources/SDL2Sharp/Video/YuvTexture.cs b/sources/SDL2Sharp/Video/YUVTexture.cs similarity index 87% rename from sources/SDL2Sharp/Video/YuvTexture.cs rename to sources/SDL2Sharp/Video/YUVTexture.cs index 7a75935b..41e09ecd 100644 --- a/sources/SDL2Sharp/Video/YuvTexture.cs +++ b/sources/SDL2Sharp/Video/YUVTexture.cs @@ -20,13 +20,13 @@ using System; using SDL2Sharp.Interop; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video { - public sealed unsafe partial class YuvTexture : IDisposable where TYuvFormat : IYuvFormat + public sealed unsafe partial class YUVTexture : IDisposable where TYUVFormat : IYUVFormat { - public delegate void LockCallback(YuvImage pixels); + public delegate void LockCallback(YUVImage pixels); private Texture _texture; @@ -47,12 +47,12 @@ public BlendMode BlendMode public bool IsValid => _texture.IsValid; - internal YuvTexture(Texture texture) + internal YUVTexture(Texture texture) { _texture = texture ?? throw new ArgumentNullException(nameof(texture)); } - ~YuvTexture() + ~YUVTexture() { Dispose(false); } @@ -91,12 +91,12 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); - var image = new YuvImage(pixels, width, height, pitch); + var image = new YUVImage(pixels, width, height, pitch); callback.Invoke(image); SDL.UnlockTexture(_texture.Handle); } - public void Update(YuvImage image) + public void Update(YUVImage image) { Error.ThrowLastErrorIfNegative( SDL.UpdateYUVTexture(_texture.Handle, null, @@ -107,7 +107,7 @@ public void Update(YuvImage image) ); } - public void Update(YuvMemoryImage image) + public void Update(YUVMemoryImage image) { Error.ThrowLastErrorIfNegative( SDL.UpdateYUVTexture(_texture.Handle, null, @@ -123,7 +123,7 @@ private void ThrowWhenDisposed() ObjectDisposedException.ThrowIf(_texture is null, this); } - public static implicit operator Texture(YuvTexture texture) + public static implicit operator Texture(YUVTexture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs b/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs index 3e063e2b..4d639374 100644 --- a/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs +++ b/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests.Colors @@ -29,7 +29,7 @@ public static class Argb2101010Tests public static void SelfEquality() { #pragma warning disable CS1718 // Comparison made to same variable - var color = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + var color = ARGB2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); Assert.True(color == color); Assert.False(color != color); #pragma warning restore CS1718 // Comparison made to same variable @@ -38,8 +38,8 @@ public static void SelfEquality() [Fact] public static void Equality() { - var a = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); - var b = Argb2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + var a = ARGB2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); + var b = ARGB2101010.FromRGBA(r: 63, g: 127, b: 191, a: 255); Assert.True(a == b); Assert.False(a != b); } diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/PackedTextureTests.cs index ce2f3bac..5a969c1b 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PackedTextureTests.cs @@ -20,7 +20,7 @@ using System; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -32,7 +32,7 @@ public static class PackedTextureTests [Fact] public static void WriteAndReadAbgr1555() => WriteAndRead ( - () => Abgr1555.FromRGBA( + () => ABGR1555.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -43,7 +43,7 @@ public static void WriteAndReadAbgr1555() => WriteAndRead [Fact] public static void WriteAndReadAbgr4444() => WriteAndRead ( - () => Abgr4444.FromRGBA( + () => ABGR4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -54,7 +54,7 @@ public static void WriteAndReadAbgr4444() => WriteAndRead [Fact] public static void WriteAndReadAbgr8888() => WriteAndRead ( - () => Abgr8888.FromRGBA( + () => ABGR8888.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -65,7 +65,7 @@ public static void WriteAndReadAbgr8888() => WriteAndRead [Fact] public static void WriteAndReadArgb1555() => WriteAndRead ( - () => Argb1555.FromRGBA( + () => ARGB1555.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -76,7 +76,7 @@ public static void WriteAndReadArgb1555() => WriteAndRead [Fact] public static void WriteAndReadArgb2101010() => WriteAndRead ( - () => Argb2101010.FromRGBA( + () => ARGB2101010.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -87,7 +87,7 @@ public static void WriteAndReadArgb2101010() => WriteAndRead [Fact] public static void WriteAndReadArgb4444() => WriteAndRead ( - () => Argb4444.FromRGBA( + () => ARGB4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -97,7 +97,7 @@ public static void WriteAndReadArgb4444() => WriteAndRead [Fact] public static void WriteAndReadArgb8888() => WriteAndRead( - () => Argb8888.FromRGBA( + () => ARGB8888.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -107,7 +107,7 @@ public static void WriteAndReadArgb8888() => WriteAndRead( [Fact] public static void WriteAndReadRgba8888() => WriteAndRead( - () => new Rgba8888( + () => new RGBA8888( a: (byte)_random.Next(0, 256), r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -117,7 +117,7 @@ public static void WriteAndReadRgba8888() => WriteAndRead( [Fact] public static void WriteAndReadBgr565() => WriteAndRead( - () => Bgr565.FromRGB( + () => BGR565.FromRGB( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256) @@ -126,7 +126,7 @@ public static void WriteAndReadBgr565() => WriteAndRead( [Fact] public static void WriteAndReadBgra4444() => WriteAndRead( - () => Bgra4444.FromRGBA( + () => BGRA4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -136,7 +136,7 @@ public static void WriteAndReadBgra4444() => WriteAndRead( [Fact] public static void WriteAndReadBgra5551() => WriteAndRead( - () => Bgra4444.FromRGBA( + () => BGRA4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256), @@ -146,7 +146,7 @@ public static void WriteAndReadBgra5551() => WriteAndRead( [Fact] public static void WriteAndReadBgra8888() => WriteAndRead( - () => new Bgra8888( + () => new BGRA8888( b: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), r: (byte)_random.Next(0, 256), @@ -165,7 +165,7 @@ public static void WriteAndReadBgra8888() => WriteAndRead( [Fact] public static void WriteAndReadRgb565() => WriteAndRead( - () => Rgb565.FromRGB( + () => RGB565.FromRGB( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), b: (byte)_random.Next(0, 256) diff --git a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs index c00d5ef8..e4ad097b 100644 --- a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/PlanarTextureTests.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -27,19 +27,19 @@ namespace SDL2Sharp.Tests public static class PlanarTextureTests { [Fact] - public static void WriteAndReadYV12() => WriteAndRead(); + public static void WriteAndReadYV12() => WriteAndRead(); [Fact] - public static void WriteAndReadIYUV() => WriteAndRead(); + public static void WriteAndReadIYUV() => WriteAndRead(); - private static void WriteAndRead() - where TYuvFormat : struct, IYuvFormat + private static void WriteAndRead() + where TYUVFormat : struct, IYUVFormat { using var mainSystem = new MainSystem(); using var videoSystem = new VideoSubsystem(); using var window = videoSystem.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); - using var texture = renderer.CreateYuvTexture(TextureAccess.Streaming, renderer.OutputSize); + using var texture = renderer.CreateYUVTexture(TextureAccess.Streaming, renderer.OutputSize); var y = new Y8(255); var u = new U8(128); diff --git a/tests/SDL2Sharp.Tests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/SurfaceTests.cs index c648a8e9..64f0c443 100644 --- a/tests/SDL2Sharp.Tests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/SurfaceTests.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -29,16 +29,16 @@ public sealed class SurfaceTests [Fact] public void CreateSurface() { - var color = new Argb8888(255, 255, 255, 255); + var color = new ARGB8888(255, 255, 255, 255); using var surface = new Surface(512, 512, PixelFormat.ARGB8888); - surface.WithLock(pixels => pixels.Fill(color)); + surface.WithLock(pixels => pixels.Fill(color)); } [Fact] public void CreateSurfaceOfArgb8888() { - var color = new Argb8888(255, 255, 255, 255); - using var surface = new Surface(512, 512); + var color = new ARGB8888(255, 255, 255, 255); + using var surface = new Surface(512, 512); surface.WithLock(pixels => pixels.Fill(color)); } } diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index e67af8cb..d907b9fb 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -20,7 +20,7 @@ using System; using SDL2Sharp.Video; -using SDL2Sharp.Video.Colors; +using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -33,8 +33,8 @@ public void CreateTextureOfArgb8888() WithRenderer(renderer => { using var texture = renderer.CreateTexture(PixelFormat.ARGB8888, TextureAccess.Streaming, renderer.OutputSize); - using var packedTexture = texture.AsPacked(); - var color = new Argb8888(255, 255, 255, 255); + using var packedTexture = texture.AsPacked(); + var color = new ARGB8888(255, 255, 255, 255); packedTexture.WithLock(pixels => pixels.Fill(color)); renderer.Copy(texture); renderer.Present(); From 55494abec7f14b97e18b9a5407ffec38a5943229 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 16 Aug 2024 13:40:49 +0200 Subject: [PATCH 47/62] Check format before wrapping texture. --- sources/SDL2Sharp/Video/NV12Texture.cs | 11 +++++++++-- sources/SDL2Sharp/Video/NV21Texture.cs | 9 ++++++++- sources/SDL2Sharp/Video/PackedTexture.cs | 4 +++- sources/SDL2Sharp/Video/Surface.cs | 2 ++ sources/SDL2Sharp/Video/Surface{T}.cs | 2 +- sources/SDL2Sharp/Video/TextureExtensions.cs | 17 ----------------- sources/SDL2Sharp/Video/YUVTexture.cs | 9 ++++++++- 7 files changed, 31 insertions(+), 23 deletions(-) diff --git a/sources/SDL2Sharp/Video/NV12Texture.cs b/sources/SDL2Sharp/Video/NV12Texture.cs index ca579472..60529189 100644 --- a/sources/SDL2Sharp/Video/NV12Texture.cs +++ b/sources/SDL2Sharp/Video/NV12Texture.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -48,7 +48,14 @@ public BlendMode BlendMode internal NV12Texture(Texture texture) { - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + ArgumentNullException.ThrowIfNull(texture); + + if (texture.Format != PixelFormat.NV12) + { + throw new ArgumentException("Texture is not in a NV12 format", nameof(texture)); + } + + _texture = texture; } ~NV12Texture() diff --git a/sources/SDL2Sharp/Video/NV21Texture.cs b/sources/SDL2Sharp/Video/NV21Texture.cs index 51dabb54..067a5138 100644 --- a/sources/SDL2Sharp/Video/NV21Texture.cs +++ b/sources/SDL2Sharp/Video/NV21Texture.cs @@ -48,7 +48,14 @@ public BlendMode BlendMode internal NV21Texture(Texture texture) { - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + ArgumentNullException.ThrowIfNull(texture); + + if (texture.Format != PixelFormat.NV21) + { + throw new ArgumentException("Texture is not in a NV21 format", nameof(texture)); + } + + _texture = texture; } ~NV21Texture() diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index 029e5356..b273a97e 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -57,12 +57,14 @@ public BlendMode BlendMode internal PackedTexture(Texture texture) { + ArgumentNullException.ThrowIfNull(texture); + if (!texture.Format.IsPacked()) { throw new ArgumentException("Texture is not in a packed color format.", nameof(texture)); } - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + _texture = texture; } ~PackedTexture() diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs index 062a8aac..ad92f1c1 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -39,6 +39,8 @@ public sealed unsafe class Surface : IDisposable public int Height => _handle->h; + public Size Size => new(Width, Height); + public int Pitch => _handle->pitch; private bool MustLock => (_handle->flags & SDL.SDL_RLEACCEL) != 0; diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs index 1b5ed378..0ca2140a 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -38,7 +38,7 @@ public sealed class Surface : IDisposable public int Pitch => _surface.Pitch; - public IEnumerable? Size { get; internal set; } + public Size Size => new(Width, Height); public Surface(int width, int height) : this(new Surface(width, height, TPackedPixel.Format)) diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index f8a41c05..034a3fbf 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -18,7 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using SDL2Sharp.Video.PixelFormats; namespace SDL2Sharp.Video @@ -33,37 +32,21 @@ public static PackedTexture AsPacked(this Texture te public static YUVTexture AsIYUV(this Texture texture) { - if (texture.Format != PixelFormat.IYUV) - { - throw new ArgumentException("Texture is not in IYUV color format.", nameof(texture)); - } return new YUVTexture(texture); } public static NV12Texture AsNV12(this Texture texture) { - if (texture.Format != PixelFormat.NV12) - { - throw new ArgumentException("Texture is not in NV12 color format.", nameof(texture)); - } return new NV12Texture(texture); } public static NV21Texture AsNV21(this Texture texture) { - if (texture.Format != PixelFormat.NV21) - { - throw new ArgumentException("Texture is not in NV21 color format.", nameof(texture)); - } return new NV21Texture(texture); } public static YUVTexture AsYV12(this Texture texture) { - if (texture.Format != PixelFormat.YV12) - { - throw new ArgumentException("Texture is not in YV12 color format.", nameof(texture)); - } return new YUVTexture(texture); } } diff --git a/sources/SDL2Sharp/Video/YUVTexture.cs b/sources/SDL2Sharp/Video/YUVTexture.cs index 41e09ecd..c4231d7a 100644 --- a/sources/SDL2Sharp/Video/YUVTexture.cs +++ b/sources/SDL2Sharp/Video/YUVTexture.cs @@ -49,7 +49,14 @@ public BlendMode BlendMode internal YUVTexture(Texture texture) { - _texture = texture ?? throw new ArgumentNullException(nameof(texture)); + ArgumentNullException.ThrowIfNull(texture); + + if (texture.Format != TYUVFormat.PixelFormat) + { + throw new ArgumentException($"Texture is not in a {TYUVFormat.PixelFormat} format", nameof(texture)); + } + + _texture = texture; } ~YUVTexture() From f536279d11e73bc0438a827b48ee94e0ec9d9282 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 16 Aug 2024 14:27:00 +0200 Subject: [PATCH 48/62] Fix method Surface.WithLock(SurfaceLockCallback callback). --- sources/SDL2Sharp/Video/Surface.cs | 13 ++++++------- sources/SDL2Sharp/Video/Surface{T}.cs | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/Video/Surface.cs index ad92f1c1..371e6ea8 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/Video/Surface.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Runtime.InteropServices; using SDL2Sharp.Internals; using SDL2Sharp.Interop; @@ -153,12 +152,12 @@ public void WithLock(SurfaceLockCallback callback) ); } - var bytesPerPixel = Marshal.SizeOf(); - var pitchInBytes = _handle->pitch; - var pitch = pitchInBytes / bytesPerPixel; - var pixels = new PackedImage(_handle->pixels, _handle->h, _handle->w, pitch); - - callback.Invoke(pixels); + callback.Invoke( + new PackedImage( + _handle->pixels, + _handle->w, + _handle->h, + _handle->pitch)); if (mustLock) { diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/Video/Surface{T}.cs index 0ca2140a..a2f21505 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/Video/Surface{T}.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using System.Collections.Generic; using SDL2Sharp.Interop; using SDL2Sharp.Video.PixelFormats; From b395fd60e36633ca0ff121ea7c5b8bf1da0bcf25 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 16 Aug 2024 22:13:07 +0200 Subject: [PATCH 49/62] Update package references. Note: Use CommunityToolkit.HighPerformance instead of Microsoft.Toolkit.HightPerformance because the latter been deprecated as it is legacy and no longer maintained. --- Directory.Build.targets | 5 +++-- samples/TunnelEffect/TunnelEffect.csproj | 4 ---- sources/SDL2Sharp/SDL2Sharp.csproj | 2 +- sources/SDL2Sharp/Video/ImageMemoryPlane.cs | 2 +- sources/SDL2Sharp/Video/PackedTexture.cs | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 4995884e..fe85c47b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -34,12 +34,13 @@ + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/samples/TunnelEffect/TunnelEffect.csproj b/samples/TunnelEffect/TunnelEffect.csproj index e40e39f7..26956d4a 100644 --- a/samples/TunnelEffect/TunnelEffect.csproj +++ b/samples/TunnelEffect/TunnelEffect.csproj @@ -20,10 +20,6 @@ - - - - diff --git a/sources/SDL2Sharp/SDL2Sharp.csproj b/sources/SDL2Sharp/SDL2Sharp.csproj index d8e6b882..54bbd439 100644 --- a/sources/SDL2Sharp/SDL2Sharp.csproj +++ b/sources/SDL2Sharp/SDL2Sharp.csproj @@ -1,7 +1,7 @@  - + diff --git a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs index ade5a256..bc2aab2a 100644 --- a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs +++ b/sources/SDL2Sharp/Video/ImageMemoryPlane.cs @@ -20,7 +20,7 @@ using System; using System.Runtime.InteropServices; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; namespace SDL2Sharp.Video { diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/Video/PackedTexture.cs index b273a97e..0b59c196 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/Video/PackedTexture.cs @@ -21,7 +21,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Microsoft.Toolkit.HighPerformance; +using CommunityToolkit.HighPerformance; using SDL2Sharp.Interop; using SDL2Sharp.Video.PixelFormats; From 3b1f9570c6fae4f272261401a33272e8a9d24fd3 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 19 Aug 2024 14:10:21 +0200 Subject: [PATCH 50/62] Set next-version to 0.4.0. --- GitVersion.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/GitVersion.yml b/GitVersion.yml index d43e1d22..2009e3d1 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,4 +1,5 @@ mode: ContinuousDeployment +next-version: 0.4.0 branches: {} ignore: sha: [] From 031e2b2c260a4025620e61cb54f7a2f28758f500 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 16 Aug 2024 22:18:52 +0200 Subject: [PATCH 51/62] Redesign application framework. --- sources/SDL2Sharp/Audio/AudioSubsystem.cs | 12 +--- sources/SDL2Sharp/Audio/IAudioSubsystem.cs | 35 ++++++++++ sources/SDL2Sharp/Fonts/FontSubsystem.cs | 2 +- sources/SDL2Sharp/Fonts/IFontSubsystem.cs | 27 ++++++++ sources/SDL2Sharp/Hosting/App.cs | 56 ++++++++++++++++ sources/SDL2Sharp/Hosting/AppBuilder.cs | 36 ++++++++++ .../SDL2Sharp/Hosting/AppBuilderExtensions.cs | 66 +++++++++++++++++++ sources/SDL2Sharp/IMainSystem.cs | 26 ++++++++ sources/SDL2Sharp/Input/EventSubsystem.cs | 6 +- sources/SDL2Sharp/Input/IEventSubsystem.cs | 32 +++++++++ sources/SDL2Sharp/MainSystem.cs | 2 +- sources/SDL2Sharp/SDL2Sharp.csproj | 1 + sources/SDL2Sharp/Video/IVideoSubsystem.cs | 37 +++++++++++ sources/SDL2Sharp/Video/VideoSubsystem.cs | 2 +- 14 files changed, 321 insertions(+), 19 deletions(-) create mode 100644 sources/SDL2Sharp/Audio/IAudioSubsystem.cs create mode 100644 sources/SDL2Sharp/Fonts/IFontSubsystem.cs create mode 100644 sources/SDL2Sharp/Hosting/App.cs create mode 100644 sources/SDL2Sharp/Hosting/AppBuilder.cs create mode 100644 sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs create mode 100644 sources/SDL2Sharp/IMainSystem.cs create mode 100644 sources/SDL2Sharp/Input/IEventSubsystem.cs create mode 100644 sources/SDL2Sharp/Video/IVideoSubsystem.cs diff --git a/sources/SDL2Sharp/Audio/AudioSubsystem.cs b/sources/SDL2Sharp/Audio/AudioSubsystem.cs index 221ffef7..308ae00f 100644 --- a/sources/SDL2Sharp/Audio/AudioSubsystem.cs +++ b/sources/SDL2Sharp/Audio/AudioSubsystem.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Audio { - public sealed class AudioSubsystem : IDisposable + public sealed class AudioSubsystem : IAudioSubsystem, IDisposable { private const uint InitSubsystemFlags = SDL.SDL_INIT_AUDIO; @@ -41,37 +41,27 @@ public void Dispose() SDL.QuitSubSystem(InitSubsystemFlags); } -#pragma warning disable CA1822 // Mark members as static public AudioDevice CreateDevice() -#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(); } -#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) -#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples); } -#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) -#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples, callback); } -#pragma warning disable CA1822 // Mark members as static public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) -#pragma warning restore CA1822 // Mark members as static { return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); } -#pragma warning disable CA1822 // Mark members as static public WaveFile OpenWaveFile(string filename) -#pragma warning restore CA1822 // Mark members as static { return new WaveFile(filename); } diff --git a/sources/SDL2Sharp/Audio/IAudioSubsystem.cs b/sources/SDL2Sharp/Audio/IAudioSubsystem.cs new file mode 100644 index 00000000..2182da1d --- /dev/null +++ b/sources/SDL2Sharp/Audio/IAudioSubsystem.cs @@ -0,0 +1,35 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Audio +{ + public interface IAudioSubsystem + { + AudioDevice CreateDevice(); + + AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples); + + AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback); + + AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges); + + WaveFile OpenWaveFile(string filename); + } +} diff --git a/sources/SDL2Sharp/Fonts/FontSubsystem.cs b/sources/SDL2Sharp/Fonts/FontSubsystem.cs index dc69dafd..c68a1661 100644 --- a/sources/SDL2Sharp/Fonts/FontSubsystem.cs +++ b/sources/SDL2Sharp/Fonts/FontSubsystem.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp.Fonts { - public sealed class FontSubsystem : IDisposable + public sealed class FontSubsystem : IFontSubsystem, IDisposable { public FontSubsystem() { diff --git a/sources/SDL2Sharp/Fonts/IFontSubsystem.cs b/sources/SDL2Sharp/Fonts/IFontSubsystem.cs new file mode 100644 index 00000000..581b05b5 --- /dev/null +++ b/sources/SDL2Sharp/Fonts/IFontSubsystem.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp.Fonts +{ + public interface IFontSubsystem + { + Font OpenFont(string path, int pointSize); + } +} \ No newline at end of file diff --git a/sources/SDL2Sharp/Hosting/App.cs b/sources/SDL2Sharp/Hosting/App.cs new file mode 100644 index 00000000..38c39234 --- /dev/null +++ b/sources/SDL2Sharp/Hosting/App.cs @@ -0,0 +1,56 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using Microsoft.Extensions.DependencyInjection; + +namespace SDL2Sharp.Hosting +{ + public sealed class App : IDisposable + { + private readonly ServiceProvider _services; + + private bool _disposed; + + public IServiceProvider Services => _services; + + internal App(ServiceProvider services) + { + _services = services ?? throw new ArgumentNullException(nameof(services)); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + try + { + _services.Dispose(); + } + finally + { + _disposed = true; + } + } + } +} diff --git a/sources/SDL2Sharp/Hosting/AppBuilder.cs b/sources/SDL2Sharp/Hosting/AppBuilder.cs new file mode 100644 index 00000000..cbb7a7bc --- /dev/null +++ b/sources/SDL2Sharp/Hosting/AppBuilder.cs @@ -0,0 +1,36 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using Microsoft.Extensions.DependencyInjection; + +namespace SDL2Sharp.Hosting +{ + public sealed class AppBuilder + { + private readonly ServiceCollection _services = new(); + + public IServiceCollection Services => _services; + + public App Build() + { + return new App(_services.BuildServiceProvider()); + } + } +} diff --git a/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs b/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs new file mode 100644 index 00000000..53a66fff --- /dev/null +++ b/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs @@ -0,0 +1,66 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using Microsoft.Extensions.DependencyInjection.Extensions; +using SDL2Sharp.Audio; +using SDL2Sharp.Fonts; +using SDL2Sharp.Input; +using SDL2Sharp.Video; + +namespace SDL2Sharp.Hosting +{ + public static class AppBuilderExtensions + { + public static AppBuilder UseMainSystem(this AppBuilder appBuilder) + { + appBuilder.Services.TryAddSingleton(); + return appBuilder; + } + + public static AppBuilder UseAudioSubsystem(this AppBuilder appBuilder) + { + appBuilder.Services.TryAddSingleton(); + appBuilder.Services.TryAddSingleton(); + return appBuilder; + } + + public static AppBuilder UseVideoSubsystem(this AppBuilder appBuilder) + { + appBuilder.Services.TryAddSingleton(); + appBuilder.Services.TryAddSingleton(); + appBuilder.Services.TryAddSingleton(); + return appBuilder; + } + + public static AppBuilder UseEventSubsystem(this AppBuilder appBuilder) + { + appBuilder.Services.TryAddSingleton(); + appBuilder.Services.TryAddSingleton(); + return appBuilder; + } + + public static AppBuilder UseFontSubsystem(this AppBuilder appBuilder) + { + appBuilder.Services.TryAddSingleton(); + appBuilder.Services.TryAddSingleton(); + return appBuilder; + } + } +} diff --git a/sources/SDL2Sharp/IMainSystem.cs b/sources/SDL2Sharp/IMainSystem.cs new file mode 100644 index 00000000..85c2d70c --- /dev/null +++ b/sources/SDL2Sharp/IMainSystem.cs @@ -0,0 +1,26 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp +{ + public interface IMainSystem + { + } +} diff --git a/sources/SDL2Sharp/Input/EventSubsystem.cs b/sources/SDL2Sharp/Input/EventSubsystem.cs index 45bf9680..c2fa0dff 100644 --- a/sources/SDL2Sharp/Input/EventSubsystem.cs +++ b/sources/SDL2Sharp/Input/EventSubsystem.cs @@ -26,7 +26,7 @@ namespace SDL2Sharp.Input { - public sealed unsafe class EventSubsystem : IDisposable + public sealed unsafe class EventSubsystem : IEventSubsystem, IDisposable { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int EventWatchCallbackDelegate(void* userdata, SDL_Event* @event); @@ -61,9 +61,7 @@ public void Dispose() SDL.QuitSubSystem(InitSubsystemFlags); } -#pragma warning disable CA1822 // Mark members as static public Event? PollEvent() -#pragma warning restore CA1822 // Mark members as static { var @event = new SDL_Event(); if (SDL.PollEvent(&@event) == 0) @@ -73,9 +71,7 @@ public void Dispose() return WrapEvent(@event); } -#pragma warning disable CA1822 // Mark members as static public void PushEvent(Event @event) -#pragma warning restore CA1822 // Mark members as static { var eventHandle = @event.Handle; var result = SDL.PushEvent(&@eventHandle); diff --git a/sources/SDL2Sharp/Input/IEventSubsystem.cs b/sources/SDL2Sharp/Input/IEventSubsystem.cs new file mode 100644 index 00000000..28a4728e --- /dev/null +++ b/sources/SDL2Sharp/Input/IEventSubsystem.cs @@ -0,0 +1,32 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp.Input +{ + public interface IEventSubsystem + { + void AddWatch(Action callback); + void DeleteWatch(Action callback); + Event? PollEvent(); + void PushEvent(Event @event); + } +} \ No newline at end of file diff --git a/sources/SDL2Sharp/MainSystem.cs b/sources/SDL2Sharp/MainSystem.cs index c0b6e206..61ee4799 100644 --- a/sources/SDL2Sharp/MainSystem.cs +++ b/sources/SDL2Sharp/MainSystem.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp { - public sealed class MainSystem : IDisposable + public sealed class MainSystem : IMainSystem, IDisposable { public MainSystem() { diff --git a/sources/SDL2Sharp/SDL2Sharp.csproj b/sources/SDL2Sharp/SDL2Sharp.csproj index 54bbd439..52b1d4dd 100644 --- a/sources/SDL2Sharp/SDL2Sharp.csproj +++ b/sources/SDL2Sharp/SDL2Sharp.csproj @@ -2,6 +2,7 @@ + diff --git a/sources/SDL2Sharp/Video/IVideoSubsystem.cs b/sources/SDL2Sharp/Video/IVideoSubsystem.cs new file mode 100644 index 00000000..de52d624 --- /dev/null +++ b/sources/SDL2Sharp/Video/IVideoSubsystem.cs @@ -0,0 +1,37 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System.Collections.Generic; + +namespace SDL2Sharp.Video +{ + public interface IVideoSubsystem + { + IReadOnlyList Displays { get; } + + Window CreateWindow(string title, int width, int height); + + Window CreateWindow(string title, int x, int y, int width, int height); + + Window CreateWindow(string title, int x, int y, int width, int height, WindowFlags flags); + + Window CreateWindow(string title, int width, int height, WindowFlags flags); + } +} diff --git a/sources/SDL2Sharp/Video/VideoSubsystem.cs b/sources/SDL2Sharp/Video/VideoSubsystem.cs index ee41a9ca..d861442b 100644 --- a/sources/SDL2Sharp/Video/VideoSubsystem.cs +++ b/sources/SDL2Sharp/Video/VideoSubsystem.cs @@ -24,7 +24,7 @@ namespace SDL2Sharp.Video { - public sealed class VideoSubsystem : IDisposable + public sealed class VideoSubsystem : IVideoSubsystem, IDisposable { private const uint InitSubsystemFlags = SDL.SDL_INIT_VIDEO; From 8d002c8049903a037bf944cc359ef0787157bf4d Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 19 Aug 2024 14:23:36 +0200 Subject: [PATCH 52/62] Replace specific methods for casting texture to YUV with generic method. --- sources/SDL2Sharp/Video/TextureExtensions.cs | 10 +++------- tests/SDL2Sharp.Tests/TextureTests.cs | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/Video/TextureExtensions.cs index 034a3fbf..be3aec79 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/Video/TextureExtensions.cs @@ -30,9 +30,10 @@ public static PackedTexture AsPacked(this Texture te return new PackedTexture(texture); } - public static YUVTexture AsIYUV(this Texture texture) + public static YUVTexture AsYUV(this Texture texture) + where TYUVFormat : IYUVFormat { - return new YUVTexture(texture); + return new YUVTexture(texture); } public static NV12Texture AsNV12(this Texture texture) @@ -44,10 +45,5 @@ public static NV21Texture AsNV21(this Texture texture) { return new NV21Texture(texture); } - - public static YUVTexture AsYV12(this Texture texture) - { - return new YUVTexture(texture); - } } } diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/TextureTests.cs index d907b9fb..ab866b13 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/TextureTests.cs @@ -47,7 +47,7 @@ public void CreateTextureOfIYUV() WithRenderer(renderer => { using var texture = renderer.CreateTexture(PixelFormat.IYUV, TextureAccess.Streaming, renderer.OutputSize); - using var planarTexture = texture.AsIYUV(); + using var planarTexture = texture.AsYUV(); var y = new Y8(255); var u = new U8(128); var v = new V8(128); @@ -106,7 +106,7 @@ public void CreateTextureOfYV12() WithRenderer(renderer => { using var texture = renderer.CreateTexture(PixelFormat.YV12, TextureAccess.Streaming, renderer.OutputSize); - using var planarTexture = texture.AsYV12(); + using var planarTexture = texture.AsYUV(); var y = new Y8(255); var u = new U8(128); var v = new V8(128); From 9c849691cbb33eb2b3cf87b1107b2016d09adf6d Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 7 Feb 2025 08:22:15 +0100 Subject: [PATCH 53/62] Upgrade Nuke to v9.0.4 and only support .NET 8.0. --- .github/workflows/release.yml | 14 +- .github/workflows/test-ubuntu.yml | 12 +- .github/workflows/test-windows.yml | 12 +- .nuke/build.schema.json | 138 +- .vscode/launch.json | 18 +- Directory.Build.props | 10 - Directory.Build.targets | 10 +- Directory.Packages.props | 24 + build.ps1 | 7 +- build.sh | 18 +- build/Build/Build.csproj | 2 +- .../ClangSharpPInvokeGenerator.Generated.cs | 3350 ++++------------- .../Build/ClangSharpPInvokeGeneratorTasks.cs | 16 - build/Build/IGenerate.cs | 70 +- build/Build/IRelease.cs | 4 +- build/Build/IRestore.cs | 15 +- build/Build/ISetup.cs | 117 +- build/Build/ITest.cs | 2 +- build/Build/Linux.cs | 136 - .../Build/ToolOptionsExtensions.cs | 23 +- global.json | 6 + nuget.config | 8 + samples/TunnelEffect/TunnelEffect.csproj | 4 + .../SDL2Sharp.Interop.csproj | 38 +- .../codegen/{compatible => }/ID3D11Device.cs | 0 .../codegen/{compatible => }/ID3D12Device.cs | 0 .../{compatible => }/IDirect3DDevice9.cs | 0 .../codegen/{compatible => }/IMG.cs | 0 .../codegen/{compatible => }/IMG_Animation.cs | 0 .../codegen/{compatible => }/IMG_InitFlags.cs | 0 .../codegen/{latest => }/SDL.cs | 2 +- .../{compatible => }/SDL_ArrayOrder.cs | 0 .../codegen/{default => }/SDL_AudioCVT.cs | 0 .../{compatible => }/SDL_AudioDeviceEvent.cs | 0 .../codegen/{default => }/SDL_AudioSpec.cs | 0 .../{compatible => }/SDL_AudioStatus.cs | 0 .../{compatible => }/SDL_BitmapOrder.cs | 0 .../{compatible => }/SDL_BlendFactor.cs | 0 .../codegen/{compatible => }/SDL_BlendMode.cs | 0 .../{compatible => }/SDL_BlendOperation.cs | 0 .../codegen/{compatible => }/SDL_BlitMap.cs | 0 .../codegen/{compatible => }/SDL_Color.cs | 0 .../{compatible => }/SDL_CommonEvent.cs | 0 .../SDL_ControllerAxisEvent.cs | 0 .../SDL_ControllerButtonEvent.cs | 0 .../SDL_ControllerDeviceEvent.cs | 0 .../{latest => }/SDL_ControllerSensorEvent.cs | 0 .../SDL_ControllerTouchpadEvent.cs | 0 .../codegen/{compatible => }/SDL_Cursor.cs | 0 .../{compatible => }/SDL_DUMMY_ENUM.cs | 0 .../{compatible => }/SDL_DisplayEvent.cs | 0 .../{compatible => }/SDL_DisplayEventID.cs | 0 .../{compatible => }/SDL_DisplayMode.cs | 0 .../SDL_DisplayOrientation.cs | 0 .../SDL_DollarGestureEvent.cs | 0 .../codegen/{compatible => }/SDL_DropEvent.cs | 0 .../codegen/{latest => }/SDL_Event.cs | 0 .../codegen/{compatible => }/SDL_EventType.cs | 0 .../codegen/{compatible => }/SDL_FPoint.cs | 0 .../codegen/{compatible => }/SDL_FRect.cs | 0 .../{compatible => }/SDL_FlashOperation.cs | 0 .../SDL_GLContextResetNotification.cs | 0 .../codegen/{compatible => }/SDL_GLattr.cs | 0 .../{compatible => }/SDL_GLcontextFlag.cs | 0 .../SDL_GLcontextReleaseFlag.cs | 0 .../codegen/{compatible => }/SDL_GLprofile.cs | 0 .../codegen/{latest => }/SDL_GUID.cs | 0 .../{compatible => }/SDL_HintPriority.cs | 0 .../{compatible => }/SDL_HitTestResult.cs | 0 .../{compatible => }/SDL_JoyAxisEvent.cs | 0 .../{compatible => }/SDL_JoyBallEvent.cs | 0 .../{compatible => }/SDL_JoyBatteryEvent.cs | 0 .../{compatible => }/SDL_JoyButtonEvent.cs | 0 .../{compatible => }/SDL_JoyDeviceEvent.cs | 0 .../{compatible => }/SDL_JoyHatEvent.cs | 0 .../SDL_JoystickPowerLevel.cs | 0 .../{compatible => }/SDL_JoystickType.cs | 0 .../codegen/{compatible => }/SDL_KeyCode.cs | 0 .../{compatible => }/SDL_KeyboardEvent.cs | 0 .../codegen/{compatible => }/SDL_Keymod.cs | 0 .../codegen/{compatible => }/SDL_Keysym.cs | 0 .../{compatible => }/SDL_LogCategory.cs | 0 .../{compatible => }/SDL_LogPriority.cs | 0 .../{compatible => }/SDL_MouseButtonEvent.cs | 0 .../{compatible => }/SDL_MouseMotionEvent.cs | 0 .../SDL_MouseWheelDirection.cs | 0 .../{compatible => }/SDL_MouseWheelEvent.cs | 0 .../{compatible => }/SDL_MultiGestureEvent.cs | 0 .../codegen/{compatible => }/SDL_OSEvent.cs | 0 .../{compatible => }/SDL_PackedLayout.cs | 0 .../{compatible => }/SDL_PackedOrder.cs | 0 .../codegen/{compatible => }/SDL_Palette.cs | 0 .../codegen/{latest => }/SDL_PixelFormat.cs | 0 .../{compatible => }/SDL_PixelFormatEnum.cs | 0 .../codegen/{compatible => }/SDL_PixelType.cs | 0 .../codegen/{compatible => }/SDL_Point.cs | 0 .../codegen/{compatible => }/SDL_QuitEvent.cs | 0 .../codegen/{default => }/SDL_RWops.cs | 0 .../codegen/{compatible => }/SDL_Rect.cs | 0 .../codegen/{compatible => }/SDL_Renderer.cs | 0 .../{compatible => }/SDL_RendererFlags.cs | 0 .../{compatible => }/SDL_RendererFlip.cs | 0 .../codegen/{latest => }/SDL_RendererInfo.cs | 0 .../codegen/{compatible => }/SDL_ScaleMode.cs | 0 .../codegen/{compatible => }/SDL_Scancode.cs | 0 .../codegen/{latest => }/SDL_SensorEvent.cs | 0 .../codegen/{compatible => }/SDL_Surface.cs | 0 .../{compatible => }/SDL_SysWMEvent.cs | 0 .../codegen/{compatible => }/SDL_SysWMmsg.cs | 0 .../{compatible => }/SDL_SystemCursor.cs | 0 .../{latest => }/SDL_TextEditingEvent.cs | 0 .../SDL_TextEditingExtEvent.cs | 0 .../{latest => }/SDL_TextInputEvent.cs | 0 .../codegen/{compatible => }/SDL_Texture.cs | 0 .../{compatible => }/SDL_TextureAccess.cs | 0 .../{compatible => }/SDL_TextureModulate.cs | 0 .../{compatible => }/SDL_TouchFingerEvent.cs | 0 .../codegen/{compatible => }/SDL_UserEvent.cs | 0 .../codegen/{compatible => }/SDL_Vertex.cs | 0 .../{default => }/SDL_VirtualJoystickDesc.cs | 0 .../codegen/{compatible => }/SDL_Window.cs | 0 .../{compatible => }/SDL_WindowEvent.cs | 0 .../{compatible => }/SDL_WindowEventID.cs | 0 .../{compatible => }/SDL_WindowFlags.cs | 0 .../SDL_YUV_CONVERSION_MODE.cs | 0 .../codegen/{compatible => }/SDL_bool.cs | 0 .../codegen/{compatible => }/SDL_errorcode.cs | 0 .../{compatible => }/SDL_eventaction.cs | 0 .../codegen/{compatible => }/SDL_version.cs | 0 .../codegen/{compatible => }/TTF.cs | 0 .../codegen/{compatible => }/TTF_Direction.cs | 0 .../{compatible => }/_SDL_AudioStream.cs | 0 .../codegen/{compatible => }/_SDL_Joystick.cs | 0 .../codegen/{compatible => }/_SDL_iconv_t.cs | 0 .../codegen/{compatible => }/_TTF_Font.cs | 0 .../codegen/compatible/SDL.cs | 2387 ------------ .../codegen/compatible/SDL_AudioCVT.cs | 80 - .../codegen/compatible/SDL_AudioCallback.cs | 27 - .../codegen/compatible/SDL_AudioFilter.cs | 27 - .../codegen/compatible/SDL_AudioSpec.cs | 52 - .../compatible/SDL_ControllerSensorEvent.cs | 43 - .../codegen/compatible/SDL_Event.cs | 126 - .../codegen/compatible/SDL_EventFilter.cs | 27 - .../codegen/compatible/SDL_GUID.cs | 28 - .../codegen/compatible/SDL_HintCallback.cs | 27 - .../codegen/compatible/SDL_HitTest.cs | 27 - .../compatible/SDL_LogOutputFunction.cs | 27 - .../codegen/compatible/SDL_PixelFormat.cs | 80 - .../codegen/compatible/SDL_RWops.cs | 105 - .../codegen/compatible/SDL_RendererInfo.cs | 41 - .../codegen/compatible/SDL_SensorEvent.cs | 40 - .../compatible/SDL_TextEditingEvent.cs | 43 - .../codegen/compatible/SDL_TextInputEvent.cs | 37 - .../compatible/SDL_VirtualJoystickDesc.cs | 80 - .../compatible/SDL_WindowsMessageHook.cs | 27 - .../codegen/compatible/SDL_blit.cs | 27 - .../codegen/compatible/SDL_calloc_func.cs | 28 - .../codegen/compatible/SDL_free_func.cs | 27 - .../codegen/compatible/SDL_malloc_func.cs | 28 - .../codegen/compatible/SDL_realloc_func.cs | 28 - .../codegen/default/ID3D11Device.cs | 26 - .../codegen/default/ID3D12Device.cs | 26 - .../codegen/default/IDirect3DDevice9.cs | 26 - .../SDL2Sharp.Interop/codegen/default/IMG.cs | 214 -- .../codegen/default/IMG_InitFlags.cs | 32 - .../SDL2Sharp.Interop/codegen/default/SDL.cs | 2387 ------------ .../codegen/default/SDL_ArrayOrder.cs | 33 - .../codegen/default/SDL_AudioDeviceEvent.cs | 46 - .../codegen/default/SDL_AudioStatus.cs | 29 - .../codegen/default/SDL_BitmapOrder.cs | 29 - .../codegen/default/SDL_BlendFactor.cs | 36 - .../codegen/default/SDL_BlendMode.cs | 32 - .../codegen/default/SDL_BlendOperation.cs | 31 - .../codegen/default/SDL_BlitMap.cs | 26 - .../codegen/default/SDL_Color.cs | 37 - .../codegen/default/SDL_CommonEvent.cs | 31 - .../default/SDL_ControllerAxisEvent.cs | 52 - .../default/SDL_ControllerButtonEvent.cs | 46 - .../default/SDL_ControllerDeviceEvent.cs | 34 - .../default/SDL_ControllerSensorEvent.cs | 43 - .../default/SDL_ControllerTouchpadEvent.cs | 46 - .../codegen/default/SDL_Cursor.cs | 26 - .../codegen/default/SDL_DUMMY_ENUM.cs | 27 - .../codegen/default/SDL_DisplayEvent.cs | 49 - .../codegen/default/SDL_DisplayEventID.cs | 31 - .../codegen/default/SDL_DisplayMode.cs | 36 - .../codegen/default/SDL_DisplayOrientation.cs | 31 - .../codegen/default/SDL_DollarGestureEvent.cs | 46 - .../codegen/default/SDL_DropEvent.cs | 37 - .../codegen/default/SDL_Event.cs | 126 - .../codegen/default/SDL_EventType.cs | 86 - .../codegen/default/SDL_FPoint.cs | 29 - .../codegen/default/SDL_FRect.cs | 33 - .../codegen/default/SDL_FlashOperation.cs | 29 - .../default/SDL_GLContextResetNotification.cs | 28 - .../codegen/default/SDL_GLattr.cs | 54 - .../codegen/default/SDL_GLcontextFlag.cs | 30 - .../default/SDL_GLcontextReleaseFlag.cs | 28 - .../codegen/default/SDL_GLprofile.cs | 29 - .../codegen/default/SDL_GUID.cs | 28 - .../codegen/default/SDL_HintPriority.cs | 29 - .../codegen/default/SDL_HitTestResult.cs | 36 - .../codegen/default/SDL_JoyAxisEvent.cs | 52 - .../codegen/default/SDL_JoyBallEvent.cs | 52 - .../codegen/default/SDL_JoyBatteryEvent.cs | 36 - .../codegen/default/SDL_JoyButtonEvent.cs | 46 - .../codegen/default/SDL_JoyDeviceEvent.cs | 34 - .../codegen/default/SDL_JoyHatEvent.cs | 46 - .../codegen/default/SDL_JoystickPowerLevel.cs | 33 - .../codegen/default/SDL_JoystickType.cs | 36 - .../codegen/default/SDL_KeyCode.cs | 272 -- .../codegen/default/SDL_KeyboardEvent.cs | 48 - .../codegen/default/SDL_Keymod.cs | 44 - .../codegen/default/SDL_Keysym.cs | 36 - .../codegen/default/SDL_LogCategory.cs | 46 - .../codegen/default/SDL_LogPriority.cs | 33 - .../codegen/default/SDL_MouseButtonEvent.cs | 55 - .../codegen/default/SDL_MouseMotionEvent.cs | 52 - .../default/SDL_MouseWheelDirection.cs | 28 - .../codegen/default/SDL_MouseWheelEvent.cs | 56 - .../codegen/default/SDL_MultiGestureEvent.cs | 48 - .../codegen/default/SDL_OSEvent.cs | 31 - .../codegen/default/SDL_PackedLayout.cs | 35 - .../codegen/default/SDL_PackedOrder.cs | 35 - .../codegen/default/SDL_Palette.cs | 34 - .../codegen/default/SDL_PixelFormat.cs | 80 - .../codegen/default/SDL_PixelFormatEnum.cs | 83 - .../codegen/default/SDL_PixelType.cs | 38 - .../codegen/default/SDL_Point.cs | 29 - .../codegen/default/SDL_QuitEvent.cs | 31 - .../codegen/default/SDL_Rect.cs | 33 - .../codegen/default/SDL_Renderer.cs | 26 - .../codegen/default/SDL_RendererFlags.cs | 31 - .../codegen/default/SDL_RendererFlip.cs | 29 - .../codegen/default/SDL_RendererInfo.cs | 41 - .../codegen/default/SDL_ScaleMode.cs | 29 - .../codegen/default/SDL_Scancode.cs | 274 -- .../codegen/default/SDL_SensorEvent.cs | 40 - .../codegen/default/SDL_Surface.cs | 50 - .../codegen/default/SDL_SysWMEvent.cs | 33 - .../codegen/default/SDL_SysWMmsg.cs | 26 - .../codegen/default/SDL_SystemCursor.cs | 39 - .../codegen/default/SDL_TextEditingEvent.cs | 43 - .../default/SDL_TextEditingExtEvent.cs | 43 - .../codegen/default/SDL_TextInputEvent.cs | 37 - .../codegen/default/SDL_Texture.cs | 26 - .../codegen/default/SDL_TextureAccess.cs | 29 - .../codegen/default/SDL_TextureModulate.cs | 29 - .../codegen/default/SDL_TouchFingerEvent.cs | 50 - .../codegen/default/SDL_UserEvent.cs | 41 - .../codegen/default/SDL_Vertex.cs | 31 - .../codegen/default/SDL_Window.cs | 26 - .../codegen/default/SDL_WindowEvent.cs | 52 - .../codegen/default/SDL_WindowEventID.cs | 45 - .../codegen/default/SDL_WindowFlags.cs | 50 - .../default/SDL_YUV_CONVERSION_MODE.cs | 30 - .../codegen/default/SDL_bool.cs | 28 - .../codegen/default/SDL_errorcode.cs | 32 - .../codegen/default/SDL_eventaction.cs | 29 - .../codegen/default/SDL_version.cs | 34 - .../SDL2Sharp.Interop/codegen/default/TTF.cs | 366 -- .../codegen/default/TTF_Direction.cs | 30 - .../codegen/default/_SDL_AudioStream.cs | 26 - .../codegen/default/_SDL_Joystick.cs | 26 - .../codegen/default/_SDL_iconv_t.cs | 26 - .../codegen/default/_TTF_Font.cs | 26 - .../codegen/latest/ID3D11Device.cs | 26 - .../codegen/latest/ID3D12Device.cs | 26 - .../codegen/latest/IDirect3DDevice9.cs | 26 - .../SDL2Sharp.Interop/codegen/latest/IMG.cs | 214 -- .../codegen/latest/IMG_Animation.cs | 35 - .../codegen/latest/IMG_InitFlags.cs | 32 - .../codegen/latest/SDL_ArrayOrder.cs | 33 - .../codegen/latest/SDL_AudioCVT.cs | 79 - .../codegen/latest/SDL_AudioCallback.cs | 27 - .../codegen/latest/SDL_AudioDeviceEvent.cs | 46 - .../codegen/latest/SDL_AudioFilter.cs | 27 - .../codegen/latest/SDL_AudioSpec.cs | 50 - .../codegen/latest/SDL_AudioStatus.cs | 29 - .../codegen/latest/SDL_BitmapOrder.cs | 29 - .../codegen/latest/SDL_BlendFactor.cs | 36 - .../codegen/latest/SDL_BlendMode.cs | 32 - .../codegen/latest/SDL_BlendOperation.cs | 31 - .../codegen/latest/SDL_BlitMap.cs | 26 - .../codegen/latest/SDL_Color.cs | 37 - .../codegen/latest/SDL_CommonEvent.cs | 31 - .../codegen/latest/SDL_ControllerAxisEvent.cs | 52 - .../latest/SDL_ControllerButtonEvent.cs | 46 - .../latest/SDL_ControllerDeviceEvent.cs | 34 - .../latest/SDL_ControllerTouchpadEvent.cs | 46 - .../codegen/latest/SDL_Cursor.cs | 26 - .../codegen/latest/SDL_DUMMY_ENUM.cs | 27 - .../codegen/latest/SDL_DisplayEvent.cs | 49 - .../codegen/latest/SDL_DisplayEventID.cs | 31 - .../codegen/latest/SDL_DisplayMode.cs | 36 - .../codegen/latest/SDL_DisplayOrientation.cs | 31 - .../codegen/latest/SDL_DollarGestureEvent.cs | 46 - .../codegen/latest/SDL_DropEvent.cs | 37 - .../codegen/latest/SDL_EventFilter.cs | 27 - .../codegen/latest/SDL_EventType.cs | 86 - .../codegen/latest/SDL_FPoint.cs | 29 - .../codegen/latest/SDL_FRect.cs | 33 - .../codegen/latest/SDL_FlashOperation.cs | 29 - .../latest/SDL_GLContextResetNotification.cs | 28 - .../codegen/latest/SDL_GLattr.cs | 54 - .../codegen/latest/SDL_GLcontextFlag.cs | 30 - .../latest/SDL_GLcontextReleaseFlag.cs | 28 - .../codegen/latest/SDL_GLprofile.cs | 29 - .../codegen/latest/SDL_HintCallback.cs | 27 - .../codegen/latest/SDL_HintPriority.cs | 29 - .../codegen/latest/SDL_HitTest.cs | 27 - .../codegen/latest/SDL_HitTestResult.cs | 36 - .../codegen/latest/SDL_JoyAxisEvent.cs | 52 - .../codegen/latest/SDL_JoyBallEvent.cs | 52 - .../codegen/latest/SDL_JoyBatteryEvent.cs | 36 - .../codegen/latest/SDL_JoyButtonEvent.cs | 46 - .../codegen/latest/SDL_JoyDeviceEvent.cs | 34 - .../codegen/latest/SDL_JoyHatEvent.cs | 46 - .../codegen/latest/SDL_JoystickPowerLevel.cs | 33 - .../codegen/latest/SDL_JoystickType.cs | 36 - .../codegen/latest/SDL_KeyCode.cs | 272 -- .../codegen/latest/SDL_KeyboardEvent.cs | 48 - .../codegen/latest/SDL_Keymod.cs | 44 - .../codegen/latest/SDL_Keysym.cs | 36 - .../codegen/latest/SDL_LogCategory.cs | 46 - .../codegen/latest/SDL_LogOutputFunction.cs | 27 - .../codegen/latest/SDL_LogPriority.cs | 33 - .../codegen/latest/SDL_MouseButtonEvent.cs | 55 - .../codegen/latest/SDL_MouseMotionEvent.cs | 52 - .../codegen/latest/SDL_MouseWheelDirection.cs | 28 - .../codegen/latest/SDL_MouseWheelEvent.cs | 56 - .../codegen/latest/SDL_MultiGestureEvent.cs | 48 - .../codegen/latest/SDL_OSEvent.cs | 31 - .../codegen/latest/SDL_PackedLayout.cs | 35 - .../codegen/latest/SDL_PackedOrder.cs | 35 - .../codegen/latest/SDL_Palette.cs | 34 - .../codegen/latest/SDL_PixelFormatEnum.cs | 83 - .../codegen/latest/SDL_PixelType.cs | 38 - .../codegen/latest/SDL_Point.cs | 29 - .../codegen/latest/SDL_QuitEvent.cs | 31 - .../codegen/latest/SDL_RWops.cs | 104 - .../codegen/latest/SDL_Rect.cs | 33 - .../codegen/latest/SDL_Renderer.cs | 26 - .../codegen/latest/SDL_RendererFlags.cs | 31 - .../codegen/latest/SDL_RendererFlip.cs | 29 - .../codegen/latest/SDL_ScaleMode.cs | 29 - .../codegen/latest/SDL_Scancode.cs | 274 -- .../codegen/latest/SDL_Surface.cs | 50 - .../codegen/latest/SDL_SysWMEvent.cs | 33 - .../codegen/latest/SDL_SysWMmsg.cs | 26 - .../codegen/latest/SDL_SystemCursor.cs | 39 - .../codegen/latest/SDL_TextEditingExtEvent.cs | 43 - .../codegen/latest/SDL_Texture.cs | 26 - .../codegen/latest/SDL_TextureAccess.cs | 29 - .../codegen/latest/SDL_TextureModulate.cs | 29 - .../codegen/latest/SDL_TouchFingerEvent.cs | 50 - .../codegen/latest/SDL_UserEvent.cs | 41 - .../codegen/latest/SDL_Vertex.cs | 31 - .../codegen/latest/SDL_VirtualJoystickDesc.cs | 78 - .../codegen/latest/SDL_Window.cs | 26 - .../codegen/latest/SDL_WindowEvent.cs | 52 - .../codegen/latest/SDL_WindowEventID.cs | 45 - .../codegen/latest/SDL_WindowFlags.cs | 50 - .../codegen/latest/SDL_WindowsMessageHook.cs | 27 - .../codegen/latest/SDL_YUV_CONVERSION_MODE.cs | 30 - .../codegen/latest/SDL_blit.cs | 27 - .../codegen/latest/SDL_bool.cs | 28 - .../codegen/latest/SDL_calloc_func.cs | 28 - .../codegen/latest/SDL_errorcode.cs | 32 - .../codegen/latest/SDL_eventaction.cs | 29 - .../codegen/latest/SDL_free_func.cs | 27 - .../codegen/latest/SDL_malloc_func.cs | 28 - .../codegen/latest/SDL_realloc_func.cs | 28 - .../codegen/latest/SDL_version.cs | 34 - .../SDL2Sharp.Interop/codegen/latest/TTF.cs | 366 -- .../codegen/latest/TTF_Direction.cs | 30 - .../codegen/latest/_SDL_AudioStream.cs | 26 - .../codegen/latest/_SDL_Joystick.cs | 26 - .../codegen/latest/_SDL_iconv_t.cs | 26 - .../codegen/latest/_TTF_Font.cs | 26 - sources/SDL2Sharp/SDL2Sharp.csproj | 18 +- tests/Directory.Build.props | 10 +- .../SDL2Sharp.Interop.Tests.csproj | 30 +- .../{compatible => }/ID3D11DeviceTests.cs | 0 .../{compatible => }/ID3D12DeviceTests.cs | 0 .../{compatible => }/IDirect3DDevice9Tests.cs | 0 .../{compatible => }/IMG_AnimationTests.cs | 0 .../{compatible => }/SDL_AudioCVTTests.cs | 0 .../SDL_AudioDeviceEventTests.cs | 0 .../{compatible => }/SDL_AudioSpecTests.cs | 0 .../{compatible => }/SDL_BlitMapTests.cs | 0 .../{compatible => }/SDL_ColorTests.cs | 0 .../{compatible => }/SDL_CommonEventTests.cs | 0 .../SDL_ControllerAxisEventTests.cs | 0 .../SDL_ControllerButtonEventTests.cs | 0 .../SDL_ControllerDeviceEventTests.cs | 0 .../SDL_ControllerSensorEventTests.cs | 0 .../SDL_ControllerTouchpadEventTests.cs | 0 .../{compatible => }/SDL_CursorTests.cs | 0 .../{compatible => }/SDL_DisplayEventTests.cs | 0 .../{compatible => }/SDL_DisplayModeTests.cs | 0 .../SDL_DollarGestureEventTests.cs | 0 .../{compatible => }/SDL_DropEventTests.cs | 0 .../{compatible => }/SDL_EventTests.cs | 0 .../{compatible => }/SDL_FPointTests.cs | 0 .../{compatible => }/SDL_FRectTests.cs | 0 .../codegen/{compatible => }/SDL_GUIDTests.cs | 0 .../{compatible => }/SDL_JoyAxisEventTests.cs | 0 .../{compatible => }/SDL_JoyBallEventTests.cs | 0 .../SDL_JoyBatteryEventTests.cs | 0 .../SDL_JoyButtonEventTests.cs | 0 .../SDL_JoyDeviceEventTests.cs | 0 .../{compatible => }/SDL_JoyHatEventTests.cs | 0 .../SDL_KeyboardEventTests.cs | 0 .../{compatible => }/SDL_KeysymTests.cs | 0 .../SDL_MouseButtonEventTests.cs | 0 .../SDL_MouseMotionEventTests.cs | 0 .../SDL_MouseWheelEventTests.cs | 0 .../SDL_MultiGestureEventTests.cs | 0 .../{compatible => }/SDL_OSEventTests.cs | 0 .../{compatible => }/SDL_PaletteTests.cs | 0 .../{compatible => }/SDL_PixelFormatTests.cs | 0 .../{compatible => }/SDL_PointTests.cs | 0 .../{compatible => }/SDL_QuitEventTests.cs | 0 .../{compatible => }/SDL_RWopsTests.cs | 0 .../codegen/{compatible => }/SDL_RectTests.cs | 0 .../{compatible => }/SDL_RendererInfoTests.cs | 0 .../{compatible => }/SDL_RendererTests.cs | 0 .../{compatible => }/SDL_SensorEventTests.cs | 0 .../{compatible => }/SDL_SurfaceTests.cs | 0 .../{compatible => }/SDL_SysWMEventTests.cs | 0 .../{compatible => }/SDL_SysWMmsgTests.cs | 0 .../SDL_TextEditingEventTests.cs | 0 .../SDL_TextEditingExtEventTests.cs | 0 .../SDL_TextInputEventTests.cs | 0 .../{compatible => }/SDL_TextureTests.cs | 0 .../SDL_TouchFingerEventTests.cs | 0 .../{compatible => }/SDL_UserEventTests.cs | 0 .../{compatible => }/SDL_VertexTests.cs | 0 .../SDL_VirtualJoystickDescTests.cs | 0 .../{compatible => }/SDL_WindowEventTests.cs | 0 .../{compatible => }/SDL_WindowTests.cs | 0 .../{compatible => }/SDL_versionTests.cs | 0 .../{compatible => }/_SDL_AudioStreamTests.cs | 0 .../{compatible => }/_SDL_JoystickTests.cs | 0 .../{compatible => }/_SDL_iconv_tTests.cs | 0 .../{compatible => }/_TTF_FontTests.cs | 0 .../codegen/default/ID3D11DeviceTests.cs | 50 - .../codegen/default/ID3D12DeviceTests.cs | 50 - .../codegen/default/IDirect3DDevice9Tests.cs | 50 - .../codegen/default/IMG_AnimationTests.cs | 58 - .../codegen/default/SDL_AudioCVTTests.cs | 58 - .../default/SDL_AudioDeviceEventTests.cs | 50 - .../codegen/default/SDL_AudioSpecTests.cs | 58 - .../codegen/default/SDL_BlitMapTests.cs | 50 - .../codegen/default/SDL_ColorTests.cs | 50 - .../codegen/default/SDL_CommonEventTests.cs | 50 - .../default/SDL_ControllerAxisEventTests.cs | 50 - .../default/SDL_ControllerButtonEventTests.cs | 50 - .../default/SDL_ControllerDeviceEventTests.cs | 50 - .../default/SDL_ControllerSensorEventTests.cs | 50 - .../SDL_ControllerTouchpadEventTests.cs | 50 - .../codegen/default/SDL_CursorTests.cs | 50 - .../codegen/default/SDL_DisplayEventTests.cs | 50 - .../codegen/default/SDL_DisplayModeTests.cs | 58 - .../default/SDL_DollarGestureEventTests.cs | 50 - .../codegen/default/SDL_DropEventTests.cs | 58 - .../codegen/default/SDL_EventTests.cs | 50 - .../codegen/default/SDL_FPointTests.cs | 50 - .../codegen/default/SDL_FRectTests.cs | 50 - .../codegen/default/SDL_GUIDTests.cs | 50 - .../codegen/default/SDL_JoyAxisEventTests.cs | 50 - .../codegen/default/SDL_JoyBallEventTests.cs | 50 - .../default/SDL_JoyBatteryEventTests.cs | 50 - .../default/SDL_JoyButtonEventTests.cs | 50 - .../default/SDL_JoyDeviceEventTests.cs | 50 - .../codegen/default/SDL_JoyHatEventTests.cs | 50 - .../codegen/default/SDL_KeyboardEventTests.cs | 50 - .../codegen/default/SDL_KeysymTests.cs | 50 - .../default/SDL_MouseButtonEventTests.cs | 50 - .../default/SDL_MouseMotionEventTests.cs | 50 - .../default/SDL_MouseWheelEventTests.cs | 50 - .../default/SDL_MultiGestureEventTests.cs | 50 - .../codegen/default/SDL_OSEventTests.cs | 50 - .../codegen/default/SDL_PaletteTests.cs | 58 - .../codegen/default/SDL_PixelFormatTests.cs | 58 - .../codegen/default/SDL_PointTests.cs | 50 - .../codegen/default/SDL_QuitEventTests.cs | 50 - .../codegen/default/SDL_RWopsTests.cs | 58 - .../codegen/default/SDL_RectTests.cs | 50 - .../codegen/default/SDL_RendererInfoTests.cs | 58 - .../codegen/default/SDL_RendererTests.cs | 50 - .../codegen/default/SDL_SensorEventTests.cs | 50 - .../codegen/default/SDL_SurfaceTests.cs | 58 - .../codegen/default/SDL_SysWMEventTests.cs | 58 - .../codegen/default/SDL_SysWMmsgTests.cs | 50 - .../default/SDL_TextEditingEventTests.cs | 50 - .../default/SDL_TextEditingExtEventTests.cs | 58 - .../default/SDL_TextInputEventTests.cs | 50 - .../codegen/default/SDL_TextureTests.cs | 50 - .../default/SDL_TouchFingerEventTests.cs | 50 - .../codegen/default/SDL_UserEventTests.cs | 58 - .../codegen/default/SDL_VertexTests.cs | 50 - .../default/SDL_VirtualJoystickDescTests.cs | 58 - .../codegen/default/SDL_WindowEventTests.cs | 50 - .../codegen/default/SDL_WindowTests.cs | 50 - .../codegen/default/SDL_versionTests.cs | 50 - .../codegen/default/_SDL_AudioStreamTests.cs | 50 - .../codegen/default/_SDL_JoystickTests.cs | 50 - .../codegen/default/_SDL_iconv_tTests.cs | 50 - .../codegen/default/_TTF_FontTests.cs | 50 - .../codegen/latest/ID3D11DeviceTests.cs | 50 - .../codegen/latest/ID3D12DeviceTests.cs | 50 - .../codegen/latest/IDirect3DDevice9Tests.cs | 50 - .../codegen/latest/IMG_AnimationTests.cs | 58 - .../codegen/latest/SDL_AudioCVTTests.cs | 58 - .../latest/SDL_AudioDeviceEventTests.cs | 50 - .../codegen/latest/SDL_AudioSpecTests.cs | 58 - .../codegen/latest/SDL_BlitMapTests.cs | 50 - .../codegen/latest/SDL_ColorTests.cs | 50 - .../codegen/latest/SDL_CommonEventTests.cs | 50 - .../latest/SDL_ControllerAxisEventTests.cs | 50 - .../latest/SDL_ControllerButtonEventTests.cs | 50 - .../latest/SDL_ControllerDeviceEventTests.cs | 50 - .../latest/SDL_ControllerSensorEventTests.cs | 50 - .../SDL_ControllerTouchpadEventTests.cs | 50 - .../codegen/latest/SDL_CursorTests.cs | 50 - .../codegen/latest/SDL_DisplayEventTests.cs | 50 - .../codegen/latest/SDL_DisplayModeTests.cs | 58 - .../latest/SDL_DollarGestureEventTests.cs | 50 - .../codegen/latest/SDL_DropEventTests.cs | 58 - .../codegen/latest/SDL_EventTests.cs | 50 - .../codegen/latest/SDL_FPointTests.cs | 50 - .../codegen/latest/SDL_FRectTests.cs | 50 - .../codegen/latest/SDL_GUIDTests.cs | 50 - .../codegen/latest/SDL_JoyAxisEventTests.cs | 50 - .../codegen/latest/SDL_JoyBallEventTests.cs | 50 - .../latest/SDL_JoyBatteryEventTests.cs | 50 - .../codegen/latest/SDL_JoyButtonEventTests.cs | 50 - .../codegen/latest/SDL_JoyDeviceEventTests.cs | 50 - .../codegen/latest/SDL_JoyHatEventTests.cs | 50 - .../codegen/latest/SDL_KeyboardEventTests.cs | 50 - .../codegen/latest/SDL_KeysymTests.cs | 50 - .../latest/SDL_MouseButtonEventTests.cs | 50 - .../latest/SDL_MouseMotionEventTests.cs | 50 - .../latest/SDL_MouseWheelEventTests.cs | 50 - .../latest/SDL_MultiGestureEventTests.cs | 50 - .../codegen/latest/SDL_OSEventTests.cs | 50 - .../codegen/latest/SDL_PaletteTests.cs | 58 - .../codegen/latest/SDL_PixelFormatTests.cs | 58 - .../codegen/latest/SDL_PointTests.cs | 50 - .../codegen/latest/SDL_QuitEventTests.cs | 50 - .../codegen/latest/SDL_RWopsTests.cs | 58 - .../codegen/latest/SDL_RectTests.cs | 50 - .../codegen/latest/SDL_RendererInfoTests.cs | 58 - .../codegen/latest/SDL_RendererTests.cs | 50 - .../codegen/latest/SDL_SensorEventTests.cs | 50 - .../codegen/latest/SDL_SurfaceTests.cs | 58 - .../codegen/latest/SDL_SysWMEventTests.cs | 58 - .../codegen/latest/SDL_SysWMmsgTests.cs | 50 - .../latest/SDL_TextEditingEventTests.cs | 50 - .../latest/SDL_TextEditingExtEventTests.cs | 58 - .../codegen/latest/SDL_TextInputEventTests.cs | 50 - .../codegen/latest/SDL_TextureTests.cs | 50 - .../latest/SDL_TouchFingerEventTests.cs | 50 - .../codegen/latest/SDL_UserEventTests.cs | 58 - .../codegen/latest/SDL_VertexTests.cs | 50 - .../latest/SDL_VirtualJoystickDescTests.cs | 58 - .../codegen/latest/SDL_WindowEventTests.cs | 50 - .../codegen/latest/SDL_WindowTests.cs | 50 - .../codegen/latest/SDL_versionTests.cs | 50 - .../codegen/latest/_SDL_AudioStreamTests.cs | 50 - .../codegen/latest/_SDL_JoystickTests.cs | 50 - .../codegen/latest/_SDL_iconv_tTests.cs | 50 - .../codegen/latest/_TTF_FontTests.cs | 50 - 575 files changed, 898 insertions(+), 25887 deletions(-) create mode 100644 Directory.Packages.props delete mode 100644 build/Build/ClangSharpPInvokeGeneratorTasks.cs delete mode 100644 build/Build/Linux.cs rename sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs => build/Build/ToolOptionsExtensions.cs (73%) create mode 100644 global.json rename sources/SDL2Sharp.Interop/codegen/{compatible => }/ID3D11Device.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/ID3D12Device.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/IDirect3DDevice9.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/IMG.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/IMG_Animation.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/IMG_InitFlags.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL.cs (99%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ArrayOrder.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{default => }/SDL_AudioCVT.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_AudioDeviceEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{default => }/SDL_AudioSpec.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_AudioStatus.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_BitmapOrder.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_BlendFactor.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_BlendMode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_BlendOperation.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_BlitMap.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Color.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_CommonEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ControllerAxisEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ControllerButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ControllerDeviceEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_ControllerSensorEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ControllerTouchpadEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Cursor.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DUMMY_ENUM.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DisplayEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DisplayEventID.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DisplayMode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DisplayOrientation.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DollarGestureEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_DropEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_Event.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_EventType.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_FPoint.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_FRect.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_FlashOperation.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_GLContextResetNotification.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_GLattr.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_GLcontextFlag.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_GLcontextReleaseFlag.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_GLprofile.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_GUID.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_HintPriority.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_HitTestResult.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyAxisEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyBallEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyBatteryEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyDeviceEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoyHatEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoystickPowerLevel.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_JoystickType.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_KeyCode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_KeyboardEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Keymod.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Keysym.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_LogCategory.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_LogPriority.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_MouseButtonEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_MouseMotionEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_MouseWheelDirection.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_MouseWheelEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_MultiGestureEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_OSEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_PackedLayout.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_PackedOrder.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Palette.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_PixelFormat.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_PixelFormatEnum.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_PixelType.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Point.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_QuitEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{default => }/SDL_RWops.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Rect.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Renderer.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_RendererFlags.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_RendererFlip.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_RendererInfo.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_ScaleMode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Scancode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_SensorEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Surface.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_SysWMEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_SysWMmsg.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_SystemCursor.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_TextEditingEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_TextEditingExtEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{latest => }/SDL_TextInputEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Texture.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_TextureAccess.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_TextureModulate.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_TouchFingerEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_UserEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Vertex.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{default => }/SDL_VirtualJoystickDesc.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_Window.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_WindowEvent.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_WindowEventID.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_WindowFlags.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_YUV_CONVERSION_MODE.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_bool.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_errorcode.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_eventaction.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/SDL_version.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/TTF.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/TTF_Direction.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/_SDL_AudioStream.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/_SDL_Joystick.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/_SDL_iconv_t.cs (100%) rename sources/SDL2Sharp.Interop/codegen/{compatible => }/_TTF_Font.cs (100%) delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/IMG.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/TTF.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/TTF.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs delete mode 100644 sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/ID3D11DeviceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/ID3D12DeviceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/IDirect3DDevice9Tests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/IMG_AnimationTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_AudioCVTTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_AudioDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_AudioSpecTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_BlitMapTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ColorTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_CommonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ControllerAxisEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ControllerButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ControllerDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ControllerSensorEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_ControllerTouchpadEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_CursorTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_DisplayEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_DisplayModeTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_DollarGestureEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_DropEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_EventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_FPointTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_FRectTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_GUIDTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyAxisEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyBallEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyBatteryEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyDeviceEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_JoyHatEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_KeyboardEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_KeysymTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_MouseButtonEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_MouseMotionEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_MouseWheelEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_MultiGestureEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_OSEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_PaletteTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_PixelFormatTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_PointTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_QuitEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_RWopsTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_RectTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_RendererInfoTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_RendererTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_SensorEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_SurfaceTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_SysWMEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_SysWMmsgTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_TextEditingEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_TextEditingExtEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_TextInputEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_TextureTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_TouchFingerEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_UserEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_VertexTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_VirtualJoystickDescTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_WindowEventTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_WindowTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/SDL_versionTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/_SDL_AudioStreamTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/_SDL_JoystickTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/_SDL_iconv_tTests.cs (100%) rename tests/SDL2Sharp.Interop.Tests/codegen/{compatible => }/_TTF_FontTests.cs (100%) delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs delete mode 100644 tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 944325d2..eabaa20c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,11 +33,11 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp @@ -49,27 +49,27 @@ jobs: AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Publish: log' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: log path: artifacts/log - name: 'Publish: bin' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bin path: artifacts/bin - name: 'Publish: obj' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: obj path: artifacts/obj - name: 'Publish: tst' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tst path: artifacts/tst - name: 'Publish: pkg' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pkg path: artifacts/pkg diff --git a/.github/workflows/test-ubuntu.yml b/.github/workflows/test-ubuntu.yml index 655f00f0..f118f908 100644 --- a/.github/workflows/test-ubuntu.yml +++ b/.github/workflows/test-ubuntu.yml @@ -33,11 +33,11 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp @@ -49,22 +49,22 @@ jobs: AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Publish: log' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: log path: artifacts/log - name: 'Publish: bin' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bin path: artifacts/bin - name: 'Publish: obj' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: obj path: artifacts/obj - name: 'Publish: tst' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tst path: artifacts/tst diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 18c0984c..6d9331ab 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -33,11 +33,11 @@ jobs: name: windows-latest runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp @@ -49,22 +49,22 @@ jobs: AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Publish: log' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: log path: artifacts/log - name: 'Publish: bin' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bin path: artifacts/bin - name: 'Publish: obj' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: obj path: artifacts/obj - name: 'Publish: tst' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tst path: artifacts/tst diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index b9b464a1..27831484 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,23 +1,51 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Generate", + "Pack", + "Release", + "Restore", + "Setup", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Architecture": { - "type": "string", - "description": "Platform architecture to use for testing. Default is the processor architecture of the underlying operating system" - }, - "Configuration": { - "type": "string", - "description": "Configuration to build. Default is 'Debug' (local) or 'Release' (server)", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" @@ -27,25 +55,8 @@ "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", @@ -74,51 +85,46 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Generate", - "Pack", - "Release", - "Restore", - "Setup", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Generate", - "Pack", - "Release", - "Restore", - "Setup", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "Architecture": { + "type": "string", + "description": "Platform architecture to use for testing. Default is the processor architecture of the underlying operating system" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build. Default is 'Debug' (local) or 'Release' (server)", "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" + "Debug", + "Release" ] + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" } } + }, + { + "$ref": "#/definitions/NukeBuild" } - } + ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index a75fe817..207788fe 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -116,29 +116,13 @@ "x64" ] }, - { - "id": "ClrFramework", - "description": "Choose which .NET target framework should be used.", - "default": "net481", - "type": "pickString", - "options": [ - "net481", - "net48", - "net472", - "net471", - "net47", - "net462" - ] - }, { "id": "CoreClrFramework", "description": "Choose which .NET target framework should be used.", "default": "net8.0", "type": "pickString", "options": [ - "net8.0", - "net7.0", - "net6.0", + "net8.0" ] }, { diff --git a/Directory.Build.props b/Directory.Build.props index c2b03f5a..80f2397c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -70,14 +70,4 @@ $(DefaultItemExcludes);obj\** - - - net8.0 - net7.0;net6.0 - net481;net48;net472;net471;net47;net462;net461;netstandard2.0 - Latest - Default - Compatible - - \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index fe85c47b..d6959465 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -34,19 +34,17 @@ - - + all - runtime; build; native; contentfiles; analyzers; buildtransitive - + all - + all - + all diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..44bde376 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,24 @@ + + + true + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 92f7b642..05176f18 100644 --- a/build.ps1 +++ b/build.ps1 @@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp" $DotNetGlobalFile = "$PSScriptRoot\\global.json" $DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" -$DotNetChannel = "LTS" +$DotNetChannel = "STS" $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 $env:DOTNET_NOLOGO = 1 @@ -65,11 +65,6 @@ else { Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" -# Install the Azure Artifacts Credential Provider for non-server builds -if ($null -eq $env:GITHUB_ACTIONS -and $null -eq $env:TF_BUILD) { - Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx" -} - if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null diff --git a/build.sh b/build.sh index 84615897..57d4d159 100755 --- a/build.sh +++ b/build.sh @@ -14,11 +14,9 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" -DOTNET_CHANNEL="LTS" +DOTNET_CHANNEL="STS" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_MULTILEVEL_LOOKUP=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export DOTNET_NOLOGO=1 ########################################################################### @@ -60,24 +58,10 @@ fi echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" -# Install the Azure Artifacts Credential Provider for non-server builds -if [[ ! -v GITHUB_ACTIONS && ! -v TF_BUILD ]]; then - sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)" -fi - if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true fi -# Install Mono -#sudo apt install ca-certificates gnupg -#sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -#echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list -#sudo apt update -#sudo apt install mono-devel - -# Restore, build, and run! -"$DOTNET_EXE" restore --interactive "$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/build/Build/Build.csproj b/build/Build/Build.csproj index 6845f046..af81ffe0 100644 --- a/build/Build/Build.csproj +++ b/build/Build/Build.csproj @@ -12,7 +12,7 @@ - + diff --git a/build/Build/ClangSharpPInvokeGenerator.Generated.cs b/build/Build/ClangSharpPInvokeGenerator.Generated.cs index 898ec121..2d59a6c1 100644 --- a/build/Build/ClangSharpPInvokeGenerator.Generated.cs +++ b/build/Build/ClangSharpPInvokeGenerator.Generated.cs @@ -17,2742 +17,784 @@ namespace Nuke.Common.Tools.ClangSharpPInvokeGenerator; -/// -///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

-///

For more details, visit the official website.

-///
+///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

For more details, visit the official website.

[PublicAPI] [ExcludeFromCodeCoverage] -[NuGetPackageRequirement(ClangSharpPInvokeGeneratorPackageId)] -public partial class ClangSharpPInvokeGeneratorTasks - : IRequireNuGetPackage +[NuGetTool(Id = PackageId, Executable = PackageExecutable)] +public partial class ClangSharpPInvokeGeneratorTasks : ToolTasks, IRequireNuGetPackage { - public const string ClangSharpPInvokeGeneratorPackageId = "ClangSharpPInvokeGenerator"; - /// - /// Path to the ClangSharpPInvokeGenerator executable. - /// - public static string ClangSharpPInvokeGeneratorPath => - ToolPathResolver.TryGetEnvironmentExecutable("CLANGSHARPPINVOKEGENERATOR_EXE") ?? - NuGetToolPathResolver.GetPackageExecutable("ClangSharpPInvokeGenerator", "ClangSharpPInvokeGenerator.dll"); - public static Action ClangSharpPInvokeGeneratorLogger { get; set; } = ProcessTasks.DefaultLogger; - public static Action ClangSharpPInvokeGeneratorExitHandler { get; set; } = CustomExitHandler; - /// - ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

- ///

For more details, visit the official website.

- ///
- public static IReadOnlyCollection ClangSharpPInvokeGenerator(ArgumentStringHandler arguments, string workingDirectory = null, IReadOnlyDictionary environmentVariables = null, int? timeout = null, bool? logOutput = null, bool? logInvocation = null, Action logger = null, Action exitHandler = null) - { - using var process = ProcessTasks.StartProcess(ClangSharpPInvokeGeneratorPath, arguments, workingDirectory, environmentVariables, timeout, logOutput, logInvocation, logger ?? ClangSharpPInvokeGeneratorLogger); - (exitHandler ?? (p => ClangSharpPInvokeGeneratorExitHandler.Invoke(null, p))).Invoke(process.AssertWaitForExit()); - return process.Output; - } - /// - ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

- ///

For more details, visit the official website.

- ///
- /// - ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

- ///
    - ///
  • --additional via
  • - ///
  • --config via
  • - ///
  • --define-macro via
  • - ///
  • --exclude via
  • - ///
  • --file via
  • - ///
  • --file-directory via
  • - ///
  • --headerFile via
  • - ///
  • --include via
  • - ///
  • --include-directory via
  • - ///
  • --language via
  • - ///
  • --libraryPath via
  • - ///
  • --methodClassName via
  • - ///
  • --namespace via
  • - ///
  • --nativeTypeNamesToStrip via
  • - ///
  • --output via
  • - ///
  • --output-mode via
  • - ///
  • --prefixStrip via
  • - ///
  • --remap via
  • - ///
  • --std via
  • - ///
  • --test-output via
  • - ///
  • --traverse via
  • - ///
  • --with-access-specifier via
  • - ///
  • --with-attribute via
  • - ///
  • --with-callconv via
  • - ///
  • --with-class via
  • - ///
  • --with-guid via
  • - ///
  • --with-librarypath via
  • - ///
  • --with-manual-import via
  • - ///
  • --with-namespace via
  • - ///
  • --with-packing via
  • - ///
  • --with-setlasterror via
  • - ///
  • --with-suppressgctransition via
  • - ///
  • --with-transparent-struct via
  • - ///
  • --with-type via
  • - ///
  • --with-using via
  • - ///
- ///
- public static IReadOnlyCollection ClangSharpPInvokeGenerator(ClangSharpPInvokeGeneratorSettings toolSettings = null) - { - toolSettings = toolSettings ?? new ClangSharpPInvokeGeneratorSettings(); - using var process = ProcessTasks.StartProcess(toolSettings); - toolSettings.ProcessExitHandler.Invoke(toolSettings, process.AssertWaitForExit()); - return process.Output; - } - /// - ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

- ///

For more details, visit the official website.

- ///
- /// - ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

- ///
    - ///
  • --additional via
  • - ///
  • --config via
  • - ///
  • --define-macro via
  • - ///
  • --exclude via
  • - ///
  • --file via
  • - ///
  • --file-directory via
  • - ///
  • --headerFile via
  • - ///
  • --include via
  • - ///
  • --include-directory via
  • - ///
  • --language via
  • - ///
  • --libraryPath via
  • - ///
  • --methodClassName via
  • - ///
  • --namespace via
  • - ///
  • --nativeTypeNamesToStrip via
  • - ///
  • --output via
  • - ///
  • --output-mode via
  • - ///
  • --prefixStrip via
  • - ///
  • --remap via
  • - ///
  • --std via
  • - ///
  • --test-output via
  • - ///
  • --traverse via
  • - ///
  • --with-access-specifier via
  • - ///
  • --with-attribute via
  • - ///
  • --with-callconv via
  • - ///
  • --with-class via
  • - ///
  • --with-guid via
  • - ///
  • --with-librarypath via
  • - ///
  • --with-manual-import via
  • - ///
  • --with-namespace via
  • - ///
  • --with-packing via
  • - ///
  • --with-setlasterror via
  • - ///
  • --with-suppressgctransition via
  • - ///
  • --with-transparent-struct via
  • - ///
  • --with-type via
  • - ///
  • --with-using via
  • - ///
- ///
- public static IReadOnlyCollection ClangSharpPInvokeGenerator(Configure configurator) - { - return ClangSharpPInvokeGenerator(configurator(new ClangSharpPInvokeGeneratorSettings())); - } - /// - ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

- ///

For more details, visit the official website.

- ///
- /// - ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

- ///
    - ///
  • --additional via
  • - ///
  • --config via
  • - ///
  • --define-macro via
  • - ///
  • --exclude via
  • - ///
  • --file via
  • - ///
  • --file-directory via
  • - ///
  • --headerFile via
  • - ///
  • --include via
  • - ///
  • --include-directory via
  • - ///
  • --language via
  • - ///
  • --libraryPath via
  • - ///
  • --methodClassName via
  • - ///
  • --namespace via
  • - ///
  • --nativeTypeNamesToStrip via
  • - ///
  • --output via
  • - ///
  • --output-mode via
  • - ///
  • --prefixStrip via
  • - ///
  • --remap via
  • - ///
  • --std via
  • - ///
  • --test-output via
  • - ///
  • --traverse via
  • - ///
  • --with-access-specifier via
  • - ///
  • --with-attribute via
  • - ///
  • --with-callconv via
  • - ///
  • --with-class via
  • - ///
  • --with-guid via
  • - ///
  • --with-librarypath via
  • - ///
  • --with-manual-import via
  • - ///
  • --with-namespace via
  • - ///
  • --with-packing via
  • - ///
  • --with-setlasterror via
  • - ///
  • --with-suppressgctransition via
  • - ///
  • --with-transparent-struct via
  • - ///
  • --with-type via
  • - ///
  • --with-using via
  • - ///
- ///
- public static IEnumerable<(ClangSharpPInvokeGeneratorSettings Settings, IReadOnlyCollection Output)> ClangSharpPInvokeGenerator(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) - { - return configurator.Invoke(ClangSharpPInvokeGenerator, ClangSharpPInvokeGeneratorLogger, degreeOfParallelism, completeOnFailure); - } + public static string ClangSharpPInvokeGeneratorPath { get => new ClangSharpPInvokeGeneratorTasks().GetToolPathInternal(); set => new ClangSharpPInvokeGeneratorTasks().SetToolPath(value); } + public const string PackageId = "ClangSharpPInvokeGenerator"; + public const string PackageExecutable = "ClangSharpPInvokeGenerator.dll"; + ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

For more details, visit the official website.

+ public static IReadOnlyCollection ClangSharpPInvokeGenerator(ArgumentStringHandler arguments, string workingDirectory = null, IReadOnlyDictionary environmentVariables = null, int? timeout = null, bool? logOutput = null, bool? logInvocation = null, Action logger = null, Func exitHandler = null) => new ClangSharpPInvokeGeneratorTasks().Run(arguments, workingDirectory, environmentVariables, timeout, logOutput, logInvocation, logger, exitHandler); + ///

ClangSharp P/Invoke Binding Generator is a tool for generating strongly-typed safe bindings written in C# for .NET and Mono.

For more details, visit the official website.

+ ///

This is a CLI wrapper with fluent API that allows to modify the following arguments:

  • --additional via
  • --config via
  • --define-macro via
  • --exclude via
  • --file via
  • --file-directory via
  • --headerFile via
  • --include via
  • --include-directory via
  • --language via
  • --libraryPath via
  • --methodClassName via
  • --namespace via
  • --nativeTypeNamesToStrip via
  • --output via
  • --output-mode via
  • --prefixStrip via
  • --remap via
  • --std via
  • --test-output via
  • --traverse via
  • --with-access-specifier via
  • --with-attribute via
  • --with-callconv via
  • --with-class via
  • --with-guid via
  • --with-librarypath via
  • --with-manual-import via
  • --with-namespace via
  • --with-packing via
  • --with-setlasterror via
  • --with-suppressgctransition via
  • --with-transparent-struct via
  • --with-type via
  • --with-using via
+ public static IReadOnlyCollection ClangSharpPInvokeGenerator(ClangSharpPInvokeGeneratorSettings options = null) => new ClangSharpPInvokeGeneratorTasks().Run(options); + /// + public static IReadOnlyCollection ClangSharpPInvokeGenerator(Configure configurator) => new ClangSharpPInvokeGeneratorTasks().Run(configurator.Invoke(new ClangSharpPInvokeGeneratorSettings())); + /// + public static IEnumerable<(ClangSharpPInvokeGeneratorSettings Settings, IReadOnlyCollection Output)> ClangSharpPInvokeGenerator(CombinatorialConfigure configurator, int degreeOfParallelism = 1, bool completeOnFailure = false) => configurator.Invoke(ClangSharpPInvokeGenerator, degreeOfParallelism, completeOnFailure); } #region ClangSharpPInvokeGeneratorSettings -/// -/// Used within . -/// +/// [PublicAPI] [ExcludeFromCodeCoverage] -[Serializable] -public partial class ClangSharpPInvokeGeneratorSettings : ToolSettings +[Command(Type = typeof(ClangSharpPInvokeGeneratorTasks), Command = nameof(ClangSharpPInvokeGeneratorTasks.ClangSharpPInvokeGenerator))] +public partial class ClangSharpPInvokeGeneratorSettings : ToolOptions { - /// - /// Path to the ClangSharpPInvokeGenerator executable. - /// - public override string ProcessToolPath => base.ProcessToolPath ?? ClangSharpPInvokeGeneratorTasks.ClangSharpPInvokeGeneratorPath; - public override Action ProcessLogger => base.ProcessLogger ?? ClangSharpPInvokeGeneratorTasks.ClangSharpPInvokeGeneratorLogger; - public override Action ProcessExitHandler => base.ProcessExitHandler ?? ClangSharpPInvokeGeneratorTasks.ClangSharpPInvokeGeneratorExitHandler; - /// - /// An argument to pass to Clang when parsing the input files. - /// - public virtual IReadOnlyList Additional => AdditionalInternal.AsReadOnly(); - internal List AdditionalInternal { get; set; } = new List(); - /// - /// A configuration option that controls how the bindings are generated. - /// - public virtual IReadOnlyList Config => ConfigInternal.AsReadOnly(); - internal List ConfigInternal { get; set; } = new List(); - /// - /// Define to (or 1 if omitted). - /// - public virtual IReadOnlyList DefineMacro => DefineMacroInternal.AsReadOnly(); - internal List DefineMacroInternal { get; set; } = new List(); - /// - /// A declaration name to exclude from binding generation. - /// - public virtual IReadOnlyList Exclude => ExcludeInternal.AsReadOnly(); - internal List ExcludeInternal { get; set; } = new List(); - /// - /// A file to parse and generate bindings for. - /// - public virtual IReadOnlyList File => FileInternal.AsReadOnly(); - internal List FileInternal { get; set; } = new List(); - /// - /// The base path for files to parse. - /// - public virtual IReadOnlyList FileDirectory => FileDirectoryInternal.AsReadOnly(); - internal List FileDirectoryInternal { get; set; } = new List(); - /// - /// A file which contains the header to prefix every generated file with. - /// - public virtual IReadOnlyList HeaderFile => HeaderFileInternal.AsReadOnly(); - internal List HeaderFileInternal { get; set; } = new List(); - /// - /// A declaration name to include in binding generation. - /// - public virtual IReadOnlyList Include => IncludeInternal.AsReadOnly(); - internal List IncludeInternal { get; set; } = new List(); - /// - /// Add directory to include search path. - /// - public virtual IReadOnlyList IncludeDirectory => IncludeDirectoryInternal.AsReadOnly(); - internal List IncludeDirectoryInternal { get; set; } = new List(); - /// - /// Treat subsequent input files as having type . - /// - public virtual string Language { get; internal set; } - /// - /// The string to use in the DllImport attribute used when generating bindings. - /// - public virtual string LibraryPath { get; internal set; } - /// - /// The name of the static class that will contain the generated method bindings. - /// - public virtual string MethodClassName { get; internal set; } - /// - /// The namespace in which to place the generated bindings. - /// - public virtual string Namespace { get; internal set; } - /// - /// The contents to strip from the generated NativeTypeName attributes. - /// - public virtual string NativeTypeNamesToStrip { get; internal set; } - /// - /// The mode describing how the information collected from the headers are presented in the resultant bindings. - /// - public virtual ClangSharpPInvokeGeneratorOutputMode OutputMode { get; internal set; } - /// - /// The output location to write the generated bindings to. - /// - public virtual string Output { get; internal set; } - /// - /// The prefix to strip from the generated method bindings. - /// - public virtual IReadOnlyList PrefixStrip => PrefixStripInternal.AsReadOnly(); - internal List PrefixStripInternal { get; set; } = new List(); - /// - /// A declaration name to be remapped to another name during binding generation. - /// - public virtual IReadOnlyList Remap => RemapInternal.AsReadOnly(); - internal List RemapInternal { get; set; } = new List(); - /// - /// Language standard to compile for. - /// - public virtual string Std { get; internal set; } - /// - /// The output location to write the generated tests to. - /// - public virtual string TestOutput { get; internal set; } - /// - /// A file name included either directly or indirectly by -f that should be traversed during binding generation. - /// - public virtual IReadOnlyList Traverse => TraverseInternal.AsReadOnly(); - internal List TraverseInternal { get; set; } = new List(); - /// - /// An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithAccessSpecifier => WithAccessSpecifierInternal.AsReadOnly(); - internal List WithAccessSpecifierInternal { get; set; } = new List(); - /// - /// An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithAttribute => WithAttributeInternal.AsReadOnly(); - internal List WithAttributeInternal { get; set; } = new List(); - /// - /// A calling convention to be used for the given declaration during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithCallConv => WithCallConvInternal.AsReadOnly(); - internal List WithCallConvInternal { get; set; } = new List(); - /// - /// A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithClass => WithClassInternal.AsReadOnly(); - internal List WithClassInternal { get; set; } = new List(); - /// - /// A GUID to be used for the given declaration during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithGuid => WithGuidInternal.AsReadOnly(); - internal List WithGuidInternal { get; set; } = new List(); - /// - /// A library path to be used for the given declaration during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithLibraryPath => WithLibraryPathInternal.AsReadOnly(); - internal List WithLibraryPathInternal { get; set; } = new List(); - /// - /// A remapped function name to be treated as a manual import during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithManualImport => WithManualImportInternal.AsReadOnly(); - internal List WithManualImportInternal { get; set; } = new List(); - /// - /// A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithNamespace => WithNamespaceInternal.AsReadOnly(); - internal List WithNamespaceInternal { get; set; } = new List(); - /// - /// Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards. - /// - public virtual IReadOnlyList WithPacking => WithPackingInternal.AsReadOnly(); - internal List WithPackingInternal { get; set; } = new List(); - /// - /// Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards. - /// - public virtual IReadOnlyList WithSetLastError => WithSetLastErrorInternal.AsReadOnly(); - internal List WithSetLastErrorInternal { get; set; } = new List(); - /// - /// Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards. - /// - public virtual IReadOnlyList WithSuppressGCTransition => WithSuppressGCTransitionInternal.AsReadOnly(); - internal List WithSuppressGCTransitionInternal { get; set; } = new List(); - /// - /// A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithTransparentStruct => WithTransparentStructInternal.AsReadOnly(); - internal List WithTransparentStructInternal { get; set; } = new List(); - /// - /// A type to be used for the given enum declaration during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithType => WithTypeInternal.AsReadOnly(); - internal List WithTypeInternal { get; set; } = new List(); - /// - /// A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards. - /// - public virtual IReadOnlyList WithUsing => WithUsingInternal.AsReadOnly(); - internal List WithUsingInternal { get; set; } = new List(); - protected override Arguments ConfigureProcessArguments(Arguments arguments) - { - arguments - .Add("--additional {value}", Additional) - .Add("--config {value}", Config) - .Add("--define-macro {value}", DefineMacro) - .Add("--exclude {value}", Exclude) - .Add("--file {value}", File) - .Add("--file-directory {value}", FileDirectory) - .Add("--headerFile {value}", HeaderFile) - .Add("--include {value}", Include) - .Add("--include-directory {value}", IncludeDirectory) - .Add("--language {value}", Language) - .Add("--libraryPath {value}", LibraryPath) - .Add("--methodClassName {value}", MethodClassName) - .Add("--namespace {value}", Namespace) - .Add("--nativeTypeNamesToStrip {value}", NativeTypeNamesToStrip) - .Add("--output-mode {value}", OutputMode) - .Add("--output {value}", Output) - .Add("--prefixStrip {value}", PrefixStrip) - .Add("--remap {value}", Remap) - .Add("--std {value}", Std) - .Add("--test-output {value}", TestOutput) - .Add("--traverse {value}", Traverse) - .Add("--with-access-specifier {value}", WithAccessSpecifier) - .Add("--with-attribute {value}", WithAttribute) - .Add("--with-callconv {value}", WithCallConv) - .Add("--with-class {value}", WithClass) - .Add("--with-guid {value}", WithGuid) - .Add("--with-librarypath {value}", WithLibraryPath) - .Add("--with-manual-import {value}", WithManualImport) - .Add("--with-namespace {value}", WithNamespace) - .Add("--with-packing {value}", WithPacking) - .Add("--with-setlasterror {value}", WithSetLastError) - .Add("--with-suppressgctransition {value}", WithSuppressGCTransition) - .Add("--with-transparent-struct {value}", WithTransparentStruct) - .Add("--with-type {value}", WithType) - .Add("--with-using {value}", WithUsing); - return base.ConfigureProcessArguments(arguments); - } + /// An argument to pass to Clang when parsing the input files. + [Argument(Format = "--additional {value}")] public IReadOnlyList Additional => Get>(() => Additional); + /// A configuration option that controls how the bindings are generated. + [Argument(Format = "--config {value}")] public IReadOnlyList Config => Get>(() => Config); + /// Define to (or 1 if omitted). + [Argument(Format = "--define-macro {value}")] public IReadOnlyList DefineMacro => Get>(() => DefineMacro); + /// A declaration name to exclude from binding generation. + [Argument(Format = "--exclude {value}")] public IReadOnlyList Exclude => Get>(() => Exclude); + /// A file to parse and generate bindings for. + [Argument(Format = "--file {value}")] public IReadOnlyList File => Get>(() => File); + /// The base path for files to parse. + [Argument(Format = "--file-directory {value}")] public IReadOnlyList FileDirectories => Get>(() => FileDirectories); + /// A file which contains the header to prefix every generated file with. + [Argument(Format = "--headerFile {value}")] public IReadOnlyList HeaderFiles => Get>(() => HeaderFiles); + /// A declaration name to include in binding generation. + [Argument(Format = "--include {value}")] public IReadOnlyList Include => Get>(() => Include); + /// Add directory to include search path. + [Argument(Format = "--include-directory {value}")] public IReadOnlyList IncludeDirectory => Get>(() => IncludeDirectory); + /// Treat subsequent input files as having type . + [Argument(Format = "--language {value}")] public string Language => Get(() => Language); + /// The string to use in the DllImport attribute used when generating bindings. + [Argument(Format = "--libraryPath {value}")] public string LibraryPath => Get(() => LibraryPath); + /// The name of the static class that will contain the generated method bindings. + [Argument(Format = "--methodClassName {value}")] public string MethodClassName => Get(() => MethodClassName); + /// The namespace in which to place the generated bindings. + [Argument(Format = "--namespace {value}")] public string Namespace => Get(() => Namespace); + /// The contents to strip from the generated NativeTypeName attributes. + [Argument(Format = "--nativeTypeNamesToStrip {value}")] public string NativeTypeNamesToStrip => Get(() => NativeTypeNamesToStrip); + /// The mode describing how the information collected from the headers are presented in the resultant bindings. + [Argument(Format = "--output-mode {value}")] public ClangSharpPInvokeGeneratorOutputMode OutputMode => Get(() => OutputMode); + /// The output location to write the generated bindings to. + [Argument(Format = "--output {value}")] public string Output => Get(() => Output); + /// The prefix to strip from the generated method bindings. + [Argument(Format = "--prefixStrip {value}")] public IReadOnlyList PrefixStrip => Get>(() => PrefixStrip); + /// A declaration name to be remapped to another name during binding generation. + [Argument(Format = "--remap {value}")] public IReadOnlyList Remap => Get>(() => Remap); + /// Language standard to compile for. + [Argument(Format = "--std {value}")] public string Std => Get(() => Std); + /// The output location to write the generated tests to. + [Argument(Format = "--test-output {value}")] public string TestOutput => Get(() => TestOutput); + /// A file name included either directly or indirectly by -f that should be traversed during binding generation. + [Argument(Format = "--traverse {value}")] public IReadOnlyList Traverse => Get>(() => Traverse); + /// An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards. + [Argument(Format = "--with-access-specifier {value}")] public IReadOnlyList WithAccessSpecifier => Get>(() => WithAccessSpecifier); + /// An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards. + [Argument(Format = "--with-attribute {value}")] public IReadOnlyList WithAttribute => Get>(() => WithAttribute); + /// A calling convention to be used for the given declaration during binding generation. Supports wildcards. + [Argument(Format = "--with-callconv {value}")] public IReadOnlyList WithCallConv => Get>(() => WithCallConv); + /// A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards. + [Argument(Format = "--with-class {value}")] public IReadOnlyList WithClass => Get>(() => WithClass); + /// A GUID to be used for the given declaration during binding generation. Supports wildcards. + [Argument(Format = "--with-guid {value}")] public IReadOnlyList WithGuid => Get>(() => WithGuid); + /// A library path to be used for the given declaration during binding generation. Supports wildcards. + [Argument(Format = "--with-librarypath {value}")] public IReadOnlyList WithLibraryPath => Get>(() => WithLibraryPath); + /// A remapped function name to be treated as a manual import during binding generation. Supports wildcards. + [Argument(Format = "--with-manual-import {value}")] public IReadOnlyList WithManualImport => Get>(() => WithManualImport); + /// A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards. + [Argument(Format = "--with-namespace {value}")] public IReadOnlyList WithNamespace => Get>(() => WithNamespace); + /// Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards. + [Argument(Format = "--with-packing {value}")] public IReadOnlyList WithPacking => Get>(() => WithPacking); + /// Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards. + [Argument(Format = "--with-setlasterror {value}")] public IReadOnlyList WithSetLastError => Get>(() => WithSetLastError); + /// Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards. + [Argument(Format = "--with-suppressgctransition {value}")] public IReadOnlyList WithSuppressGCTransition => Get>(() => WithSuppressGCTransition); + /// A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards. + [Argument(Format = "--with-transparent-struct {value}")] public IReadOnlyList WithTransparentStruct => Get>(() => WithTransparentStruct); + /// A type to be used for the given enum declaration during binding generation. Supports wildcards. + [Argument(Format = "--with-type {value}")] public IReadOnlyList WithType => Get>(() => WithType); + /// A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards. + [Argument(Format = "--with-using {value}")] public IReadOnlyList WithUsing => Get>(() => WithUsing); } #endregion #region ClangSharpPInvokeGeneratorSettingsExtensions -/// -/// Used within . -/// +/// [PublicAPI] [ExcludeFromCodeCoverage] public static partial class ClangSharpPInvokeGeneratorSettingsExtensions { #region Additional - /// - ///

Sets to a new list

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T SetAdditional(this T toolSettings, params string[] additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AdditionalInternal = additional.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T SetAdditional(this T toolSettings, IEnumerable additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AdditionalInternal = additional.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T AddAdditional(this T toolSettings, params string[] additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AdditionalInternal.AddRange(additional); - return toolSettings; - } - /// - ///

Adds values to

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T AddAdditional(this T toolSettings, IEnumerable additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AdditionalInternal.AddRange(additional); - return toolSettings; - } - /// - ///

Clears

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T ClearAdditional(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.AdditionalInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T RemoveAdditional(this T toolSettings, params string[] additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(additional); - toolSettings.AdditionalInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

An argument to pass to Clang when parsing the input files.

- ///
- [Pure] - public static T RemoveAdditional(this T toolSettings, IEnumerable additional) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(additional); - toolSettings.AdditionalInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T SetAdditional(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T SetAdditional(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T AddAdditional(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T AddAdditional(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T RemoveAdditional(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T RemoveAdditional(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Additional, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Additional))] + public static T ClearAdditional(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Additional)); #endregion #region Config - /// - ///

Sets to a new list

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T SetConfig(this T toolSettings, params ClangSharpPInvokeGeneratorConfigOption[] config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ConfigInternal = config.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T SetConfig(this T toolSettings, IEnumerable config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ConfigInternal = config.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T AddConfig(this T toolSettings, params ClangSharpPInvokeGeneratorConfigOption[] config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ConfigInternal.AddRange(config); - return toolSettings; - } - /// - ///

Adds values to

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T AddConfig(this T toolSettings, IEnumerable config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ConfigInternal.AddRange(config); - return toolSettings; - } - /// - ///

Clears

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T ClearConfig(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ConfigInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T RemoveConfig(this T toolSettings, params ClangSharpPInvokeGeneratorConfigOption[] config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(config); - toolSettings.ConfigInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A configuration option that controls how the bindings are generated.

- ///
- [Pure] - public static T RemoveConfig(this T toolSettings, IEnumerable config) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(config); - toolSettings.ConfigInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T SetConfig(this T o, params ClangSharpPInvokeGeneratorConfigOption[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T SetConfig(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T AddConfig(this T o, params ClangSharpPInvokeGeneratorConfigOption[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T AddConfig(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T RemoveConfig(this T o, params ClangSharpPInvokeGeneratorConfigOption[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T RemoveConfig(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Config, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Config))] + public static T ClearConfig(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Config)); #endregion #region DefineMacro - /// - ///

Sets to a new list

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T SetDefineMacro(this T toolSettings, params string[] defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.DefineMacroInternal = defineMacro.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T SetDefineMacro(this T toolSettings, IEnumerable defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.DefineMacroInternal = defineMacro.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T AddDefineMacro(this T toolSettings, params string[] defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.DefineMacroInternal.AddRange(defineMacro); - return toolSettings; - } - /// - ///

Adds values to

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T AddDefineMacro(this T toolSettings, IEnumerable defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.DefineMacroInternal.AddRange(defineMacro); - return toolSettings; - } - /// - ///

Clears

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T ClearDefineMacro(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.DefineMacroInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T RemoveDefineMacro(this T toolSettings, params string[] defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(defineMacro); - toolSettings.DefineMacroInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

Define to (or 1 if omitted).

- ///
- [Pure] - public static T RemoveDefineMacro(this T toolSettings, IEnumerable defineMacro) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(defineMacro); - toolSettings.DefineMacroInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T SetDefineMacro(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T SetDefineMacro(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T AddDefineMacro(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T AddDefineMacro(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T RemoveDefineMacro(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T RemoveDefineMacro(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.DefineMacro, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.DefineMacro))] + public static T ClearDefineMacro(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.DefineMacro)); #endregion #region Exclude - /// - ///

Sets to a new list

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T SetExclude(this T toolSettings, params string[] exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ExcludeInternal = exclude.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T SetExclude(this T toolSettings, IEnumerable exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ExcludeInternal = exclude.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T AddExclude(this T toolSettings, params string[] exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ExcludeInternal.AddRange(exclude); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T AddExclude(this T toolSettings, IEnumerable exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ExcludeInternal.AddRange(exclude); - return toolSettings; - } - /// - ///

Clears

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T ClearExclude(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.ExcludeInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T RemoveExclude(this T toolSettings, params string[] exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(exclude); - toolSettings.ExcludeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to exclude from binding generation.

- ///
- [Pure] - public static T RemoveExclude(this T toolSettings, IEnumerable exclude) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(exclude); - toolSettings.ExcludeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T SetExclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T SetExclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T AddExclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T AddExclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T RemoveExclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T RemoveExclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Exclude, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Exclude))] + public static T ClearExclude(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Exclude)); #endregion #region File - /// - ///

Sets to a new list

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T SetFile(this T toolSettings, params string[] file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileInternal = file.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T SetFile(this T toolSettings, IEnumerable file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileInternal = file.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T AddFile(this T toolSettings, params string[] file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileInternal.AddRange(file); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T AddFile(this T toolSettings, IEnumerable file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileInternal.AddRange(file); - return toolSettings; - } - /// - ///

Clears

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T ClearFile(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T RemoveFile(this T toolSettings, params string[] file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(file); - toolSettings.FileInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file to parse and generate bindings for.

- ///
- [Pure] - public static T RemoveFile(this T toolSettings, IEnumerable file) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(file); - toolSettings.FileInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - #endregion - #region FileDirectory - /// - ///

Sets to a new list

- ///

The base path for files to parse.

- ///
- [Pure] - public static T SetFileDirectory(this T toolSettings, params string[] fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileDirectoryInternal = fileDirectory.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

The base path for files to parse.

- ///
- [Pure] - public static T SetFileDirectory(this T toolSettings, IEnumerable fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileDirectoryInternal = fileDirectory.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

The base path for files to parse.

- ///
- [Pure] - public static T AddFileDirectory(this T toolSettings, params string[] fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileDirectoryInternal.AddRange(fileDirectory); - return toolSettings; - } - /// - ///

Adds values to

- ///

The base path for files to parse.

- ///
- [Pure] - public static T AddFileDirectory(this T toolSettings, IEnumerable fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileDirectoryInternal.AddRange(fileDirectory); - return toolSettings; - } - /// - ///

Clears

- ///

The base path for files to parse.

- ///
- [Pure] - public static T ClearFileDirectory(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.FileDirectoryInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

The base path for files to parse.

- ///
- [Pure] - public static T RemoveFileDirectory(this T toolSettings, params string[] fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(fileDirectory); - toolSettings.FileDirectoryInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

The base path for files to parse.

- ///
- [Pure] - public static T RemoveFileDirectory(this T toolSettings, IEnumerable fileDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(fileDirectory); - toolSettings.FileDirectoryInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - #endregion - #region HeaderFile - /// - ///

Sets to a new list

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T SetHeaderFile(this T toolSettings, params string[] headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.HeaderFileInternal = headerFile.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T SetHeaderFile(this T toolSettings, IEnumerable headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.HeaderFileInternal = headerFile.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T AddHeaderFile(this T toolSettings, params string[] headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.HeaderFileInternal.AddRange(headerFile); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T AddHeaderFile(this T toolSettings, IEnumerable headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.HeaderFileInternal.AddRange(headerFile); - return toolSettings; - } - /// - ///

Clears

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T ClearHeaderFile(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.HeaderFileInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T RemoveHeaderFile(this T toolSettings, params string[] headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(headerFile); - toolSettings.HeaderFileInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file which contains the header to prefix every generated file with.

- ///
- [Pure] - public static T RemoveHeaderFile(this T toolSettings, IEnumerable headerFile) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(headerFile); - toolSettings.HeaderFileInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T SetFile(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T SetFile(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T AddFile(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T AddFile(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T RemoveFile(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T RemoveFile(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.File, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.File))] + public static T ClearFile(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.File)); + #endregion + #region FileDirectories + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T SetFileDirectories(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T SetFileDirectories(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T AddFileDirectories(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T AddFileDirectories(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T RemoveFileDirectories(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T RemoveFileDirectories(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.FileDirectories, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.FileDirectories))] + public static T ClearFileDirectories(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.FileDirectories)); + #endregion + #region HeaderFiles + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T SetHeaderFiles(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T SetHeaderFiles(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T AddHeaderFiles(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T AddHeaderFiles(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T RemoveHeaderFiles(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T RemoveHeaderFiles(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.HeaderFiles, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.HeaderFiles))] + public static T ClearHeaderFiles(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.HeaderFiles)); #endregion #region Include - /// - ///

Sets to a new list

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T SetInclude(this T toolSettings, params string[] include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeInternal = include.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T SetInclude(this T toolSettings, IEnumerable include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeInternal = include.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T AddInclude(this T toolSettings, params string[] include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeInternal.AddRange(include); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T AddInclude(this T toolSettings, IEnumerable include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeInternal.AddRange(include); - return toolSettings; - } - /// - ///

Clears

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T ClearInclude(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T RemoveInclude(this T toolSettings, params string[] include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(include); - toolSettings.IncludeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to include in binding generation.

- ///
- [Pure] - public static T RemoveInclude(this T toolSettings, IEnumerable include) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(include); - toolSettings.IncludeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T SetInclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T SetInclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T AddInclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T AddInclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T RemoveInclude(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T RemoveInclude(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Include, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Include))] + public static T ClearInclude(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Include)); #endregion #region IncludeDirectory - /// - ///

Sets to a new list

- ///

Add directory to include search path.

- ///
- [Pure] - public static T SetIncludeDirectory(this T toolSettings, params string[] includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeDirectoryInternal = includeDirectory.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

Add directory to include search path.

- ///
- [Pure] - public static T SetIncludeDirectory(this T toolSettings, IEnumerable includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeDirectoryInternal = includeDirectory.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add directory to include search path.

- ///
- [Pure] - public static T AddIncludeDirectory(this T toolSettings, params string[] includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeDirectoryInternal.AddRange(includeDirectory); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add directory to include search path.

- ///
- [Pure] - public static T AddIncludeDirectory(this T toolSettings, IEnumerable includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeDirectoryInternal.AddRange(includeDirectory); - return toolSettings; - } - /// - ///

Clears

- ///

Add directory to include search path.

- ///
- [Pure] - public static T ClearIncludeDirectory(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.IncludeDirectoryInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add directory to include search path.

- ///
- [Pure] - public static T RemoveIncludeDirectory(this T toolSettings, params string[] includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(includeDirectory); - toolSettings.IncludeDirectoryInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add directory to include search path.

- ///
- [Pure] - public static T RemoveIncludeDirectory(this T toolSettings, IEnumerable includeDirectory) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(includeDirectory); - toolSettings.IncludeDirectoryInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T SetIncludeDirectory(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T SetIncludeDirectory(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T AddIncludeDirectory(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T AddIncludeDirectory(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T RemoveIncludeDirectory(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T RemoveIncludeDirectory(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.IncludeDirectory, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.IncludeDirectory))] + public static T ClearIncludeDirectory(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.IncludeDirectory)); #endregion #region Language - /// - ///

Sets

- ///

Treat subsequent input files as having type .

- ///
- [Pure] - public static T SetLanguage(this T toolSettings, string language) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Language = language; - return toolSettings; - } - /// - ///

Resets

- ///

Treat subsequent input files as having type .

- ///
- [Pure] - public static T ResetLanguage(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Language = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Language))] + public static T SetLanguage(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Language, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Language))] + public static T ResetLanguage(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.Language)); #endregion #region LibraryPath - /// - ///

Sets

- ///

The string to use in the DllImport attribute used when generating bindings.

- ///
- [Pure] - public static T SetLibraryPath(this T toolSettings, string libraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.LibraryPath = libraryPath; - return toolSettings; - } - /// - ///

Resets

- ///

The string to use in the DllImport attribute used when generating bindings.

- ///
- [Pure] - public static T ResetLibraryPath(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.LibraryPath = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.LibraryPath))] + public static T SetLibraryPath(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.LibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.LibraryPath))] + public static T ResetLibraryPath(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.LibraryPath)); #endregion #region MethodClassName - /// - ///

Sets

- ///

The name of the static class that will contain the generated method bindings.

- ///
- [Pure] - public static T SetMethodClassName(this T toolSettings, string methodClassName) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.MethodClassName = methodClassName; - return toolSettings; - } - /// - ///

Resets

- ///

The name of the static class that will contain the generated method bindings.

- ///
- [Pure] - public static T ResetMethodClassName(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.MethodClassName = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.MethodClassName))] + public static T SetMethodClassName(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.MethodClassName, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.MethodClassName))] + public static T ResetMethodClassName(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.MethodClassName)); #endregion #region Namespace - /// - ///

Sets

- ///

The namespace in which to place the generated bindings.

- ///
- [Pure] - public static T SetNamespace(this T toolSettings, string @namespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Namespace = @namespace; - return toolSettings; - } - /// - ///

Resets

- ///

The namespace in which to place the generated bindings.

- ///
- [Pure] - public static T ResetNamespace(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Namespace = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Namespace))] + public static T SetNamespace(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Namespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Namespace))] + public static T ResetNamespace(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.Namespace)); #endregion #region NativeTypeNamesToStrip - /// - ///

Sets

- ///

The contents to strip from the generated NativeTypeName attributes.

- ///
- [Pure] - public static T SetNativeTypeNamesToStrip(this T toolSettings, string nativeTypeNamesToStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.NativeTypeNamesToStrip = nativeTypeNamesToStrip; - return toolSettings; - } - /// - ///

Resets

- ///

The contents to strip from the generated NativeTypeName attributes.

- ///
- [Pure] - public static T ResetNativeTypeNamesToStrip(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.NativeTypeNamesToStrip = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.NativeTypeNamesToStrip))] + public static T SetNativeTypeNamesToStrip(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.NativeTypeNamesToStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.NativeTypeNamesToStrip))] + public static T ResetNativeTypeNamesToStrip(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.NativeTypeNamesToStrip)); #endregion #region OutputMode - /// - ///

Sets

- ///

The mode describing how the information collected from the headers are presented in the resultant bindings.

- ///
- [Pure] - public static T SetOutputMode(this T toolSettings, ClangSharpPInvokeGeneratorOutputMode outputMode) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.OutputMode = outputMode; - return toolSettings; - } - /// - ///

Resets

- ///

The mode describing how the information collected from the headers are presented in the resultant bindings.

- ///
- [Pure] - public static T ResetOutputMode(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.OutputMode = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.OutputMode))] + public static T SetOutputMode(this T o, ClangSharpPInvokeGeneratorOutputMode v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.OutputMode, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.OutputMode))] + public static T ResetOutputMode(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.OutputMode)); #endregion #region Output - /// - ///

Sets

- ///

The output location to write the generated bindings to.

- ///
- [Pure] - public static T SetOutput(this T toolSettings, string output) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Output = output; - return toolSettings; - } - /// - ///

Resets

- ///

The output location to write the generated bindings to.

- ///
- [Pure] - public static T ResetOutput(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Output = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Output))] + public static T SetOutput(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Output, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Output))] + public static T ResetOutput(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.Output)); #endregion #region PrefixStrip - /// - ///

Sets to a new list

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T SetPrefixStrip(this T toolSettings, params string[] prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.PrefixStripInternal = prefixStrip.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T SetPrefixStrip(this T toolSettings, IEnumerable prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.PrefixStripInternal = prefixStrip.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T AddPrefixStrip(this T toolSettings, params string[] prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.PrefixStripInternal.AddRange(prefixStrip); - return toolSettings; - } - /// - ///

Adds values to

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T AddPrefixStrip(this T toolSettings, IEnumerable prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.PrefixStripInternal.AddRange(prefixStrip); - return toolSettings; - } - /// - ///

Clears

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T ClearPrefixStrip(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.PrefixStripInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T RemovePrefixStrip(this T toolSettings, params string[] prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(prefixStrip); - toolSettings.PrefixStripInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

The prefix to strip from the generated method bindings.

- ///
- [Pure] - public static T RemovePrefixStrip(this T toolSettings, IEnumerable prefixStrip) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(prefixStrip); - toolSettings.PrefixStripInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T SetPrefixStrip(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T SetPrefixStrip(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T AddPrefixStrip(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T AddPrefixStrip(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T RemovePrefixStrip(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T RemovePrefixStrip(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.PrefixStrip, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.PrefixStrip))] + public static T ClearPrefixStrip(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.PrefixStrip)); #endregion #region Remap - /// - ///

Sets to a new list

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T SetRemap(this T toolSettings, params string[] remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.RemapInternal = remap.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T SetRemap(this T toolSettings, IEnumerable remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.RemapInternal = remap.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T AddRemap(this T toolSettings, params string[] remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.RemapInternal.AddRange(remap); - return toolSettings; - } - /// - ///

Adds values to

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T AddRemap(this T toolSettings, IEnumerable remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.RemapInternal.AddRange(remap); - return toolSettings; - } - /// - ///

Clears

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T ClearRemap(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.RemapInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T RemoveRemap(this T toolSettings, params string[] remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(remap); - toolSettings.RemapInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A declaration name to be remapped to another name during binding generation.

- ///
- [Pure] - public static T RemoveRemap(this T toolSettings, IEnumerable remap) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(remap); - toolSettings.RemapInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T SetRemap(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T SetRemap(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T AddRemap(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T AddRemap(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T RemoveRemap(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T RemoveRemap(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Remap, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Remap))] + public static T ClearRemap(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Remap)); #endregion #region Std - /// - ///

Sets

- ///

Language standard to compile for.

- ///
- [Pure] - public static T SetStd(this T toolSettings, string std) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Std = std; - return toolSettings; - } - /// - ///

Resets

- ///

Language standard to compile for.

- ///
- [Pure] - public static T ResetStd(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.Std = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Std))] + public static T SetStd(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Std, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Std))] + public static T ResetStd(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.Std)); #endregion #region TestOutput - /// - ///

Sets

- ///

The output location to write the generated tests to.

- ///
- [Pure] - public static T SetTestOutput(this T toolSettings, string testOutput) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TestOutput = testOutput; - return toolSettings; - } - /// - ///

Resets

- ///

The output location to write the generated tests to.

- ///
- [Pure] - public static T ResetTestOutput(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TestOutput = null; - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.TestOutput))] + public static T SetTestOutput(this T o, string v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.TestOutput, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.TestOutput))] + public static T ResetTestOutput(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Remove(() => o.TestOutput)); #endregion #region Traverse - /// - ///

Sets to a new list

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T SetTraverse(this T toolSettings, params string[] traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TraverseInternal = traverse.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T SetTraverse(this T toolSettings, IEnumerable traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TraverseInternal = traverse.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T AddTraverse(this T toolSettings, params string[] traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TraverseInternal.AddRange(traverse); - return toolSettings; - } - /// - ///

Adds values to

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T AddTraverse(this T toolSettings, IEnumerable traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TraverseInternal.AddRange(traverse); - return toolSettings; - } - /// - ///

Clears

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T ClearTraverse(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.TraverseInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T RemoveTraverse(this T toolSettings, params string[] traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(traverse); - toolSettings.TraverseInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A file name included either directly or indirectly by -f that should be traversed during binding generation.

- ///
- [Pure] - public static T RemoveTraverse(this T toolSettings, IEnumerable traverse) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(traverse); - toolSettings.TraverseInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T SetTraverse(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T SetTraverse(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T AddTraverse(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T AddTraverse(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T RemoveTraverse(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T RemoveTraverse(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.Traverse, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.Traverse))] + public static T ClearTraverse(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.Traverse)); #endregion #region WithAccessSpecifier - /// - ///

Sets to a new list

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithAccessSpecifier(this T toolSettings, params string[] withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAccessSpecifierInternal = withAccessSpecifier.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithAccessSpecifier(this T toolSettings, IEnumerable withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAccessSpecifierInternal = withAccessSpecifier.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithAccessSpecifier(this T toolSettings, params string[] withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAccessSpecifierInternal.AddRange(withAccessSpecifier); - return toolSettings; - } - /// - ///

Adds values to

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithAccessSpecifier(this T toolSettings, IEnumerable withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAccessSpecifierInternal.AddRange(withAccessSpecifier); - return toolSettings; - } - /// - ///

Clears

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithAccessSpecifier(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAccessSpecifierInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithAccessSpecifier(this T toolSettings, params string[] withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withAccessSpecifier); - toolSettings.WithAccessSpecifierInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

An access specifier to be used with the given qualified or remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithAccessSpecifier(this T toolSettings, IEnumerable withAccessSpecifier) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withAccessSpecifier); - toolSettings.WithAccessSpecifierInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T SetWithAccessSpecifier(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T SetWithAccessSpecifier(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T AddWithAccessSpecifier(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T AddWithAccessSpecifier(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T RemoveWithAccessSpecifier(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T RemoveWithAccessSpecifier(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithAccessSpecifier, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAccessSpecifier))] + public static T ClearWithAccessSpecifier(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithAccessSpecifier)); #endregion #region WithAttribute - /// - ///

Sets to a new list

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithAttribute(this T toolSettings, params string[] withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAttributeInternal = withAttribute.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithAttribute(this T toolSettings, IEnumerable withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAttributeInternal = withAttribute.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithAttribute(this T toolSettings, params string[] withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAttributeInternal.AddRange(withAttribute); - return toolSettings; - } - /// - ///

Adds values to

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithAttribute(this T toolSettings, IEnumerable withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAttributeInternal.AddRange(withAttribute); - return toolSettings; - } - /// - ///

Clears

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithAttribute(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithAttributeInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithAttribute(this T toolSettings, params string[] withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withAttribute); - toolSettings.WithAttributeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

An attribute to be added to the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithAttribute(this T toolSettings, IEnumerable withAttribute) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withAttribute); - toolSettings.WithAttributeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T SetWithAttribute(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T SetWithAttribute(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T AddWithAttribute(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T AddWithAttribute(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T RemoveWithAttribute(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T RemoveWithAttribute(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithAttribute, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithAttribute))] + public static T ClearWithAttribute(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithAttribute)); #endregion #region WithCallConv - /// - ///

Sets to a new list

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithCallConv(this T toolSettings, params string[] withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithCallConvInternal = withCallConv.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithCallConv(this T toolSettings, IEnumerable withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithCallConvInternal = withCallConv.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithCallConv(this T toolSettings, params string[] withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithCallConvInternal.AddRange(withCallConv); - return toolSettings; - } - /// - ///

Adds values to

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithCallConv(this T toolSettings, IEnumerable withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithCallConvInternal.AddRange(withCallConv); - return toolSettings; - } - /// - ///

Clears

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithCallConv(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithCallConvInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithCallConv(this T toolSettings, params string[] withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withCallConv); - toolSettings.WithCallConvInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A calling convention to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithCallConv(this T toolSettings, IEnumerable withCallConv) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withCallConv); - toolSettings.WithCallConvInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T SetWithCallConv(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T SetWithCallConv(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T AddWithCallConv(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T AddWithCallConv(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T RemoveWithCallConv(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T RemoveWithCallConv(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithCallConv, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithCallConv))] + public static T ClearWithCallConv(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithCallConv)); #endregion #region WithClass - /// - ///

Sets to a new list

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithClass(this T toolSettings, params string[] withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithClassInternal = withClass.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithClass(this T toolSettings, IEnumerable withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithClassInternal = withClass.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithClass(this T toolSettings, params string[] withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithClassInternal.AddRange(withClass); - return toolSettings; - } - /// - ///

Adds values to

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithClass(this T toolSettings, IEnumerable withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithClassInternal.AddRange(withClass); - return toolSettings; - } - /// - ///

Clears

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithClass(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithClassInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithClass(this T toolSettings, params string[] withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withClass); - toolSettings.WithClassInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A class to be used for the given remapped constant or function declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithClass(this T toolSettings, IEnumerable withClass) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withClass); - toolSettings.WithClassInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T SetWithClass(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T SetWithClass(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T AddWithClass(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T AddWithClass(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T RemoveWithClass(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T RemoveWithClass(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithClass, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithClass))] + public static T ClearWithClass(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithClass)); #endregion #region WithGuid - /// - ///

Sets to a new list

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithGuid(this T toolSettings, params string[] withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithGuidInternal = withGuid.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithGuid(this T toolSettings, IEnumerable withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithGuidInternal = withGuid.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithGuid(this T toolSettings, params string[] withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithGuidInternal.AddRange(withGuid); - return toolSettings; - } - /// - ///

Adds values to

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithGuid(this T toolSettings, IEnumerable withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithGuidInternal.AddRange(withGuid); - return toolSettings; - } - /// - ///

Clears

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithGuid(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithGuidInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithGuid(this T toolSettings, params string[] withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withGuid); - toolSettings.WithGuidInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A GUID to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithGuid(this T toolSettings, IEnumerable withGuid) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withGuid); - toolSettings.WithGuidInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T SetWithGuid(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T SetWithGuid(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T AddWithGuid(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T AddWithGuid(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T RemoveWithGuid(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T RemoveWithGuid(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithGuid, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithGuid))] + public static T ClearWithGuid(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithGuid)); #endregion #region WithLibraryPath - /// - ///

Sets to a new list

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithLibraryPath(this T toolSettings, params string[] withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithLibraryPathInternal = withLibraryPath.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithLibraryPath(this T toolSettings, IEnumerable withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithLibraryPathInternal = withLibraryPath.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithLibraryPath(this T toolSettings, params string[] withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithLibraryPathInternal.AddRange(withLibraryPath); - return toolSettings; - } - /// - ///

Adds values to

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithLibraryPath(this T toolSettings, IEnumerable withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithLibraryPathInternal.AddRange(withLibraryPath); - return toolSettings; - } - /// - ///

Clears

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithLibraryPath(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithLibraryPathInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithLibraryPath(this T toolSettings, params string[] withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withLibraryPath); - toolSettings.WithLibraryPathInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A library path to be used for the given declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithLibraryPath(this T toolSettings, IEnumerable withLibraryPath) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withLibraryPath); - toolSettings.WithLibraryPathInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T SetWithLibraryPath(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T SetWithLibraryPath(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T AddWithLibraryPath(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T AddWithLibraryPath(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T RemoveWithLibraryPath(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T RemoveWithLibraryPath(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithLibraryPath, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithLibraryPath))] + public static T ClearWithLibraryPath(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithLibraryPath)); #endregion #region WithManualImport - /// - ///

Sets to a new list

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithManualImport(this T toolSettings, params string[] withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithManualImportInternal = withManualImport.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithManualImport(this T toolSettings, IEnumerable withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithManualImportInternal = withManualImport.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithManualImport(this T toolSettings, params string[] withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithManualImportInternal.AddRange(withManualImport); - return toolSettings; - } - /// - ///

Adds values to

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithManualImport(this T toolSettings, IEnumerable withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithManualImportInternal.AddRange(withManualImport); - return toolSettings; - } - /// - ///

Clears

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithManualImport(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithManualImportInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithManualImport(this T toolSettings, params string[] withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withManualImport); - toolSettings.WithManualImportInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A remapped function name to be treated as a manual import during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithManualImport(this T toolSettings, IEnumerable withManualImport) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withManualImport); - toolSettings.WithManualImportInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T SetWithManualImport(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T SetWithManualImport(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T AddWithManualImport(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T AddWithManualImport(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T RemoveWithManualImport(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T RemoveWithManualImport(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithManualImport, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithManualImport))] + public static T ClearWithManualImport(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithManualImport)); #endregion #region WithNamespace - /// - ///

Sets to a new list

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithNamespace(this T toolSettings, params string[] withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithNamespaceInternal = withNamespace.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithNamespace(this T toolSettings, IEnumerable withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithNamespaceInternal = withNamespace.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithNamespace(this T toolSettings, params string[] withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithNamespaceInternal.AddRange(withNamespace); - return toolSettings; - } - /// - ///

Adds values to

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithNamespace(this T toolSettings, IEnumerable withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithNamespaceInternal.AddRange(withNamespace); - return toolSettings; - } - /// - ///

Clears

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithNamespace(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithNamespaceInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithNamespace(this T toolSettings, params string[] withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withNamespace); - toolSettings.WithNamespaceInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A namespace to be used for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithNamespace(this T toolSettings, IEnumerable withNamespace) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withNamespace); - toolSettings.WithNamespaceInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T SetWithNamespace(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T SetWithNamespace(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T AddWithNamespace(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T AddWithNamespace(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T RemoveWithNamespace(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T RemoveWithNamespace(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithNamespace, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithNamespace))] + public static T ClearWithNamespace(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithNamespace)); #endregion #region WithPacking - /// - ///

Sets to a new list

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T SetWithPacking(this T toolSettings, params string[] withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithPackingInternal = withPacking.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T SetWithPacking(this T toolSettings, IEnumerable withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithPackingInternal = withPacking.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T AddWithPacking(this T toolSettings, params string[] withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithPackingInternal.AddRange(withPacking); - return toolSettings; - } - /// - ///

Adds values to

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T AddWithPacking(this T toolSettings, IEnumerable withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithPackingInternal.AddRange(withPacking); - return toolSettings; - } - /// - ///

Clears

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T ClearWithPacking(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithPackingInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithPacking(this T toolSettings, params string[] withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withPacking); - toolSettings.WithPackingInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

Overrides the StructLayoutAttribute.Pack property for the given type. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithPacking(this T toolSettings, IEnumerable withPacking) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withPacking); - toolSettings.WithPackingInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T SetWithPacking(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T SetWithPacking(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T AddWithPacking(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T AddWithPacking(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T RemoveWithPacking(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T RemoveWithPacking(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithPacking, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithPacking))] + public static T ClearWithPacking(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithPacking)); #endregion #region WithSetLastError - /// - ///

Sets to a new list

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T SetWithSetLastError(this T toolSettings, params string[] withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSetLastErrorInternal = withSetLastError.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T SetWithSetLastError(this T toolSettings, IEnumerable withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSetLastErrorInternal = withSetLastError.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T AddWithSetLastError(this T toolSettings, params string[] withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSetLastErrorInternal.AddRange(withSetLastError); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T AddWithSetLastError(this T toolSettings, IEnumerable withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSetLastErrorInternal.AddRange(withSetLastError); - return toolSettings; - } - /// - ///

Clears

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T ClearWithSetLastError(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSetLastErrorInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithSetLastError(this T toolSettings, params string[] withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withSetLastError); - toolSettings.WithSetLastErrorInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add the SetLastError=true modifier to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithSetLastError(this T toolSettings, IEnumerable withSetLastError) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withSetLastError); - toolSettings.WithSetLastErrorInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T SetWithSetLastError(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T SetWithSetLastError(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T AddWithSetLastError(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T AddWithSetLastError(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T RemoveWithSetLastError(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T RemoveWithSetLastError(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithSetLastError, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSetLastError))] + public static T ClearWithSetLastError(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithSetLastError)); #endregion #region WithSuppressGCTransition - /// - ///

Sets to a new list

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T SetWithSuppressGCTransition(this T toolSettings, params string[] withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSuppressGCTransitionInternal = withSuppressGCTransition.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T SetWithSuppressGCTransition(this T toolSettings, IEnumerable withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSuppressGCTransitionInternal = withSuppressGCTransition.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T AddWithSuppressGCTransition(this T toolSettings, params string[] withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSuppressGCTransitionInternal.AddRange(withSuppressGCTransition); - return toolSettings; - } - /// - ///

Adds values to

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T AddWithSuppressGCTransition(this T toolSettings, IEnumerable withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSuppressGCTransitionInternal.AddRange(withSuppressGCTransition); - return toolSettings; - } - /// - ///

Clears

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T ClearWithSuppressGCTransition(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithSuppressGCTransitionInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithSuppressGCTransition(this T toolSettings, params string[] withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withSuppressGCTransition); - toolSettings.WithSuppressGCTransitionInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

Add the SuppressGCTransition calling convention to a given DllImport or UnmanagedFunctionPointer. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithSuppressGCTransition(this T toolSettings, IEnumerable withSuppressGCTransition) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withSuppressGCTransition); - toolSettings.WithSuppressGCTransitionInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T SetWithSuppressGCTransition(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T SetWithSuppressGCTransition(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T AddWithSuppressGCTransition(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T AddWithSuppressGCTransition(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T RemoveWithSuppressGCTransition(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T RemoveWithSuppressGCTransition(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithSuppressGCTransition, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithSuppressGCTransition))] + public static T ClearWithSuppressGCTransition(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithSuppressGCTransition)); #endregion #region WithTransparentStruct - /// - ///

Sets to a new list

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithTransparentStruct(this T toolSettings, params string[] withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTransparentStructInternal = withTransparentStruct.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithTransparentStruct(this T toolSettings, IEnumerable withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTransparentStructInternal = withTransparentStruct.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithTransparentStruct(this T toolSettings, params string[] withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTransparentStructInternal.AddRange(withTransparentStruct); - return toolSettings; - } - /// - ///

Adds values to

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithTransparentStruct(this T toolSettings, IEnumerable withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTransparentStructInternal.AddRange(withTransparentStruct); - return toolSettings; - } - /// - ///

Clears

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithTransparentStruct(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTransparentStructInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithTransparentStruct(this T toolSettings, params string[] withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withTransparentStruct); - toolSettings.WithTransparentStructInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A remapped type name to be treated as a transparent wrapper during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithTransparentStruct(this T toolSettings, IEnumerable withTransparentStruct) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withTransparentStruct); - toolSettings.WithTransparentStructInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T SetWithTransparentStruct(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T SetWithTransparentStruct(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T AddWithTransparentStruct(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T AddWithTransparentStruct(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T RemoveWithTransparentStruct(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T RemoveWithTransparentStruct(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithTransparentStruct, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithTransparentStruct))] + public static T ClearWithTransparentStruct(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithTransparentStruct)); #endregion #region WithType - /// - ///

Sets to a new list

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithType(this T toolSettings, params string[] withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTypeInternal = withType.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithType(this T toolSettings, IEnumerable withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTypeInternal = withType.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithType(this T toolSettings, params string[] withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTypeInternal.AddRange(withType); - return toolSettings; - } - /// - ///

Adds values to

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithType(this T toolSettings, IEnumerable withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTypeInternal.AddRange(withType); - return toolSettings; - } - /// - ///

Clears

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithType(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithTypeInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithType(this T toolSettings, params string[] withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withType); - toolSettings.WithTypeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A type to be used for the given enum declaration during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithType(this T toolSettings, IEnumerable withType) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withType); - toolSettings.WithTypeInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T SetWithType(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T SetWithType(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T AddWithType(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T AddWithType(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T RemoveWithType(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T RemoveWithType(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithType, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithType))] + public static T ClearWithType(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithType)); #endregion #region WithUsing - /// - ///

Sets to a new list

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithUsing(this T toolSettings, params string[] withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithUsingInternal = withUsing.ToList(); - return toolSettings; - } - /// - ///

Sets to a new list

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T SetWithUsing(this T toolSettings, IEnumerable withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithUsingInternal = withUsing.ToList(); - return toolSettings; - } - /// - ///

Adds values to

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithUsing(this T toolSettings, params string[] withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithUsingInternal.AddRange(withUsing); - return toolSettings; - } - /// - ///

Adds values to

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T AddWithUsing(this T toolSettings, IEnumerable withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithUsingInternal.AddRange(withUsing); - return toolSettings; - } - /// - ///

Clears

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T ClearWithUsing(this T toolSettings) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - toolSettings.WithUsingInternal.Clear(); - return toolSettings; - } - /// - ///

Removes values from

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithUsing(this T toolSettings, params string[] withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withUsing); - toolSettings.WithUsingInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } - /// - ///

Removes values from

- ///

A using directive to be included for the given remapped declaration name during binding generation. Supports wildcards.

- ///
- [Pure] - public static T RemoveWithUsing(this T toolSettings, IEnumerable withUsing) where T : ClangSharpPInvokeGeneratorSettings - { - toolSettings = toolSettings.NewInstance(); - var hashSet = new HashSet(withUsing); - toolSettings.WithUsingInternal.RemoveAll(x => hashSet.Contains(x)); - return toolSettings; - } + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T SetWithUsing(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T SetWithUsing(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.Set(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T AddWithUsing(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T AddWithUsing(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.AddCollection(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T RemoveWithUsing(this T o, params string[] v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T RemoveWithUsing(this T o, IEnumerable v) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.RemoveCollection(() => o.WithUsing, v)); + /// + [Pure] [Builder(Type = typeof(ClangSharpPInvokeGeneratorSettings), Property = nameof(ClangSharpPInvokeGeneratorSettings.WithUsing))] + public static T ClearWithUsing(this T o) where T : ClangSharpPInvokeGeneratorSettings => o.Modify(b => b.ClearCollection(() => o.WithUsing)); #endregion } #endregion #region ClangSharpPInvokeGeneratorConfigOption -/// -/// Used within . -/// +/// Used within . [PublicAPI] [Serializable] [ExcludeFromCodeCoverage] @@ -2806,9 +848,7 @@ public static implicit operator ClangSharpPInvokeGeneratorConfigOption(string va } #endregion #region ClangSharpPInvokeGeneratorOutputMode -/// -/// Used within . -/// +/// Used within . [PublicAPI] [Serializable] [ExcludeFromCodeCoverage] diff --git a/build/Build/ClangSharpPInvokeGeneratorTasks.cs b/build/Build/ClangSharpPInvokeGeneratorTasks.cs deleted file mode 100644 index facce97c..00000000 --- a/build/Build/ClangSharpPInvokeGeneratorTasks.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2023 Maintainers of NUKE. -// Distributed under the MIT License. -// https://github.com/nuke-build/nuke/blob/master/LICENSE - -using Nuke.Common.Tooling; - -namespace Nuke.Common.Tools.ClangSharpPInvokeGenerator -{ - public partial class ClangSharpPInvokeGeneratorTasks - { - public static void CustomExitHandler(ToolSettings toolSettings, IProcess process) - { - process.AssertNonNegativeExitCode(); - } - } -} diff --git a/build/Build/IGenerate.cs b/build/Build/IGenerate.cs index 51d30540..5b7a7da5 100644 --- a/build/Build/IGenerate.cs +++ b/build/Build/IGenerate.cs @@ -38,13 +38,9 @@ interface IGenerate : IBuild .Produces(ArtifactsDirectory / "log" / "*.*") .Executes(() => { - var codegens = new[] { compatible_codegen, default_codegen, latest_codegen }; - foreach (var codegen in codegens) - { - GenerateBindingsForSDL2(codegen); - GenerateBindingsForSDL2Image(codegen); - GenerateBindingsForSDL2TTF(codegen); - } + GenerateBindingsForSDL2(latest_codegen); + GenerateBindingsForSDL2Image(latest_codegen); + GenerateBindingsForSDL2TTF(latest_codegen); }); private void GenerateBindingsForSDL2(ClangSharpPInvokeGeneratorConfigOption codegen) @@ -58,10 +54,10 @@ private void GenerateBindingsForSDL2(ClangSharpPInvokeGeneratorConfigOption code generate_tests_xunit, multi_file ) - .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") + .SetHeaderFiles(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(GetOutput(codegen)) - .SetTestOutput(GetTestOutput(codegen)) + .SetOutput(OutputPath) + .SetTestOutput(TestOutputPath) .SetWithType ( "SDL_EventType=uint", @@ -322,7 +318,7 @@ private void GenerateBindingsForSDL2(ClangSharpPInvokeGeneratorConfigOption code .SetLibraryPath("SDL2") .SetMethodClassName("SDL") .SetPrefixStrip("SDL_") - .SetFileDirectory(GetFileDirectory("SDL2")) + .SetFileDirectories(GetFileDirectory("SDL2")) ); } @@ -337,10 +333,10 @@ private void GenerateBindingsForSDL2Image(ClangSharpPInvokeGeneratorConfigOption generate_tests_xunit, multi_file ) - .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") + .SetHeaderFiles(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(GetOutput(codegen)) - .SetTestOutput(GetTestOutput(codegen)) + .SetOutput(OutputPath) + .SetTestOutput(TestOutputPath) .SetWithType ( "SDL_EventType=uint", @@ -358,7 +354,7 @@ private void GenerateBindingsForSDL2Image(ClangSharpPInvokeGeneratorConfigOption .SetLibraryPath("SDL2_image") .SetMethodClassName("IMG") .SetPrefixStrip("IMG_") - .SetFileDirectory(GetFileDirectory("SDL2_image")) + .SetFileDirectories(GetFileDirectory("SDL2_image")) .SetIncludeDirectory(GetIncludeDirectory("SDL2")) ); } @@ -373,10 +369,10 @@ private void GenerateBindingsForSDL2TTF(ClangSharpPInvokeGeneratorConfigOption c generate_macro_bindings, generate_tests_xunit, multi_file ) - .SetHeaderFile(RootDirectory / "build" / "Build" / "Header.txt") + .SetHeaderFiles(RootDirectory / "build" / "Build" / "Header.txt") .SetNamespace("SDL2Sharp.Interop") - .SetOutput(GetOutput(codegen)) - .SetTestOutput(GetTestOutput(codegen)) + .SetOutput(OutputPath) + .SetTestOutput(TestOutputPath) .SetWithType ( "SDL_EventType=uint", @@ -398,46 +394,14 @@ private void GenerateBindingsForSDL2TTF(ClangSharpPInvokeGeneratorConfigOption c .SetLibraryPath("SDL2_ttf") .SetMethodClassName("TTF") .SetPrefixStrip("TTF_") - .SetFileDirectory(GetFileDirectory("SDL2_ttf")) + .SetFileDirectories(GetFileDirectory("SDL2_ttf")) .SetIncludeDirectory(GetIncludeDirectory("SDL2")) ); } - private AbsolutePath GetOutput(ClangSharpPInvokeGeneratorConfigOption codegen) - { - if (codegen == compatible_codegen) - { - return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "compatible"; - } - if (codegen == default_codegen) - { - return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "default"; - } - if (codegen == latest_codegen) - { - return RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen" / "latest"; - } - - throw new NotSupportedException("The specified option is not supported."); - } + private AbsolutePath OutputPath => RootDirectory / "sources" / "SDL2Sharp.Interop" / "codegen"; - private AbsolutePath GetTestOutput(ClangSharpPInvokeGeneratorConfigOption codegen) - { - if (codegen == compatible_codegen) - { - return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "compatible"; - } - if (codegen == default_codegen) - { - return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "default"; - } - if (codegen == latest_codegen) - { - return RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen" / "latest"; - } - - throw new NotSupportedException("The specified option is not supported."); - } + private AbsolutePath TestOutputPath => RootDirectory / "tests" / "SDL2Sharp.Interop.Tests" / "codegen"; private AbsolutePath GetFileDirectory(string packageId) => GetIncludeDirectory(packageId); diff --git a/build/Build/IRelease.cs b/build/Build/IRelease.cs index 622f3703..2622d631 100644 --- a/build/Build/IRelease.cs +++ b/build/Build/IRelease.cs @@ -47,7 +47,7 @@ void PublishOnAzure(AbsolutePath packagePath) .SetSource("https://pkgs.dev.azure.com/ronaldvanmanen/_packaging/ronaldvanmanen/nuget/v3/index.json") .SetApiKey("AzureDevOps") .SetNonInteractive(IsServerBuild) - .SetProcessArgumentConfigurator(arguments => arguments.Add("-SkipDuplicate")) + .SetProcessAdditionalArguments("-SkipDuplicate") ); } @@ -58,7 +58,7 @@ void PublishOnGitHub(AbsolutePath packagePath) .SetSource("https://nuget.pkg.github.com/ronaldvanmanen/index.json") .SetApiKey(GitHubActions.Token) .SetNonInteractive(IsServerBuild) - .SetProcessArgumentConfigurator(arguments => arguments.Add("-SkipDuplicate")) + .SetProcessAdditionalArguments("-SkipDuplicate") ); } } diff --git a/build/Build/IRestore.cs b/build/Build/IRestore.cs index 25fd4994..6a3cc889 100644 --- a/build/Build/IRestore.cs +++ b/build/Build/IRestore.cs @@ -31,13 +31,12 @@ interface IRestore : IBuild .Produces(ArtifactsDirectory / "log" / "*.*") .Executes(() => { - DotNetRestore(settings => settings - .SetProjectFile(Solution) - .SetVerbosity(Verbosity.ToDotNetVerbosity()) - .SetProcessArgumentConfigurator(arguments => arguments - .Add("--interactive", IsLocalBuild) - .Add("/property:NuGetInteractive=false", IsLocalBuild) - ) - ); + DotNetRestore(settings => + { + return settings.SetProjectFile(Solution) + .SetVerbosity(Verbosity.ToDotNetVerbosity()) + .AddProcessAdditionalArguments(IsLocalBuild, "--interactive") + .AddProcessAdditionalArguments(IsLocalBuild, "/property:NuGetInteractive=true"); + }); }); } diff --git a/build/Build/ISetup.cs b/build/Build/ISetup.cs index e976b1ba..95b4f3bc 100644 --- a/build/Build/ISetup.cs +++ b/build/Build/ISetup.cs @@ -20,10 +20,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net.Http; using System.Runtime.InteropServices; -using Microsoft.Win32; using Nuke.Common; using Nuke.Common.Tooling; using Nuke.Common.Tools.PowerShell; @@ -35,28 +33,10 @@ partial interface ISetup : IBuild { - private static readonly Dictionary _downloadUris = new() - { - { new Version(4, 5, 1), "https://go.microsoft.com/fwlink/?linkid=321335&clcid=0x409" }, - { new Version(4, 5, 2), "https://go.microsoft.com/fwlink/?linkid=397673&clcid=0x409" }, - { new Version(4, 6), "https://go.microsoft.com/fwlink/?linkid=2099469" }, - { new Version(4, 6, 1), "https://go.microsoft.com/fwlink/?linkid=2099470" }, - { new Version(4, 6, 2), "https://go.microsoft.com/fwlink/?linkid=2099466" }, - { new Version(4, 7), "https://go.microsoft.com/fwlink/?linkid=2099465" }, - { new Version(4, 7, 1), "https://go.microsoft.com/fwlink/?linkid=2099382" }, - { new Version(4, 7, 2), "https://go.microsoft.com/fwlink/?linkid=874338" }, - { new Version(4, 8), "https://go.microsoft.com/fwlink/?linkid=2088517" }, - { new Version(4, 8, 1), "https://go.microsoft.com/fwlink/?linkid=2203306" } - }; - private Tool Bash => ToolResolver.GetPathTool("bash"); private Tool Chmod => ToolResolver.GetPathTool("chmod"); - private Tool Echo => ToolResolver.GetPathTool("echo"); - - private Tool Sudo => ToolResolver.GetPathTool("sudo"); - public Target Setup => _ => _ .After(target => target.Clean) .Produces(ArtifactsDirectory / "log" / "*.*") @@ -68,24 +48,11 @@ partial interface ISetup : IBuild private void InstallDotNet() { - var targetFrameworkVersions = GetTargetFrameworkVersions(); - foreach (var version in targetFrameworkVersions.Where(version => version.Major >= 5)) + var versions = GetTargetFrameworkVersions(); + foreach (var version in versions) { InstallDotNet(version); } - - if (IsOSPlatform(OSPlatform.Windows)) - { - foreach (var version in targetFrameworkVersions.Where(version => version.Major < 5)) - { - InstallDotNetFramework(version); - } - } - - if (IsOSPlatform(OSPlatform.Linux)) - { - InstallMono(); - } } private void InstallDotNet(Version version) @@ -98,7 +65,6 @@ private void InstallDotNet(Version version) Serilog.Log.Information($"Install latest release of .NET {version}."); PowerShell(settings => settings - .SetExecutionPolicy("ByPass") .SetFile(script) .SetFileArguments("-Architecture", Architecture, "-Channel", version.ToString(2), "-InstallDir", installDirectory, "-NoPath", "-Version", "latest") .SetProcessEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1") @@ -133,89 +99,12 @@ private void InstallDotNet(Version version) } } - private void InstallDotNetFramework(Version version) - { - if (IsDotNetFrameworkInstalled(version)) - { - Serilog.Log.Information($"Microsoft .NET Framework {version} Developer Pack or Targeting Pack is already installed."); - } - else - { - Serilog.Log.Information($"Download Microsoft .NET Framework {version} Developer Pack."); - if (!_downloadUris.TryGetValue(version, out var downloadUri)) - { - throw new PlatformNotSupportedException($"Microsoft .NET Framework {version} Developer Pack configuration is missing."); - } - var downloadPath = TemporaryDirectory / $"NDP{version}-DevPack-ENU.exe"; - HttpDownloadFile(downloadUri, downloadPath, clientConfigurator: ConfigureHttpClient); - Serilog.Log.Information($"Install Microsoft .NET Framework {version} Developer Pack."); - StartProcess(downloadPath, "/quiet /norestart").WaitForExit(); - } - } - private HttpClient ConfigureHttpClient(HttpClient client) { client.Timeout = TimeSpan.FromMinutes(1); return client; } -#pragma warning disable CA1416 // Validate platform compatibility - private bool IsDotNetFrameworkInstalled(Version version) - { - var uninstallKeyPaths = new[] { - @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", - @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" - }; - foreach (var uninstallKeyPath in uninstallKeyPaths) - { - using var uninstallKey = Registry.LocalMachine.OpenSubKey(uninstallKeyPath); - var uninstallSubKeyNames = uninstallKey.GetSubKeyNames(); - foreach (var uninstallSubKeyName in uninstallSubKeyNames) - { - using var uninstallSubKey = uninstallKey.OpenSubKey(uninstallSubKeyName); - var displayName = (string)uninstallSubKey.GetValue("DisplayName"); - if (displayName == $"Microsoft .NET Framework {version} Developer Pack" || - displayName == $"Microsoft .NET Framework {version} Multi-Targeting Pack" || - displayName == $"Microsoft .NET Framework {version} Targeting Pack") - { - return true; - } - } - } - return false; - } -#pragma warning restore CA1416 // Validate platform compatibility - - private void InstallMono() - { - if (Linux.IsUbuntu1604OrHigher) - { - if (Linux.IsUbuntu2004) - { - Sudo("apt-get install ca-certificates gnupg"); - Sudo("gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"); - Echo("'deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list"); - } - else if (Linux.IsUbuntu1804) - { - Sudo("apt-get install ca-certificates gnupg"); - Sudo("gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"); - Echo("'deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list"); - } - else if (Linux.IsUbuntu1604) - { - Sudo("apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"); - Sudo("apt-get install apt-transport-https ca-certificates"); - Echo("'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list"); - } - - Sudo("apt-get update"); - - Sudo("apt-get install mono-devel"); - } - } - - private void InstallAzureArtifactsCredentialProvider() { if (IsOSPlatform(OSPlatform.Windows)) @@ -227,6 +116,6 @@ private void InstallAzureArtifactsCredentialProvider() { Serilog.Log.Information($"Install Azure Artifacts Credential Provider"); StartShell("sh -c \"$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)\""); - }; + } } } diff --git a/build/Build/ITest.cs b/build/Build/ITest.cs index 65e0d82b..92d98e98 100644 --- a/build/Build/ITest.cs +++ b/build/Build/ITest.cs @@ -44,7 +44,7 @@ interface ITest : IBuild .SetNoBuild(true) .SetVerbosity(Verbosity.ToDotNetVerbosity()) .SetFramework(targetFramework) - .SetProcessArgumentConfigurator(_ => _.Add("-- RunConfiguration.DisableAppDomain=true")) + .SetProcessAdditionalArguments("-- RunConfiguration.DisableAppDomain=true") ); } } diff --git a/build/Build/Linux.cs b/build/Build/Linux.cs deleted file mode 100644 index 28adcb59..00000000 --- a/build/Build/Linux.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using System.Runtime.InteropServices; - -static partial class Linux -{ - private static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); - - public static bool IsUbuntu => IsDistroAndVersion("ubuntu"); - - public static bool IsUbuntu1604 => IsDistroAndVersion("ubuntu", 16, 4); - - public static bool IsUbuntu1604OrHigher => IsDistroAndVersionOrHigher("ubuntu", 16, 4); - - public static bool IsUbuntu1804 => IsDistroAndVersion("ubuntu", 18, 04); - - public static bool IsUbuntu2004 => IsDistroAndVersion("ubuntu", 20, 04); - - private static Version ToVersion(string versionString) - { - // In some distros/versions we cannot discover the distro version; return something valid. - // Pick a high version number, since this seems to happen on newer distros. - if (string.IsNullOrEmpty(versionString)) - { - versionString = new Version(int.MaxValue, int.MaxValue).ToString(); - } - - try - { - if (versionString.Contains('.')) - { - return new Version(versionString); - } - - // minor version is required by Version - // let's default it to 0 - return new Version(int.Parse(versionString), 0); - } - catch (Exception exc) - { - throw new FormatException($"Failed to parse version string: '{versionString}'", exc); - } - } - - private static DistroInfo GetDistroInfo() - { - var result = new DistroInfo(); - - if (File.Exists("/etc/os-release")) - { - foreach (var line in File.ReadAllLines("/etc/os-release")) - { - if (line.StartsWith("ID=", StringComparison.Ordinal)) - { - result.Id = line[3..].Trim('"', '\''); - } - else if (line.StartsWith("VERSION_ID=", StringComparison.Ordinal)) - { - result.VersionId = ToVersion(line[11..].Trim('"', '\'')); - } - } - } - - result.Id ??= "Linux"; - result.VersionId ??= ToVersion(string.Empty); - return result; - } - - private static bool IsDistroAndVersion(string distroId, int major = -1, int minor = -1, int build = -1, int revision = -1) - { - return IsDistroAndVersion(distro => distro == distroId, major, minor, build, revision); - } - - private static bool IsDistroAndVersionOrHigher(string distroId, int major = -1, int minor = -1, int build = -1, int revision = -1) - { - return IsDistroAndVersionOrHigher(distro => distro == distroId, major, minor, build, revision); - } - - private static bool IsDistroAndVersion(Predicate distroPredicate, int major = -1, int minor = -1, int build = -1, int revision = -1) - { - if (IsLinux) - { - var distroInfo = GetDistroInfo(); - if (distroPredicate(distroInfo.Id) && VersionEquivalentTo(major, minor, build, revision, distroInfo.VersionId)) - { - return true; - } - } - - return false; - } - - private static bool IsDistroAndVersionOrHigher(Predicate distroPredicate, int major = -1, int minor = -1, int build = -1, int revision = -1) - { - if (IsLinux) - { - var distroInfo = GetDistroInfo(); - if (distroPredicate(distroInfo.Id) && VersionEquivalentToOrHigher(major, minor, build, revision, distroInfo.VersionId)) - { - return true; - } - } - - return false; - } - - private static bool VersionEquivalentTo(int major, int minor, int build, int revision, Version actualVersionId) - { - return (major == -1 || major == actualVersionId.Major) - && (minor == -1 || minor == actualVersionId.Minor) - && (build == -1 || build == actualVersionId.Build) - && (revision == -1 || revision == actualVersionId.Revision); - } - - private static bool VersionEquivalentToOrHigher(int major, int minor, int build, int revision, Version actualVersionId) - { - return - VersionEquivalentTo(major, minor, build, revision, actualVersionId) || - actualVersionId.Major > major || - (actualVersionId.Major == major && (actualVersionId.Minor > minor || - (actualVersionId.Minor == minor && (actualVersionId.Build > build || - (actualVersionId.Build == build && (actualVersionId.Revision > revision || - (actualVersionId.Revision == revision))))))); - } - - private struct DistroInfo - { - public string Id { get; set; } - - public Version VersionId { get; set; } - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs b/build/Build/ToolOptionsExtensions.cs similarity index 73% rename from sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs rename to build/Build/ToolOptionsExtensions.cs index ad4f4be3..d06b13ae 100644 --- a/sources/SDL2Sharp.Interop/codegen/default/IMG_Animation.cs +++ b/build/Build/ToolOptionsExtensions.cs @@ -18,18 +18,17 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Interop +using Nuke.Common.Tooling; + +public static class ToolOptionsExtensions { - public unsafe partial struct IMG_Animation + public static T AddProcessAdditionalArguments(this T options, bool condition, params string[] arguments) + where T : ToolOptions { - public int w; - - public int h; - - public int count; - - public SDL_Surface** frames; - - public int* delays; + if (condition) + { + return options.AddProcessAdditionalArguments(arguments); + } + return options; } -} +} \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 00000000..69aa839c --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "8.0.405", + "rollForward": "latestFeature" + } +} diff --git a/nuget.config b/nuget.config index ec291272..fb5d2b5b 100644 --- a/nuget.config +++ b/nuget.config @@ -16,4 +16,12 @@ + + + + + + + + \ No newline at end of file diff --git a/samples/TunnelEffect/TunnelEffect.csproj b/samples/TunnelEffect/TunnelEffect.csproj index 26956d4a..7934b626 100644 --- a/samples/TunnelEffect/TunnelEffect.csproj +++ b/samples/TunnelEffect/TunnelEffect.csproj @@ -20,6 +20,10 @@
+ + + + diff --git a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj index af650f66..da532c65 100644 --- a/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj +++ b/sources/SDL2Sharp.Interop/SDL2Sharp.Interop.csproj @@ -1,49 +1,21 @@  - net8.0;net6.0;net461;netstandard2.0 + net8.0 AnyCPU Provides SDL2 bindings written in C#. SDL2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/ID3D11Device.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/ID3D11Device.cs rename to sources/SDL2Sharp.Interop/codegen/ID3D11Device.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/ID3D12Device.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/ID3D12Device.cs rename to sources/SDL2Sharp.Interop/codegen/ID3D12Device.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/IDirect3DDevice9.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/IDirect3DDevice9.cs rename to sources/SDL2Sharp.Interop/codegen/IDirect3DDevice9.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/IMG.cs b/sources/SDL2Sharp.Interop/codegen/IMG.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/IMG.cs rename to sources/SDL2Sharp.Interop/codegen/IMG.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/IMG_Animation.cs b/sources/SDL2Sharp.Interop/codegen/IMG_Animation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/IMG_Animation.cs rename to sources/SDL2Sharp.Interop/codegen/IMG_Animation.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/IMG_InitFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/IMG_InitFlags.cs rename to sources/SDL2Sharp.Interop/codegen/IMG_InitFlags.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL.cs b/sources/SDL2Sharp.Interop/codegen/SDL.cs similarity index 99% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL.cs rename to sources/SDL2Sharp.Interop/codegen/SDL.cs index 0d0b98b7..3812e4cc 100644 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL.cs +++ b/sources/SDL2Sharp.Interop/codegen/SDL.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ArrayOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ArrayOrder.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ArrayOrder.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/SDL_AudioCVT.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/default/SDL_AudioCVT.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_AudioCVT.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_AudioDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_AudioDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/SDL_AudioSpec.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/default/SDL_AudioSpec.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_AudioSpec.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/SDL_AudioStatus.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioStatus.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_AudioStatus.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/SDL_BitmapOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_BitmapOrder.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_BitmapOrder.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/SDL_BlendFactor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendFactor.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_BlendFactor.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_BlendMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendMode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_BlendMode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/SDL_BlendOperation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlendOperation.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_BlendOperation.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/SDL_BlitMap.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_BlitMap.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_BlitMap.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Color.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Color.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Color.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_CommonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_CommonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_CommonEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ControllerAxisEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerAxisEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ControllerAxisEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ControllerButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ControllerButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ControllerDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ControllerDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ControllerSensorEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerSensorEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ControllerSensorEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ControllerTouchpadEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerTouchpadEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ControllerTouchpadEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Cursor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Cursor.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Cursor.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DUMMY_ENUM.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DUMMY_ENUM.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DUMMY_ENUM.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DisplayEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DisplayEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DisplayEventID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayEventID.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DisplayEventID.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DisplayMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayMode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DisplayMode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DisplayOrientation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DisplayOrientation.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DisplayOrientation.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DollarGestureEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DollarGestureEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DollarGestureEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_DropEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_DropEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_DropEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Event.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_Event.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Event.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/SDL_EventType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventType.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_EventType.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/SDL_FPoint.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_FPoint.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_FPoint.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/SDL_FRect.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_FRect.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_FRect.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/SDL_FlashOperation.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_FlashOperation.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_FlashOperation.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GLContextResetNotification.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLContextResetNotification.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GLContextResetNotification.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GLattr.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLattr.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GLattr.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GLcontextFlag.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextFlag.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GLcontextFlag.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GLcontextReleaseFlag.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLcontextReleaseFlag.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GLcontextReleaseFlag.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GLprofile.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_GLprofile.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GLprofile.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/SDL_GUID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_GUID.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_GUID.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/SDL_HintPriority.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintPriority.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_HintPriority.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/SDL_HitTestResult.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTestResult.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_HitTestResult.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyAxisEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyAxisEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyAxisEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyBallEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBallEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyBallEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyBatteryEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyBatteryEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyBatteryEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyDeviceEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyDeviceEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyDeviceEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoyHatEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoyHatEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoyHatEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoystickPowerLevel.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickPowerLevel.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoystickPowerLevel.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/SDL_JoystickType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_JoystickType.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_JoystickType.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_KeyCode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyCode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_KeyCode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_KeyboardEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_KeyboardEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_KeyboardEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Keymod.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keymod.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Keymod.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Keysym.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Keysym.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Keysym.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/SDL_LogCategory.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogCategory.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_LogCategory.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/SDL_LogPriority.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogPriority.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_LogPriority.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_MouseButtonEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseButtonEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_MouseButtonEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_MouseMotionEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseMotionEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_MouseMotionEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/SDL_MouseWheelDirection.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelDirection.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_MouseWheelDirection.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_MouseWheelEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_MouseWheelEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_MouseWheelEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_MultiGestureEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_MultiGestureEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_MultiGestureEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_OSEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_OSEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_OSEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/SDL_PackedLayout.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedLayout.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_PackedLayout.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/SDL_PackedOrder.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_PackedOrder.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_PackedOrder.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Palette.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Palette.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Palette.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/SDL_PixelFormat.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormat.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_PixelFormat.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/SDL_PixelFormatEnum.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormatEnum.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_PixelFormatEnum.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/SDL_PixelType.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelType.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_PixelType.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Point.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Point.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Point.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_QuitEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_QuitEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_QuitEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/SDL_RWops.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/default/SDL_RWops.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_RWops.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Rect.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Rect.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Rect.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Renderer.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Renderer.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Renderer.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/SDL_RendererFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlags.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_RendererFlags.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/SDL_RendererFlip.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererFlip.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_RendererFlip.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/SDL_RendererInfo.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererInfo.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_RendererInfo.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_ScaleMode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_ScaleMode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_ScaleMode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Scancode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Scancode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Scancode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_SensorEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_SensorEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_SensorEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Surface.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Surface.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Surface.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_SysWMEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_SysWMEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/SDL_SysWMmsg.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_SysWMmsg.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_SysWMmsg.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/SDL_SystemCursor.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_SystemCursor.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_SystemCursor.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TextEditingEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TextEditingEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TextEditingExtEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingExtEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TextEditingExtEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TextInputEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/latest/SDL_TextInputEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TextInputEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Texture.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Texture.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Texture.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TextureAccess.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureAccess.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TextureAccess.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TextureModulate.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextureModulate.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TextureModulate.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_TouchFingerEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_TouchFingerEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_TouchFingerEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_UserEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_UserEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_UserEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Vertex.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Vertex.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Vertex.cs diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/SDL_VirtualJoystickDesc.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/default/SDL_VirtualJoystickDesc.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_VirtualJoystickDesc.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/SDL_Window.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_Window.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_Window.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/SDL_WindowEvent.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEvent.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_WindowEvent.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/SDL_WindowEventID.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowEventID.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_WindowEventID.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/SDL_WindowFlags.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowFlags.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_WindowFlags.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/SDL_YUV_CONVERSION_MODE.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_YUV_CONVERSION_MODE.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_YUV_CONVERSION_MODE.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/SDL_bool.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_bool.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_bool.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/SDL_errorcode.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_errorcode.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_errorcode.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/SDL_eventaction.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_eventaction.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_eventaction.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/SDL_version.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/SDL_version.cs rename to sources/SDL2Sharp.Interop/codegen/SDL_version.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/TTF.cs b/sources/SDL2Sharp.Interop/codegen/TTF.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/TTF.cs rename to sources/SDL2Sharp.Interop/codegen/TTF.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/TTF_Direction.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/TTF_Direction.cs rename to sources/SDL2Sharp.Interop/codegen/TTF_Direction.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/_SDL_AudioStream.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/_SDL_AudioStream.cs rename to sources/SDL2Sharp.Interop/codegen/_SDL_AudioStream.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/_SDL_Joystick.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/_SDL_Joystick.cs rename to sources/SDL2Sharp.Interop/codegen/_SDL_Joystick.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/_SDL_iconv_t.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/_SDL_iconv_t.cs rename to sources/SDL2Sharp.Interop/codegen/_SDL_iconv_t.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/_TTF_Font.cs similarity index 100% rename from sources/SDL2Sharp.Interop/codegen/compatible/_TTF_Font.cs rename to sources/SDL2Sharp.Interop/codegen/_TTF_Font.cs diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs deleted file mode 100644 index ffe9f358..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL.cs +++ /dev/null @@ -1,2387 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class SDL - { - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)] - public static extern int Init([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_InitSubSystem", ExactSpelling = true)] - public static extern int InitSubSystem([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QuitSubSystem", ExactSpelling = true)] - public static extern void QuitSubSystem([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WasInit", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint WasInit([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")] - public const uint SDL_INIT_TIMER = 0x00000001U; - - [NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")] - public const uint SDL_INIT_AUDIO = 0x00000010U; - - [NativeTypeName("#define SDL_INIT_VIDEO 0x00000020u")] - public const uint SDL_INIT_VIDEO = 0x00000020U; - - [NativeTypeName("#define SDL_INIT_JOYSTICK 0x00000200u")] - public const uint SDL_INIT_JOYSTICK = 0x00000200U; - - [NativeTypeName("#define SDL_INIT_HAPTIC 0x00001000u")] - public const uint SDL_INIT_HAPTIC = 0x00001000U; - - [NativeTypeName("#define SDL_INIT_GAMECONTROLLER 0x00002000u")] - public const uint SDL_INIT_GAMECONTROLLER = 0x00002000U; - - [NativeTypeName("#define SDL_INIT_EVENTS 0x00004000u")] - public const uint SDL_INIT_EVENTS = 0x00004000U; - - [NativeTypeName("#define SDL_INIT_SENSOR 0x00008000u")] - public const uint SDL_INIT_SENSOR = 0x00008000U; - - [NativeTypeName("#define SDL_INIT_NOPARACHUTE 0x00100000u")] - public const uint SDL_INIT_NOPARACHUTE = 0x00100000U; - - [NativeTypeName("#define SDL_INIT_EVERYTHING ( \\\r\n SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \\\r\n SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \\\r\n )")] - public const uint SDL_INIT_EVERYTHING = (0x00000001U | 0x00000010U | 0x00000020U | 0x00004000U | 0x00000200U | 0x00001000U | 0x00002000U | 0x00008000U); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDrivers", ExactSpelling = true)] - public static extern int GetNumAudioDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetAudioDriver(int index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioInit", ExactSpelling = true)] - public static extern int AudioInit([NativeTypeName("const char *")] sbyte* driver_name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioQuit", ExactSpelling = true)] - public static extern void AudioQuit(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentAudioDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetCurrentAudioDriver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudio", ExactSpelling = true)] - public static extern int OpenAudio(SDL_AudioSpec* desired, SDL_AudioSpec* obtained); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDevices", ExactSpelling = true)] - public static extern int GetNumAudioDevices(int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetAudioDeviceName(int index, int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceSpec", ExactSpelling = true)] - public static extern int GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec* spec); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultAudioInfo", ExactSpelling = true)] - public static extern int GetDefaultAudioInfo([NativeTypeName("char **")] sbyte** name, SDL_AudioSpec* spec, int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudioDevice", ExactSpelling = true)] - [return: NativeTypeName("SDL_AudioDeviceID")] - public static extern uint OpenAudioDevice([NativeTypeName("const char *")] sbyte* device, int iscapture, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* desired, SDL_AudioSpec* obtained, int allowed_changes); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioStatus", ExactSpelling = true)] - public static extern SDL_AudioStatus GetAudioStatus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceStatus", ExactSpelling = true)] - public static extern SDL_AudioStatus GetAudioDeviceStatus([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudio", ExactSpelling = true)] - public static extern void PauseAudio(int pause_on); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudioDevice", ExactSpelling = true)] - public static extern void PauseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev, int pause_on); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadWAV_RW", ExactSpelling = true)] - public static extern SDL_AudioSpec* LoadWAV_RW(SDL_RWops* src, int freesrc, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeWAV", ExactSpelling = true)] - public static extern void FreeWAV([NativeTypeName("Uint8 *")] byte* audio_buf); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_BuildAudioCVT", ExactSpelling = true)] - public static extern int BuildAudioCVT(SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort src_format, [NativeTypeName("Uint8")] byte src_channels, int src_rate, [NativeTypeName("SDL_AudioFormat")] ushort dst_format, [NativeTypeName("Uint8")] byte dst_channels, int dst_rate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertAudio", ExactSpelling = true)] - public static extern int ConvertAudio(SDL_AudioCVT* cvt); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NewAudioStream", ExactSpelling = true)] - [return: NativeTypeName("SDL_AudioStream *")] - public static extern _SDL_AudioStream* NewAudioStream([NativeTypeName("const SDL_AudioFormat")] ushort src_format, [NativeTypeName("const Uint8")] byte src_channels, [NativeTypeName("const int")] int src_rate, [NativeTypeName("const SDL_AudioFormat")] ushort dst_format, [NativeTypeName("const Uint8")] byte dst_channels, [NativeTypeName("const int")] int dst_rate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamPut", ExactSpelling = true)] - public static extern int AudioStreamPut([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, [NativeTypeName("const void *")] void* buf, int len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamGet", ExactSpelling = true)] - public static extern int AudioStreamGet([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, void* buf, int len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamAvailable", ExactSpelling = true)] - public static extern int AudioStreamAvailable([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamFlush", ExactSpelling = true)] - public static extern int AudioStreamFlush([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamClear", ExactSpelling = true)] - public static extern void AudioStreamClear([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeAudioStream", ExactSpelling = true)] - public static extern void FreeAudioStream([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudio", ExactSpelling = true)] - public static extern void MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("Uint32")] uint len, int volume); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudioFormat", ExactSpelling = true)] - public static extern void MixAudioFormat([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("SDL_AudioFormat")] ushort format, [NativeTypeName("Uint32")] uint len, int volume); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueueAudio", ExactSpelling = true)] - public static extern int QueueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, [NativeTypeName("const void *")] void* data, [NativeTypeName("Uint32")] uint len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DequeueAudio", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint DequeueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, void* data, [NativeTypeName("Uint32")] uint len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetQueuedAudioSize", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetQueuedAudioSize([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearQueuedAudio", ExactSpelling = true)] - public static extern void ClearQueuedAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudio", ExactSpelling = true)] - public static extern void LockAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudioDevice", ExactSpelling = true)] - public static extern void LockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudio", ExactSpelling = true)] - public static extern void UnlockAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudioDevice", ExactSpelling = true)] - public static extern void UnlockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudio", ExactSpelling = true)] - public static extern void CloseAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudioDevice", ExactSpelling = true)] - public static extern void CloseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFF)")] - public const int SDL_AUDIO_MASK_BITSIZE = (0xFF); - - [NativeTypeName("#define SDL_AUDIO_MASK_DATATYPE (1<<8)")] - public const int SDL_AUDIO_MASK_DATATYPE = (1 << 8); - - [NativeTypeName("#define SDL_AUDIO_MASK_ENDIAN (1<<12)")] - public const int SDL_AUDIO_MASK_ENDIAN = (1 << 12); - - [NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1<<15)")] - public const int SDL_AUDIO_MASK_SIGNED = (1 << 15); - - [NativeTypeName("#define AUDIO_U8 0x0008")] - public const int AUDIO_U8 = 0x0008; - - [NativeTypeName("#define AUDIO_S8 0x8008")] - public const int AUDIO_S8 = 0x8008; - - [NativeTypeName("#define AUDIO_U16LSB 0x0010")] - public const int AUDIO_U16LSB = 0x0010; - - [NativeTypeName("#define AUDIO_S16LSB 0x8010")] - public const int AUDIO_S16LSB = 0x8010; - - [NativeTypeName("#define AUDIO_U16MSB 0x1010")] - public const int AUDIO_U16MSB = 0x1010; - - [NativeTypeName("#define AUDIO_S16MSB 0x9010")] - public const int AUDIO_S16MSB = 0x9010; - - [NativeTypeName("#define AUDIO_U16 AUDIO_U16LSB")] - public const int AUDIO_U16 = 0x0010; - - [NativeTypeName("#define AUDIO_S16 AUDIO_S16LSB")] - public const int AUDIO_S16 = 0x8010; - - [NativeTypeName("#define AUDIO_S32LSB 0x8020")] - public const int AUDIO_S32LSB = 0x8020; - - [NativeTypeName("#define AUDIO_S32MSB 0x9020")] - public const int AUDIO_S32MSB = 0x9020; - - [NativeTypeName("#define AUDIO_S32 AUDIO_S32LSB")] - public const int AUDIO_S32 = 0x8020; - - [NativeTypeName("#define AUDIO_F32LSB 0x8120")] - public const int AUDIO_F32LSB = 0x8120; - - [NativeTypeName("#define AUDIO_F32MSB 0x9120")] - public const int AUDIO_F32MSB = 0x9120; - - [NativeTypeName("#define AUDIO_F32 AUDIO_F32LSB")] - public const int AUDIO_F32 = 0x8120; - - [NativeTypeName("#define AUDIO_U16SYS AUDIO_U16LSB")] - public const int AUDIO_U16SYS = 0x0010; - - [NativeTypeName("#define AUDIO_S16SYS AUDIO_S16LSB")] - public const int AUDIO_S16SYS = 0x8010; - - [NativeTypeName("#define AUDIO_S32SYS AUDIO_S32LSB")] - public const int AUDIO_S32SYS = 0x8020; - - [NativeTypeName("#define AUDIO_F32SYS AUDIO_F32LSB")] - public const int AUDIO_F32SYS = 0x8120; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001")] - public const int SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002")] - public const int SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004")] - public const int SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008")] - public const int SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)")] - public const int SDL_AUDIO_ALLOW_ANY_CHANGE = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008); - - [NativeTypeName("#define SDL_AUDIOCVT_MAX_FILTERS 9")] - public const int SDL_AUDIOCVT_MAX_FILTERS = 9; - - [NativeTypeName("#define SDL_MIX_MAXVOLUME 128")] - public const int SDL_MIX_MAXVOLUME = 128; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ComposeCustomBlendMode", ExactSpelling = true)] - public static extern SDL_BlendMode ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetError", ExactSpelling = true)] - public static extern int SetError([NativeTypeName("const char *")] sbyte* fmt, __arglist); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetError(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetErrorMsg", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* GetErrorMsg([NativeTypeName("char *")] sbyte* errstr, int maxlen); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearError", ExactSpelling = true)] - public static extern void ClearError(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Error", ExactSpelling = true)] - public static extern int Error(SDL_errorcode code); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PumpEvents", ExactSpelling = true)] - public static extern void PumpEvents(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PeepEvents", ExactSpelling = true)] - public static extern int PeepEvents(SDL_Event* events, int numevents, SDL_eventaction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvent", ExactSpelling = true)] - public static extern SDL_bool HasEvent([NativeTypeName("Uint32")] uint type); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvents", ExactSpelling = true)] - public static extern SDL_bool HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvent", ExactSpelling = true)] - public static extern void FlushEvent([NativeTypeName("Uint32")] uint type); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvents", ExactSpelling = true)] - public static extern void FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PollEvent", ExactSpelling = true)] - public static extern int PollEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEvent", ExactSpelling = true)] - public static extern int WaitEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEventTimeout", ExactSpelling = true)] - public static extern int WaitEventTimeout(SDL_Event* @event, int timeout); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PushEvent", ExactSpelling = true)] - public static extern int PushEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetEventFilter", ExactSpelling = true)] - public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEventFilter", ExactSpelling = true)] - public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] IntPtr* filter, void** userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddEventWatch", ExactSpelling = true)] - public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelEventWatch", ExactSpelling = true)] - public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FilterEvents", ExactSpelling = true)] - public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] IntPtr filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EventState", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte EventState([NativeTypeName("Uint32")] uint type, int state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RegisterEvents", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint RegisterEvents(int numevents); - - [NativeTypeName("#define SDL_RELEASED 0")] - public const int SDL_RELEASED = 0; - - [NativeTypeName("#define SDL_PRESSED 1")] - public const int SDL_PRESSED = 1; - - [NativeTypeName("#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)")] - public const int SDL_TEXTEDITINGEVENT_TEXT_SIZE = (32); - - [NativeTypeName("#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)")] - public const int SDL_TEXTINPUTEVENT_TEXT_SIZE = (32); - - [NativeTypeName("#define SDL_QUERY -1")] - public const int SDL_QUERY = -1; - - [NativeTypeName("#define SDL_IGNORE 0")] - public const int SDL_IGNORE = 0; - - [NativeTypeName("#define SDL_DISABLE 0")] - public const int SDL_DISABLE = 0; - - [NativeTypeName("#define SDL_ENABLE 1")] - public const int SDL_ENABLE = 1; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDToString", ExactSpelling = true)] - public static extern void GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDFromString", ExactSpelling = true)] - public static extern SDL_GUID GUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHintWithPriority", ExactSpelling = true)] - public static extern SDL_bool SetHintWithPriority([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value, SDL_HintPriority priority); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)] - public static extern SDL_bool SetHint([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHint", ExactSpelling = true)] - public static extern SDL_bool ResetHint([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHints", ExactSpelling = true)] - public static extern void ResetHints(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHint", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetHint([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHintBoolean", ExactSpelling = true)] - public static extern SDL_bool GetHintBoolean([NativeTypeName("const char *")] sbyte* name, SDL_bool default_value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddHintCallback", ExactSpelling = true)] - public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelHintCallback", ExactSpelling = true)] - public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] IntPtr callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearHints", ExactSpelling = true)] - public static extern void ClearHints(); - - [NativeTypeName("#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"SDL_ACCELEROMETER_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x4F, 0x4D, 0x45, 0x54, 0x45, 0x52, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x54, 0x41, 0x42, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x42, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ALLOW_TOPMOST \"SDL_ALLOW_TOPMOST\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x4F, 0x50, 0x4D, 0x4F, 0x53, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x4D, 0x41, 0x49, 0x4E, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x54, 0x52, 0x41, 0x50, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APP_NAME \"SDL_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS \"SDL_APPLE_TV_CONTROLLER_UI_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x49, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION \"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x52, 0x4F, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4F, 0x52, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"SDL_AUDIO_DEVICE_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"SDL_AUDIO_DEVICE_STREAM_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x52, 0x4F, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_RESAMPLING_MODE \"SDL_AUDIO_RESAMPLING_MODE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x52, 0x45, 0x53, 0x41, 0x4D, 0x50, 0x4C, 0x49, 0x4E, 0x47, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_JOYSTICKS \"SDL_AUTO_UPDATE_JOYSTICKS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_SENSORS \"SDL_AUTO_UPDATE_SENSORS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x53, 0x45, 0x4E, 0x53, 0x4F, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT \"SDL_BMP_SAVE_LEGACY_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x42, 0x4D, 0x50, 0x5F, 0x53, 0x41, 0x56, 0x45, 0x5F, 0x4C, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] - public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x4C, 0x41, 0x59, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x4F, 0x55, 0x4E, 0x44, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x49, 0x46, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x5F, 0x45, 0x4C, 0x45, 0x4D, 0x45, 0x4E, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ENABLE_STEAM_CONTROLLERS \"SDL_ENABLE_STEAM_CONTROLLERS\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EVENT_LOGGING \"SDL_EVENT_LOGGING\"")] - public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x5F, 0x4C, 0x4F, 0x47, 0x47, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_FORCE_RAISEWINDOW \"SDL_HINT_FORCE_RAISEWINDOW\"")] - public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x41, 0x49, 0x53, 0x45, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x00 }; - - [NativeTypeName("#define SDL_HINT_FRAMEBUFFER_ACCELERATION \"SDL_FRAMEBUFFER_ACCELERATION\"")] - public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG \"SDL_GAMECONTROLLERCONFIG\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"SDL_GAMECONTROLLERCONFIG_FILE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERTYPE \"SDL_GAMECONTROLLERTYPE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x54, 0x59, 0x50, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES \"SDL_GAMECONTROLLER_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT \"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x5F, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"SDL_GAMECONTROLLER_USE_BUTTON_LABELS\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GRAB_KEYBOARD \"SDL_GRAB_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IDLE_TIMER_DISABLED \"SDL_IOS_IDLE_TIMER_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x49, 0x44, 0x4C, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")] - public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")] - public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x5F, 0x55, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"SDL_IME_SUPPORT_EXTENDED_TEXT\"")] - public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x55, 0x50, 0x50, 0x4F, 0x52, 0x54, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")] - public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x49, 0x43, 0x41, 0x54, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS \"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI \"SDL_JOYSTICK_HIDAPI\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"SDL_JOYSTICK_HIDAPI_GAMECUBE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE \"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x52, 0x41, 0x4B, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS \"SDL_JOYSTICK_HIDAPI_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS \"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x43, 0x4F, 0x4D, 0x42, 0x49, 0x4E, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x56, 0x45, 0x52, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LUNA \"SDL_JOYSTICK_HIDAPI_LUNA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4C, 0x55, 0x4E, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC \"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4E, 0x49, 0x4E, 0x54, 0x45, 0x4E, 0x44, 0x4F, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x48, 0x49, 0x45, 0x4C, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS3 \"SDL_JOYSTICK_HIDAPI_PS3\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x33, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4 \"SDL_JOYSTICK_HIDAPI_PS4\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STADIA \"SDL_JOYSTICK_HIDAPI_STADIA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x41, 0x44, 0x49, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED \"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x43, 0x4F, 0x4E, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII \"SDL_JOYSTICK_HIDAPI_WII\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX \"SDL_JOYSTICK_HIDAPI_XBOX\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 \"SDL_JOYSTICK_HIDAPI_XBOX_360\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS \"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x57, 0x49, 0x52, 0x45, 0x4C, 0x45, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE \"SDL_JOYSTICK_HIDAPI_XBOX_ONE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT \"SDL_JOYSTICK_RAWINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x43, 0x4F, 0x52, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"SDL_JOYSTICK_ROG_CHAKRAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x4F, 0x47, 0x5F, 0x43, 0x48, 0x41, 0x4B, 0x52, 0x41, 0x4D, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_THREAD \"SDL_JOYSTICK_THREAD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5F, 0x44, 0x52, 0x4D, 0x5F, 0x4D, 0x41, 0x53, 0x54, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_DIGITAL_HATS \"SDL_LINUX_DIGITAL_HATS\"")] - public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_HAT_DEADZONES \"SDL_LINUX_HAT_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x48, 0x41, 0x54, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"SDL_LINUX_JOYSTICK_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"SDL_LINUX_JOYSTICK_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_BACKGROUND_APP \"SDL_MAC_BACKGROUND_APP\"")] - public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x41, 0x50, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")] - public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x43, 0x54, 0x52, 0x4C, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x52, 0x49, 0x47, 0x48, 0x54, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")] - public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x41, 0x54, 0x43, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"SDL_MOUSE_DOUBLE_CLICK_RADIUS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x44, 0x49, 0x55, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH \"SDL_MOUSE_FOCUS_CLICKTHROUGH\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x54, 0x48, 0x52, 0x4F, 0x55, 0x47, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"SDL_MOUSE_NORMAL_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x4E, 0x4F, 0x52, 0x4D, 0x41, 0x4C, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x43, 0x45, 0x4E, 0x54, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SCALING \"SDL_MOUSE_RELATIVE_SCALING\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE \"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x5F, 0x4D, 0x4F, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_AUTO_CAPTURE \"SDL_MOUSE_AUTO_CAPTURE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_NO_SIGNAL_HANDLERS \"SDL_NO_SIGNAL_HANDLERS\"")] - public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4E, 0x4F, 0x5F, 0x53, 0x49, 0x47, 0x4E, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x45, 0x53, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_IOS_ORIENTATIONS\"")] - public static ReadOnlySpan SDL_HINT_ORIENTATIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] - public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x4F, 0x4C, 0x4C, 0x5F, 0x53, 0x45, 0x4E, 0x54, 0x49, 0x4E, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_PREFERRED_LOCALES \"SDL_PREFERRED_LOCALES\"")] - public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x52, 0x45, 0x44, 0x5F, 0x4C, 0x4F, 0x43, 0x41, 0x4C, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION \"SDL_QTWAYLAND_CONTENT_ORIENTATION\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x4E, 0x54, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS \"SDL_QTWAYLAND_WINDOW_FLAGS\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x4C, 0x41, 0x47, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_BATCHING \"SDL_RENDER_BATCHING\"")] - public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x42, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_LINE_METHOD \"SDL_RENDER_LINE_METHOD\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x4E, 0x45, 0x5F, 0x4D, 0x45, 0x54, 0x48, 0x4F, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x31, 0x31, 0x5F, 0x44, 0x45, 0x42, 0x55, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"SDL_RENDER_DIRECT3D_THREADSAFE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x53, 0x41, 0x46, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"SDL_RENDER_LOGICAL_SIZE_MODE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_OPENGL_SHADERS \"SDL_RENDER_OPENGL_SHADERS\"")] - public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_SCALE_QUALITY \"SDL_RENDER_SCALE_QUALITY\"")] - public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x5F, 0x51, 0x55, 0x41, 0x4C, 0x49, 0x54, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_VSYNC \"SDL_RENDER_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_PS2_DYNAMIC_VSYNC \"SDL_PS2_DYNAMIC_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x53, 0x32, 0x5F, 0x44, 0x59, 0x4E, 0x41, 0x4D, 0x49, 0x43, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RETURN_KEY_HIDES_IME \"SDL_RETURN_KEY_HIDES_IME\"")] - public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x53, 0x5F, 0x49, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] - public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x50, 0x49, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME\"")] - public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x5F, 0x49, 0x4E, 0x48, 0x49, 0x42, 0x49, 0x54, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL\"")] - public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x45, 0x41, 0x4C, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_PRIORITY_POLICY \"SDL_THREAD_PRIORITY_POLICY\"")] - public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x50, 0x52, 0x49, 0x4F, 0x52, 0x49, 0x54, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_STACK_SIZE \"SDL_THREAD_STACK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x53, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TIMER_RESOLUTION \"SDL_TIMER_RESOLUTION\"")] - public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x52, 0x45, 0x53, 0x4F, 0x4C, 0x55, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TOUCH_MOUSE_EVENTS \"SDL_TOUCH_MOUSE_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE \"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x56, 0x49, 0x54, 0x41, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"SDL_TV_REMOTE_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x47, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x52, 0x41, 0x4E, 0x53, 0x50, 0x41, 0x52, 0x45, 0x4E, 0x43, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT \"SDL_VIDEO_EXTERNAL_CONTEXT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x58, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"SDL_VIDEO_HIGHDPI_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x48, 0x49, 0x47, 0x48, 0x44, 0x50, 0x49, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x46, 0x55, 0x4C, 0x4C, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x53, 0x50, 0x41, 0x43, 0x45, 0x53, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x49, 0x4E, 0x49, 0x4D, 0x49, 0x5A, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x4C, 0x4F, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR \"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION \"SDL_VIDEO_WAYLAND_MODE_EMULATION\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP \"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5F, 0x50, 0x49, 0x58, 0x45, 0x4C, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"SDL_VIDEO_FOREIGN_WINDOW_OPENGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"SDL_VIDEO_FOREIGN_WINDOW_VULKAN\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x55, 0x4C, 0x4B, 0x41, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x5F, 0x44, 0x33, 0x44, 0x43, 0x4F, 0x4D, 0x50, 0x49, 0x4C, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_FORCE_EGL \"SDL_VIDEO_X11_FORCE_EGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x45, 0x47, 0x4C, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x42, 0x59, 0x50, 0x41, 0x53, 0x53, 0x5F, 0x43, 0x4F, 0x4D, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_PING \"SDL_VIDEO_X11_NET_WM_PING\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x50, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"SDL_VIDEO_X11_WINDOW_VISUALID\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x49, 0x53, 0x55, 0x41, 0x4C, 0x49, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XINERAMA \"SDL_VIDEO_X11_XINERAMA\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x49, 0x4E, 0x45, 0x52, 0x41, 0x4D, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XRANDR \"SDL_VIDEO_X11_XRANDR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x52, 0x41, 0x4E, 0x44, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XVIDMODE \"SDL_VIDEO_X11_XVIDMODE\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x56, 0x49, 0x44, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_FACT_CHUNK \"SDL_WAVE_FACT_CHUNK\"")] - public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x46, 0x41, 0x43, 0x54, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE \"SDL_WAVE_RIFF_CHUNK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x52, 0x49, 0x46, 0x46, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_TRUNCATION \"SDL_WAVE_TRUNCATION\"")] - public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x54, 0x52, 0x55, 0x4E, 0x43, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING \"SDL_WINDOWS_DISABLE_THREAD_NAMING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x4E, 0x41, 0x4D, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS \"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x4E, 0x55, 0x5F, 0x4D, 0x4E, 0x45, 0x4D, 0x4F, 0x4E, 0x49, 0x43, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x4C, 0x4F, 0x4F, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS \"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4D, 0x55, 0x54, 0x45, 0x58, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x53, 0x45, 0x4D, 0x41, 0x50, 0x48, 0x4F, 0x52, 0x45, 0x5F, 0x4B, 0x45, 0x52, 0x4E, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON \"SDL_WINDOWS_INTRESOURCE_ICON\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"SDL_WINDOWS_INTRESOURCE_ICON_SMALL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x5F, 0x53, 0x4D, 0x41, 0x4C, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x4E, 0x4F, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x46, 0x34, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x33, 0x44, 0x39, 0x45, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_AWARENESS \"SDL_WINDOWS_DPI_AWARENESS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x41, 0x57, 0x41, 0x52, 0x45, 0x4E, 0x45, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_SCALING \"SDL_WINDOWS_DPI_SCALING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x43, 0x55, 0x52, 0x53, 0x4F, 0x52, 0x5F, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN \"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4E, 0x4F, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x5F, 0x57, 0x48, 0x45, 0x4E, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x55, 0x52, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] - public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x5F, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_DIRECTINPUT_ENABLED \"SDL_DIRECTINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x4F, 0x4C, 0x44, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x4D, 0x41, 0x50, 0x50, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"SDL_AUDIO_INCLUDE_MONITORS\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x49, 0x4E, 0x43, 0x4C, 0x55, 0x44, 0x45, 0x5F, 0x4D, 0x4F, 0x4E, 0x49, 0x54, 0x4F, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_X11_WINDOW_TYPE \"SDL_X11_WINDOW_TYPE\"")] - public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"SDL_QUIT_ON_LAST_WINDOW_CLOSE\"")] - public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x55, 0x49, 0x54, 0x5F, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x53, 0x54, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEODRIVER \"SDL_VIDEODRIVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIODRIVER \"SDL_AUDIODRIVER\"")] - public static ReadOnlySpan SDL_HINT_AUDIODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x45, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY \"SDL_TRACKPAD_IS_TOUCH_ONLY\"")] - public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x52, 0x41, 0x43, 0x4B, 0x50, 0x41, 0x44, 0x5F, 0x49, 0x53, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4F, 0x4E, 0x4C, 0x59, 0x00 }; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockJoysticks", ExactSpelling = true)] - public static extern void LockJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockJoysticks", ExactSpelling = true)] - public static extern void UnlockJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NumJoysticks", ExactSpelling = true)] - public static extern int NumJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNameForIndex", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickNameForIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPathForIndex", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickPathForIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDevicePlayerIndex", ExactSpelling = true)] - public static extern int JoystickGetDevicePlayerIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceGUID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetDeviceGUID(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceVendor", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceVendor(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProduct", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceProduct(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProductVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceProductVersion(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceType", ExactSpelling = true)] - public static extern SDL_JoystickType JoystickGetDeviceType(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickID")] - public static extern int JoystickGetDeviceInstanceID(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickOpen", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickOpen(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickFromInstanceID([NativeTypeName("SDL_JoystickID")] int instance_id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromPlayerIndex", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickFromPlayerIndex(int player_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtual", ExactSpelling = true)] - public static extern int JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtualEx", ExactSpelling = true)] - public static extern int JoystickAttachVirtualEx([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickDetachVirtual", ExactSpelling = true)] - public static extern int JoystickDetachVirtual(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickIsVirtual", ExactSpelling = true)] - public static extern SDL_bool JoystickIsVirtual(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualAxis", ExactSpelling = true)] - public static extern int JoystickSetVirtualAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualButton", ExactSpelling = true)] - public static extern int JoystickSetVirtualButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualHat", ExactSpelling = true)] - public static extern int JoystickSetVirtualHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickName([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPath", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickPath([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetPlayerIndex", ExactSpelling = true)] - public static extern int JoystickGetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetPlayerIndex", ExactSpelling = true)] - public static extern void JoystickSetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int player_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetGUID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetVendor", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetVendor([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProduct", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetProduct([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProductVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetProductVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetFirmwareVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetFirmwareVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetSerial", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickGetSerial([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetType", ExactSpelling = true)] - public static extern SDL_JoystickType JoystickGetType([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDString", ExactSpelling = true)] - public static extern void JoystickGetGUIDString([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDFromString", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetGUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetJoystickGUIDInfo", ExactSpelling = true)] - public static extern void GetJoystickGUIDInfo([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAttached", ExactSpelling = true)] - public static extern SDL_bool JoystickGetAttached([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickID")] - public static extern int JoystickInstanceID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumAxes", ExactSpelling = true)] - public static extern int JoystickNumAxes([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumBalls", ExactSpelling = true)] - public static extern int JoystickNumBalls([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumHats", ExactSpelling = true)] - public static extern int JoystickNumHats([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumButtons", ExactSpelling = true)] - public static extern int JoystickNumButtons([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickUpdate", ExactSpelling = true)] - public static extern void JoystickUpdate(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickEventState", ExactSpelling = true)] - public static extern int JoystickEventState(int state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxis", ExactSpelling = true)] - [return: NativeTypeName("Sint16")] - public static extern short JoystickGetAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxisInitialState", ExactSpelling = true)] - public static extern SDL_bool JoystickGetAxisInitialState([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetHat", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte JoystickGetHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetBall", ExactSpelling = true)] - public static extern int JoystickGetBall([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int ball, int* dx, int* dy); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetButton", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte JoystickGetButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumble", ExactSpelling = true)] - public static extern int JoystickRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumbleTriggers", ExactSpelling = true)] - public static extern int JoystickRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasLED", ExactSpelling = true)] - public static extern SDL_bool JoystickHasLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumble", ExactSpelling = true)] - public static extern SDL_bool JoystickHasRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumbleTriggers", ExactSpelling = true)] - public static extern SDL_bool JoystickHasRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetLED", ExactSpelling = true)] - public static extern int JoystickSetLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSendEffect", ExactSpelling = true)] - public static extern int JoystickSendEffect([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("const void *")] void* data, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickClose", ExactSpelling = true)] - public static extern void JoystickClose([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickCurrentPowerLevel", ExactSpelling = true)] - public static extern SDL_JoystickPowerLevel JoystickCurrentPowerLevel([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [NativeTypeName("#define SDL_IPHONE_MAX_GFORCE 5.0")] - public const double SDL_IPHONE_MAX_GFORCE = 5.0; - - [NativeTypeName("#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1")] - public const int SDL_VIRTUAL_JOYSTICK_DESC_VERSION = 1; - - [NativeTypeName("#define SDL_JOYSTICK_AXIS_MAX 32767")] - public const int SDL_JOYSTICK_AXIS_MAX = 32767; - - [NativeTypeName("#define SDL_JOYSTICK_AXIS_MIN -32768")] - public const int SDL_JOYSTICK_AXIS_MIN = -32768; - - [NativeTypeName("#define SDL_HAT_CENTERED 0x00")] - public const int SDL_HAT_CENTERED = 0x00; - - [NativeTypeName("#define SDL_HAT_UP 0x01")] - public const int SDL_HAT_UP = 0x01; - - [NativeTypeName("#define SDL_HAT_RIGHT 0x02")] - public const int SDL_HAT_RIGHT = 0x02; - - [NativeTypeName("#define SDL_HAT_DOWN 0x04")] - public const int SDL_HAT_DOWN = 0x04; - - [NativeTypeName("#define SDL_HAT_LEFT 0x08")] - public const int SDL_HAT_LEFT = 0x08; - - [NativeTypeName("#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)")] - public const int SDL_HAT_RIGHTUP = (0x02 | 0x01); - - [NativeTypeName("#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)")] - public const int SDL_HAT_RIGHTDOWN = (0x02 | 0x04); - - [NativeTypeName("#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)")] - public const int SDL_HAT_LEFTUP = (0x08 | 0x01); - - [NativeTypeName("#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)")] - public const int SDL_HAT_LEFTDOWN = (0x08 | 0x04); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardFocus", ExactSpelling = true)] - public static extern SDL_Window* GetKeyboardFocus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardState", ExactSpelling = true)] - [return: NativeTypeName("const Uint8 *")] - public static extern byte* GetKeyboardState(int* numkeys); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetKeyboard", ExactSpelling = true)] - public static extern void ResetKeyboard(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetModState", ExactSpelling = true)] - public static extern SDL_Keymod GetModState(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetModState", ExactSpelling = true)] - public static extern void SetModState(SDL_Keymod modstate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromScancode", ExactSpelling = true)] - [return: NativeTypeName("SDL_Keycode")] - public static extern int GetKeyFromScancode(SDL_Scancode scancode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromKey", ExactSpelling = true)] - public static extern SDL_Scancode GetScancodeFromKey([NativeTypeName("SDL_Keycode")] int key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetScancodeName(SDL_Scancode scancode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromName", ExactSpelling = true)] - public static extern SDL_Scancode GetScancodeFromName([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetKeyName([NativeTypeName("SDL_Keycode")] int key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromName", ExactSpelling = true)] - [return: NativeTypeName("SDL_Keycode")] - public static extern int GetKeyFromName([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StartTextInput", ExactSpelling = true)] - public static extern void StartTextInput(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputActive", ExactSpelling = true)] - public static extern SDL_bool IsTextInputActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StopTextInput", ExactSpelling = true)] - public static extern void StopTextInput(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearComposition", ExactSpelling = true)] - public static extern void ClearComposition(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputShown", ExactSpelling = true)] - public static extern SDL_bool IsTextInputShown(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextInputRect", ExactSpelling = true)] - public static extern void SetTextInputRect([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasScreenKeyboardSupport", ExactSpelling = true)] - public static extern SDL_bool HasScreenKeyboardSupport(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenKeyboardShown", ExactSpelling = true)] - public static extern SDL_bool IsScreenKeyboardShown(SDL_Window* window); - - [NativeTypeName("#define SDLK_SCANCODE_MASK (1<<30)")] - public const int SDLK_SCANCODE_MASK = (1 << 30); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseFocus", ExactSpelling = true)] - public static extern SDL_Window* GetMouseFocus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGlobalMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetGlobalMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetRelativeMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseInWindow", ExactSpelling = true)] - public static extern void WarpMouseInWindow(SDL_Window* window, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseGlobal", ExactSpelling = true)] - public static extern int WarpMouseGlobal(int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRelativeMouseMode", ExactSpelling = true)] - public static extern int SetRelativeMouseMode(SDL_bool enabled); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CaptureMouse", ExactSpelling = true)] - public static extern int CaptureMouse(SDL_bool enabled); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseMode", ExactSpelling = true)] - public static extern SDL_bool GetRelativeMouseMode(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateColorCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSystemCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateSystemCursor(SDL_SystemCursor id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetCursor", ExactSpelling = true)] - public static extern void SetCursor(SDL_Cursor* cursor); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCursor", ExactSpelling = true)] - public static extern SDL_Cursor* GetCursor(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultCursor", ExactSpelling = true)] - public static extern SDL_Cursor* GetDefaultCursor(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeCursor", ExactSpelling = true)] - public static extern void FreeCursor(SDL_Cursor* cursor); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowCursor", ExactSpelling = true)] - public static extern int ShowCursor(int toggle); - - [NativeTypeName("#define SDL_BUTTON_LEFT 1")] - public const int SDL_BUTTON_LEFT = 1; - - [NativeTypeName("#define SDL_BUTTON_MIDDLE 2")] - public const int SDL_BUTTON_MIDDLE = 2; - - [NativeTypeName("#define SDL_BUTTON_RIGHT 3")] - public const int SDL_BUTTON_RIGHT = 3; - - [NativeTypeName("#define SDL_BUTTON_X1 4")] - public const int SDL_BUTTON_X1 = 4; - - [NativeTypeName("#define SDL_BUTTON_X2 5")] - public const int SDL_BUTTON_X2 = 5; - - [NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)")] - public const int SDL_BUTTON_LMASK = (1 << ((1) - 1)); - - [NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)")] - public const int SDL_BUTTON_MMASK = (1 << ((2) - 1)); - - [NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)")] - public const int SDL_BUTTON_RMASK = (1 << ((3) - 1)); - - [NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)")] - public const int SDL_BUTTON_X1MASK = (1 << ((4) - 1)); - - [NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)")] - public const int SDL_BUTTON_X2MASK = (1 << ((5) - 1)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetPixelFormatName([NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PixelFormatEnumToMasks", ExactSpelling = true)] - public static extern SDL_bool PixelFormatEnumToMasks([NativeTypeName("Uint32")] uint format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MasksToPixelFormatEnum", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MasksToPixelFormatEnum(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocFormat", ExactSpelling = true)] - public static extern SDL_PixelFormat* AllocFormat([NativeTypeName("Uint32")] uint pixel_format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeFormat", ExactSpelling = true)] - public static extern void FreeFormat(SDL_PixelFormat* format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocPalette", ExactSpelling = true)] - public static extern SDL_Palette* AllocPalette(int ncolors); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPixelFormatPalette", ExactSpelling = true)] - public static extern int SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPaletteColors", ExactSpelling = true)] - public static extern int SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreePalette", ExactSpelling = true)] - public static extern void FreePalette(SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGB", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGBA", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGB", ExactSpelling = true)] - public static extern void GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGBA", ExactSpelling = true)] - public static extern void 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); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CalculateGammaRamp", ExactSpelling = true)] - public static extern void CalculateGammaRamp(float gamma, [NativeTypeName("Uint16 *")] ushort* ramp); - - [NativeTypeName("#define SDL_ALPHA_OPAQUE 255")] - public const int SDL_ALPHA_OPAQUE = 255; - - [NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")] - public const int SDL_ALPHA_TRANSPARENT = 0; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumRenderDrivers", ExactSpelling = true)] - public static extern int GetNumRenderDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDriverInfo", ExactSpelling = true)] - public static extern int GetRenderDriverInfo(int index, SDL_RendererInfo* info); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowAndRenderer", ExactSpelling = true)] - public static extern int CreateWindowAndRenderer(int width, int height, [NativeTypeName("Uint32")] uint window_flags, SDL_Window** window, SDL_Renderer** renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* CreateRenderer(SDL_Window* window, int index, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSoftwareRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* CreateSoftwareRenderer(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* GetRenderer(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetWindow", ExactSpelling = true)] - public static extern SDL_Window* RenderGetWindow(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererInfo", ExactSpelling = true)] - public static extern int GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererOutputSize", ExactSpelling = true)] - public static extern int GetRendererOutputSize(SDL_Renderer* renderer, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTexture", ExactSpelling = true)] - public static extern SDL_Texture* CreateTexture(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint format, int access, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTextureFromSurface", ExactSpelling = true)] - public static extern SDL_Texture* CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueryTexture", ExactSpelling = true)] - public static extern int QueryTexture(SDL_Texture* texture, [NativeTypeName("Uint32 *")] uint* format, int* access, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureColorMod", ExactSpelling = true)] - public static extern int SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureColorMod", ExactSpelling = true)] - public static extern int GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureAlphaMod", ExactSpelling = true)] - public static extern int SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureAlphaMod", ExactSpelling = true)] - public static extern int GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureBlendMode", ExactSpelling = true)] - public static extern int SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureBlendMode", ExactSpelling = true)] - public static extern int GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureScaleMode", ExactSpelling = true)] - public static extern int SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureScaleMode", ExactSpelling = true)] - public static extern int GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureUserData", ExactSpelling = true)] - public static extern int SetTextureUserData(SDL_Texture* texture, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureUserData", ExactSpelling = true)] - public static extern void* GetTextureUserData(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateTexture", ExactSpelling = true)] - public static extern int UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] void* pixels, int pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateYUVTexture", ExactSpelling = true)] - public static extern int UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateNVTexture", ExactSpelling = true)] - public static extern int UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTexture", ExactSpelling = true)] - public static extern int LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, void** pixels, int* pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTextureToSurface", ExactSpelling = true)] - public static extern int LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockTexture", ExactSpelling = true)] - public static extern void UnlockTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderTargetSupported", ExactSpelling = true)] - public static extern SDL_bool RenderTargetSupported(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderTarget", ExactSpelling = true)] - public static extern int SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderTarget", ExactSpelling = true)] - public static extern SDL_Texture* GetRenderTarget(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetLogicalSize", ExactSpelling = true)] - public static extern int RenderSetLogicalSize(SDL_Renderer* renderer, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetLogicalSize", ExactSpelling = true)] - public static extern void RenderGetLogicalSize(SDL_Renderer* renderer, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetIntegerScale", ExactSpelling = true)] - public static extern int RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetIntegerScale", ExactSpelling = true)] - public static extern SDL_bool RenderGetIntegerScale(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetViewport", ExactSpelling = true)] - public static extern int RenderSetViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetViewport", ExactSpelling = true)] - public static extern void RenderGetViewport(SDL_Renderer* renderer, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetClipRect", ExactSpelling = true)] - public static extern int RenderSetClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetClipRect", ExactSpelling = true)] - public static extern void RenderGetClipRect(SDL_Renderer* renderer, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderIsClipEnabled", ExactSpelling = true)] - public static extern SDL_bool RenderIsClipEnabled(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetScale", ExactSpelling = true)] - public static extern int RenderSetScale(SDL_Renderer* renderer, float scaleX, float scaleY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetScale", ExactSpelling = true)] - public static extern void RenderGetScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderWindowToLogical", ExactSpelling = true)] - public static extern void RenderWindowToLogical(SDL_Renderer* renderer, int windowX, int windowY, float* logicalX, float* logicalY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderLogicalToWindow", ExactSpelling = true)] - public static extern void RenderLogicalToWindow(SDL_Renderer* renderer, float logicalX, float logicalY, int* windowX, int* windowY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawColor", ExactSpelling = true)] - public static extern int SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawColor", ExactSpelling = true)] - public static extern int GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawBlendMode", ExactSpelling = true)] - public static extern int SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawBlendMode", ExactSpelling = true)] - public static extern int GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderClear", ExactSpelling = true)] - public static extern int RenderClear(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoint", ExactSpelling = true)] - public static extern int RenderDrawPoint(SDL_Renderer* renderer, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoints", ExactSpelling = true)] - public static extern int RenderDrawPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLine", ExactSpelling = true)] - public static extern int RenderDrawLine(SDL_Renderer* renderer, int x1, int y1, int x2, int y2); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLines", ExactSpelling = true)] - public static extern int RenderDrawLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRect", ExactSpelling = true)] - public static extern int RenderDrawRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRects", ExactSpelling = true)] - public static extern int RenderDrawRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRect", ExactSpelling = true)] - public static extern int RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRects", ExactSpelling = true)] - public static extern int RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopy", ExactSpelling = true)] - public static extern int RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyEx", ExactSpelling = true)] - public static extern int RenderCopyEx(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_Point *")] SDL_Point* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointF", ExactSpelling = true)] - public static extern int RenderDrawPointF(SDL_Renderer* renderer, float x, float y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointsF", ExactSpelling = true)] - public static extern int RenderDrawPointsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLineF", ExactSpelling = true)] - public static extern int RenderDrawLineF(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLinesF", ExactSpelling = true)] - public static extern int RenderDrawLinesF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectF", ExactSpelling = true)] - public static extern int RenderDrawRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectsF", ExactSpelling = true)] - public static extern int RenderDrawRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectF", ExactSpelling = true)] - public static extern int RenderFillRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectsF", ExactSpelling = true)] - public static extern int RenderFillRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyF", ExactSpelling = true)] - public static extern int RenderCopyF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyExF", ExactSpelling = true)] - public static extern int RenderCopyExF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometry", ExactSpelling = true)] - public static extern int 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("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometryRaw", ExactSpelling = true)] - public static extern int 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 *")] void* indices, int num_indices, int size_indices); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderReadPixels", ExactSpelling = true)] - public static extern int RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint format, void* pixels, int pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderPresent", ExactSpelling = true)] - public static extern void RenderPresent(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyTexture", ExactSpelling = true)] - public static extern void DestroyTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyRenderer", ExactSpelling = true)] - public static extern void DestroyRenderer(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFlush", ExactSpelling = true)] - public static extern int RenderFlush(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_BindTexture", ExactSpelling = true)] - public static extern int GL_BindTexture(SDL_Texture* texture, float* texw, float* texh); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnbindTexture", ExactSpelling = true)] - public static extern int GL_UnbindTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalLayer", ExactSpelling = true)] - public static extern void* RenderGetMetalLayer(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalCommandEncoder", ExactSpelling = true)] - public static extern void* RenderGetMetalCommandEncoder(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetVSync", ExactSpelling = true)] - public static extern int RenderSetVSync(SDL_Renderer* renderer, int vsync); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFile", ExactSpelling = true)] - public static extern SDL_RWops* RWFromFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("const char *")] sbyte* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFP", ExactSpelling = true)] - public static extern SDL_RWops* RWFromFP(void* fp, SDL_bool autoclose); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromMem", ExactSpelling = true)] - public static extern SDL_RWops* RWFromMem(void* mem, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromConstMem", ExactSpelling = true)] - public static extern SDL_RWops* RWFromConstMem([NativeTypeName("const void *")] void* mem, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocRW", ExactSpelling = true)] - public static extern SDL_RWops* AllocRW(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeRW", ExactSpelling = true)] - public static extern void FreeRW(SDL_RWops* area); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWsize", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWsize(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWseek", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWseek(SDL_RWops* context, [NativeTypeName("Sint64")] long offset, int whence); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWtell", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWtell(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWread", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr maxnum); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWwrite", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] UIntPtr size, [NativeTypeName("size_t")] UIntPtr num); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWclose", ExactSpelling = true)] - public static extern int RWclose(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile_RW", ExactSpelling = true)] - public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] UIntPtr* datasize, int freesrc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile", ExactSpelling = true)] - public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] UIntPtr* datasize); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadU8", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte ReadU8(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE16", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort ReadLE16(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE16", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort ReadBE16(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE32", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint ReadLE32(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE32", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint ReadBE32(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE64", ExactSpelling = true)] - [return: NativeTypeName("Uint64")] - public static extern ulong ReadLE64(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE64", ExactSpelling = true)] - [return: NativeTypeName("Uint64")] - public static extern ulong ReadBE64(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteU8", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE16", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE16", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE32", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE32", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE64", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE64", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); - - [NativeTypeName("#define SDL_RWOPS_UNKNOWN 0U")] - public const uint SDL_RWOPS_UNKNOWN = 0U; - - [NativeTypeName("#define SDL_RWOPS_WINFILE 1U")] - public const uint SDL_RWOPS_WINFILE = 1U; - - [NativeTypeName("#define SDL_RWOPS_STDFILE 2U")] - public const uint SDL_RWOPS_STDFILE = 2U; - - [NativeTypeName("#define SDL_RWOPS_JNIFILE 3U")] - public const uint SDL_RWOPS_JNIFILE = 3U; - - [NativeTypeName("#define SDL_RWOPS_MEMORY 4U")] - public const uint SDL_RWOPS_MEMORY = 4U; - - [NativeTypeName("#define SDL_RWOPS_MEMORY_RO 5U")] - public const uint SDL_RWOPS_MEMORY_RO = 5U; - - [NativeTypeName("#define RW_SEEK_SET 0")] - public const int RW_SEEK_SET = 0; - - [NativeTypeName("#define RW_SEEK_CUR 1")] - public const int RW_SEEK_CUR = 1; - - [NativeTypeName("#define RW_SEEK_END 2")] - public const int RW_SEEK_END = 2; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_malloc", ExactSpelling = true)] - public static extern void* malloc([NativeTypeName("size_t")] UIntPtr size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_calloc", ExactSpelling = true)] - public static extern void* calloc([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_realloc", ExactSpelling = true)] - public static extern void* realloc(void* mem, [NativeTypeName("size_t")] UIntPtr size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)] - public static extern void free(void* mem); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetOriginalMemoryFunctions", ExactSpelling = true)] - public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMemoryFunctions", ExactSpelling = true)] - public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] IntPtr* malloc_func, [NativeTypeName("SDL_calloc_func *")] IntPtr* calloc_func, [NativeTypeName("SDL_realloc_func *")] IntPtr* realloc_func, [NativeTypeName("SDL_free_func *")] IntPtr* free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMemoryFunctions", ExactSpelling = true)] - public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] IntPtr malloc_func, [NativeTypeName("SDL_calloc_func")] IntPtr calloc_func, [NativeTypeName("SDL_realloc_func")] IntPtr realloc_func, [NativeTypeName("SDL_free_func")] IntPtr free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAllocations", ExactSpelling = true)] - public static extern int GetNumAllocations(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strcasestr", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* strcasestr([NativeTypeName("const char *")] sbyte* haystack, [NativeTypeName("const char *")] sbyte* needle); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_open", ExactSpelling = true)] - [return: NativeTypeName("SDL_iconv_t")] - public static extern _SDL_iconv_t* iconv_open([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_close", ExactSpelling = true)] - public static extern int iconv_close([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern UIntPtr iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] UIntPtr* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] UIntPtr* outbytesleft); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_string", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] UIntPtr inbytesleft); - - [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] - public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL; - - [NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")] - public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F)); - - [NativeTypeName("#define SDL_MIN_SINT8 ((Sint8)(~0x7F))")] - public const sbyte SDL_MIN_SINT8 = ((sbyte)(~0x7F)); - - [NativeTypeName("#define SDL_MAX_UINT8 ((Uint8)0xFF)")] - public const byte SDL_MAX_UINT8 = ((byte)(0xFF)); - - [NativeTypeName("#define SDL_MIN_UINT8 ((Uint8)0x00)")] - public const byte SDL_MIN_UINT8 = ((byte)(0x00)); - - [NativeTypeName("#define SDL_MAX_SINT16 ((Sint16)0x7FFF)")] - public const short SDL_MAX_SINT16 = ((short)(0x7FFF)); - - [NativeTypeName("#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF))")] - public const short SDL_MIN_SINT16 = ((short)(~0x7FFF)); - - [NativeTypeName("#define SDL_MAX_UINT16 ((Uint16)0xFFFF)")] - public const ushort SDL_MAX_UINT16 = ((ushort)(0xFFFF)); - - [NativeTypeName("#define SDL_MIN_UINT16 ((Uint16)0x0000)")] - public const ushort SDL_MIN_UINT16 = ((ushort)(0x0000)); - - [NativeTypeName("#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF)")] - public const int SDL_MAX_SINT32 = ((int)(0x7FFFFFFF)); - - [NativeTypeName("#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF))")] - public const int SDL_MIN_SINT32 = ((int)(~0x7FFFFFFF)); - - [NativeTypeName("#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu)")] - public const uint SDL_MAX_UINT32 = ((uint)(0xFFFFFFFFU)); - - [NativeTypeName("#define SDL_MIN_UINT32 ((Uint32)0x00000000)")] - public const uint SDL_MIN_UINT32 = ((uint)(0x00000000)); - - [NativeTypeName("#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll)")] - public const long SDL_MAX_SINT64 = ((long)(0x7FFFFFFFFFFFFFFFL)); - - [NativeTypeName("#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll))")] - public const long SDL_MIN_SINT64 = ((long)(~0x7FFFFFFFFFFFFFFFL)); - - [NativeTypeName("#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull)")] - public const ulong SDL_MAX_UINT64 = ((ulong)(0xFFFFFFFFFFFFFFFFUL)); - - [NativeTypeName("#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull))")] - public const ulong SDL_MIN_UINT64 = ((ulong)(0x0000000000000000UL)); - - [NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")] - public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; - - [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] - public static ReadOnlySpan SDL_PRIs64 => new byte[] { 0x49, 0x36, 0x34, 0x64, 0x00 }; - - [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] - public static ReadOnlySpan SDL_PRIu64 => new byte[] { 0x49, 0x36, 0x34, 0x75, 0x00 }; - - [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] - public static ReadOnlySpan SDL_PRIx64 => new byte[] { 0x49, 0x36, 0x34, 0x78, 0x00 }; - - [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] - public static ReadOnlySpan SDL_PRIX64 => new byte[] { 0x49, 0x36, 0x34, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_PRIs32 \"d\"")] - public static ReadOnlySpan SDL_PRIs32 => new byte[] { 0x64, 0x00 }; - - [NativeTypeName("#define SDL_PRIu32 \"u\"")] - public static ReadOnlySpan SDL_PRIu32 => new byte[] { 0x75, 0x00 }; - - [NativeTypeName("#define SDL_PRIx32 \"x\"")] - public static ReadOnlySpan SDL_PRIx32 => new byte[] { 0x78, 0x00 }; - - [NativeTypeName("#define SDL_PRIX32 \"X\"")] - public static ReadOnlySpan SDL_PRIX32 => new byte[] { 0x58, 0x00 }; - - [NativeTypeName("#define M_PI 3.14159265358979323846264338327950288")] - public const double M_PI = 3.14159265358979323846264338327950288; - - [NativeTypeName("#define SDL_ICONV_ERROR (size_t)-1")] - public static readonly UIntPtr SDL_ICONV_ERROR = unchecked((nuint)(-1)); - - [NativeTypeName("#define SDL_ICONV_E2BIG (size_t)-2")] - public static readonly UIntPtr SDL_ICONV_E2BIG = unchecked((nuint)(-2)); - - [NativeTypeName("#define SDL_ICONV_EILSEQ (size_t)-3")] - public static readonly UIntPtr SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); - - [NativeTypeName("#define SDL_ICONV_EINVAL (size_t)-4")] - public static readonly UIntPtr SDL_ICONV_EINVAL = unchecked((nuint)(-4)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurface", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurface([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormat", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceWithFormat([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceFrom", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormatFrom", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeSurface", ExactSpelling = true)] - public static extern void FreeSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfacePalette", ExactSpelling = true)] - public static extern int SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockSurface", ExactSpelling = true)] - public static extern int LockSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockSurface", ExactSpelling = true)] - public static extern void UnlockSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadBMP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SaveBMP_RW", ExactSpelling = true)] - public static extern int SaveBMP_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceRLE", ExactSpelling = true)] - public static extern int SetSurfaceRLE(SDL_Surface* surface, int flag); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasSurfaceRLE", ExactSpelling = true)] - public static extern SDL_bool HasSurfaceRLE(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetColorKey", ExactSpelling = true)] - public static extern int SetColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasColorKey", ExactSpelling = true)] - public static extern SDL_bool HasColorKey(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetColorKey", ExactSpelling = true)] - public static extern int GetColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceColorMod", ExactSpelling = true)] - public static extern int SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceColorMod", ExactSpelling = true)] - public static extern int GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceAlphaMod", ExactSpelling = true)] - public static extern int SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceAlphaMod", ExactSpelling = true)] - public static extern int GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceBlendMode", ExactSpelling = true)] - public static extern int SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceBlendMode", ExactSpelling = true)] - public static extern int GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipRect", ExactSpelling = true)] - public static extern SDL_bool SetClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipRect", ExactSpelling = true)] - public static extern void GetClipRect(SDL_Surface* surface, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DuplicateSurface", ExactSpelling = true)] - public static extern SDL_Surface* DuplicateSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurface", ExactSpelling = true)] - public static extern SDL_Surface* ConvertSurface(SDL_Surface* src, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* fmt, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurfaceFormat", ExactSpelling = true)] - public static extern SDL_Surface* ConvertSurfaceFormat(SDL_Surface* src, [NativeTypeName("Uint32")] uint pixel_format, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertPixels", ExactSpelling = true)] - public static extern int ConvertPixels(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PremultiplyAlpha", ExactSpelling = true)] - public static extern int PremultiplyAlpha(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRect", ExactSpelling = true)] - public static extern int FillRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRects", ExactSpelling = true)] - public static extern int FillRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlit", ExactSpelling = true)] - public static extern int UpperBlit(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlit", ExactSpelling = true)] - public static extern int LowerBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretch", ExactSpelling = true)] - public static extern int SoftStretch(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretchLinear", ExactSpelling = true)] - public static extern int SoftStretchLinear(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlitScaled", ExactSpelling = true)] - public static extern int UpperBlitScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlitScaled", ExactSpelling = true)] - public static extern int LowerBlitScaled(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetYUVConversionMode", ExactSpelling = true)] - public static extern void SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionMode", ExactSpelling = true)] - public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionMode(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionModeForResolution", ExactSpelling = true)] - public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); - - [NativeTypeName("#define SDL_SWSURFACE 0")] - public const int SDL_SWSURFACE = 0; - - [NativeTypeName("#define SDL_PREALLOC 0x00000001")] - public const int SDL_PREALLOC = 0x00000001; - - [NativeTypeName("#define SDL_RLEACCEL 0x00000002")] - public const int SDL_RLEACCEL = 0x00000002; - - [NativeTypeName("#define SDL_DONTFREE 0x00000004")] - public const int SDL_DONTFREE = 0x00000004; - - [NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008")] - public const int SDL_SIMD_ALIGNED = 0x00000008; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowsMessageHook", ExactSpelling = true)] - public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] IntPtr callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Direct3D9GetAdapterIndex", ExactSpelling = true)] - public static extern int Direct3D9GetAdapterIndex(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D9Device", ExactSpelling = true)] - public static extern IDirect3DDevice9* RenderGetD3D9Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D11Device", ExactSpelling = true)] - public static extern ID3D11Device* RenderGetD3D11Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D12Device", ExactSpelling = true)] - public static extern ID3D12Device* RenderGetD3D12Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DXGIGetOutputInfo", ExactSpelling = true)] - public static extern SDL_bool DXGIGetOutputInfo(int displayIndex, int* adapterIndex, int* outputIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTablet", ExactSpelling = true)] - public static extern SDL_bool IsTablet(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillTerminate", ExactSpelling = true)] - public static extern void OnApplicationWillTerminate(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidReceiveMemoryWarning", ExactSpelling = true)] - public static extern void OnApplicationDidReceiveMemoryWarning(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillResignActive", ExactSpelling = true)] - public static extern void OnApplicationWillResignActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidEnterBackground", ExactSpelling = true)] - public static extern void OnApplicationDidEnterBackground(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillEnterForeground", ExactSpelling = true)] - public static extern void OnApplicationWillEnterForeground(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidBecomeActive", ExactSpelling = true)] - public static extern void OnApplicationDidBecomeActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVersion", ExactSpelling = true)] - public static extern void GetVersion(SDL_version* ver); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevision", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetRevision(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevisionNumber", ExactSpelling = true)] - public static extern int GetRevisionNumber(); - - [NativeTypeName("#define SDL_MAJOR_VERSION 2")] - public const int SDL_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_MINOR_VERSION 28")] - public const int SDL_MINOR_VERSION = 28; - - [NativeTypeName("#define SDL_PATCHLEVEL 0")] - public const int SDL_PATCHLEVEL = 0; - - [NativeTypeName("#define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)")] - public const int SDL_COMPILEDVERSION = ((2) * 1000 + (28) * 100 + (0)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDrivers", ExactSpelling = true)] - public static extern int GetNumVideoDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVideoDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetVideoDriver(int index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoInit", ExactSpelling = true)] - public static extern int VideoInit([NativeTypeName("const char *")] sbyte* driver_name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoQuit", ExactSpelling = true)] - public static extern void VideoQuit(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentVideoDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetCurrentVideoDriver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDisplays", ExactSpelling = true)] - public static extern int GetNumVideoDisplays(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetDisplayName(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayBounds", ExactSpelling = true)] - public static extern int GetDisplayBounds(int displayIndex, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayUsableBounds", ExactSpelling = true)] - public static extern int GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayDPI", ExactSpelling = true)] - public static extern int GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayOrientation", ExactSpelling = true)] - public static extern SDL_DisplayOrientation GetDisplayOrientation(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumDisplayModes", ExactSpelling = true)] - public static extern int GetNumDisplayModes(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayMode", ExactSpelling = true)] - public static extern int GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDesktopDisplayMode", ExactSpelling = true)] - public static extern int GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentDisplayMode", ExactSpelling = true)] - public static extern int GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClosestDisplayMode", ExactSpelling = true)] - public static extern SDL_DisplayMode* GetClosestDisplayMode(int displayIndex, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode, SDL_DisplayMode* closest); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPointDisplayIndex", ExactSpelling = true)] - public static extern int GetPointDisplayIndex([NativeTypeName("const SDL_Point *")] SDL_Point* point); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRectDisplayIndex", ExactSpelling = true)] - public static extern int GetRectDisplayIndex([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayIndex", ExactSpelling = true)] - public static extern int GetWindowDisplayIndex(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowDisplayMode", ExactSpelling = true)] - public static extern int SetWindowDisplayMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayMode", ExactSpelling = true)] - public static extern int GetWindowDisplayMode(SDL_Window* window, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowICCProfile", ExactSpelling = true)] - public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] UIntPtr* size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPixelFormat", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowPixelFormat(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindow", ExactSpelling = true)] - public static extern SDL_Window* CreateWindow([NativeTypeName("const char *")] sbyte* title, int x, int y, int w, int h, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowFrom", ExactSpelling = true)] - public static extern SDL_Window* CreateWindowFrom([NativeTypeName("const void *")] void* data); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowID", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowID(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFromID", ExactSpelling = true)] - public static extern SDL_Window* GetWindowFromID([NativeTypeName("Uint32")] uint id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFlags", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowFlags(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowTitle", ExactSpelling = true)] - public static extern void SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] sbyte* title); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowTitle", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetWindowTitle(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowIcon", ExactSpelling = true)] - public static extern void SetWindowIcon(SDL_Window* window, SDL_Surface* icon); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowData", ExactSpelling = true)] - public static extern void* SetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowData", ExactSpelling = true)] - public static extern void* GetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowPosition", ExactSpelling = true)] - public static extern void SetWindowPosition(SDL_Window* window, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPosition", ExactSpelling = true)] - public static extern void GetWindowPosition(SDL_Window* window, int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowSize", ExactSpelling = true)] - public static extern void SetWindowSize(SDL_Window* window, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSize", ExactSpelling = true)] - public static extern void GetWindowSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBordersSize", ExactSpelling = true)] - public static extern int GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSizeInPixels", ExactSpelling = true)] - public static extern void GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMinimumSize", ExactSpelling = true)] - public static extern void SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMinimumSize", ExactSpelling = true)] - public static extern void GetWindowMinimumSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMaximumSize", ExactSpelling = true)] - public static extern void SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMaximumSize", ExactSpelling = true)] - public static extern void GetWindowMaximumSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBordered", ExactSpelling = true)] - public static extern void SetWindowBordered(SDL_Window* window, SDL_bool bordered); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowResizable", ExactSpelling = true)] - public static extern void SetWindowResizable(SDL_Window* window, SDL_bool resizable); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowAlwaysOnTop", ExactSpelling = true)] - public static extern void SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowWindow", ExactSpelling = true)] - public static extern void ShowWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)] - public static extern void HideWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RaiseWindow", ExactSpelling = true)] - public static extern void RaiseWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MaximizeWindow", ExactSpelling = true)] - public static extern void MaximizeWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MinimizeWindow", ExactSpelling = true)] - public static extern void MinimizeWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RestoreWindow", ExactSpelling = true)] - public static extern void RestoreWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowFullscreen", ExactSpelling = true)] - public static extern int SetWindowFullscreen(SDL_Window* window, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasWindowSurface", ExactSpelling = true)] - public static extern SDL_bool HasWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSurface", ExactSpelling = true)] - public static extern SDL_Surface* GetWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurface", ExactSpelling = true)] - public static extern int UpdateWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurfaceRects", ExactSpelling = true)] - public static extern int UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindowSurface", ExactSpelling = true)] - public static extern int DestroyWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGrab", ExactSpelling = true)] - public static extern void SetWindowGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowKeyboardGrab", ExactSpelling = true)] - public static extern void SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseGrab", ExactSpelling = true)] - public static extern void SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowKeyboardGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowKeyboardGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowMouseGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGrabbedWindow", ExactSpelling = true)] - public static extern SDL_Window* GetGrabbedWindow(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseRect", ExactSpelling = true)] - public static extern int SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseRect", ExactSpelling = true)] - [return: NativeTypeName("const SDL_Rect *")] - public static extern SDL_Rect* GetWindowMouseRect(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBrightness", ExactSpelling = true)] - public static extern int SetWindowBrightness(SDL_Window* window, float brightness); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBrightness", ExactSpelling = true)] - public static extern float GetWindowBrightness(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)] - public static extern int SetWindowOpacity(SDL_Window* window, float opacity); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowOpacity", ExactSpelling = true)] - public static extern int GetWindowOpacity(SDL_Window* window, float* out_opacity); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowModalFor", ExactSpelling = true)] - public static extern int SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowInputFocus", ExactSpelling = true)] - public static extern int SetWindowInputFocus(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGammaRamp", ExactSpelling = true)] - public static extern int SetWindowGammaRamp(SDL_Window* window, [NativeTypeName("const Uint16 *")] ushort* red, [NativeTypeName("const Uint16 *")] ushort* green, [NativeTypeName("const Uint16 *")] ushort* blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGammaRamp", ExactSpelling = true)] - public static extern int GetWindowGammaRamp(SDL_Window* window, [NativeTypeName("Uint16 *")] ushort* red, [NativeTypeName("Uint16 *")] ushort* green, [NativeTypeName("Uint16 *")] ushort* blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowHitTest", ExactSpelling = true)] - public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] IntPtr callback, void* callback_data); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlashWindow", ExactSpelling = true)] - public static extern int FlashWindow(SDL_Window* window, SDL_FlashOperation operation); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindow", ExactSpelling = true)] - public static extern void DestroyWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenSaverEnabled", ExactSpelling = true)] - public static extern SDL_bool IsScreenSaverEnabled(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EnableScreenSaver", ExactSpelling = true)] - public static extern void EnableScreenSaver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)] - public static extern void DisableScreenSaver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_LoadLibrary", ExactSpelling = true)] - public static extern int GL_LoadLibrary([NativeTypeName("const char *")] sbyte* path); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetProcAddress", ExactSpelling = true)] - public static extern void* GL_GetProcAddress([NativeTypeName("const char *")] sbyte* proc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnloadLibrary", ExactSpelling = true)] - public static extern void GL_UnloadLibrary(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ExtensionSupported", ExactSpelling = true)] - public static extern SDL_bool GL_ExtensionSupported([NativeTypeName("const char *")] sbyte* extension); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ResetAttributes", ExactSpelling = true)] - public static extern void GL_ResetAttributes(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetAttribute", ExactSpelling = true)] - public static extern int GL_SetAttribute(SDL_GLattr attr, int value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetAttribute", ExactSpelling = true)] - public static extern int GL_GetAttribute(SDL_GLattr attr, int* value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_CreateContext", ExactSpelling = true)] - [return: NativeTypeName("SDL_GLContext")] - public static extern void* GL_CreateContext(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_MakeCurrent", ExactSpelling = true)] - public static extern int GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] void* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentWindow", ExactSpelling = true)] - public static extern SDL_Window* GL_GetCurrentWindow(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentContext", ExactSpelling = true)] - [return: NativeTypeName("SDL_GLContext")] - public static extern void* GL_GetCurrentContext(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetDrawableSize", ExactSpelling = true)] - public static extern void GL_GetDrawableSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetSwapInterval", ExactSpelling = true)] - public static extern int GL_SetSwapInterval(int interval); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetSwapInterval", ExactSpelling = true)] - public static extern int GL_GetSwapInterval(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SwapWindow", ExactSpelling = true)] - public static extern void GL_SwapWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_DeleteContext", ExactSpelling = true)] - public static extern void GL_DeleteContext([NativeTypeName("SDL_GLContext")] void* context); - - [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u")] - public const uint SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000U; - - [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)")] - public const uint SDL_WINDOWPOS_UNDEFINED = (0x1FFF0000U | (0)); - - [NativeTypeName("#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u")] - public const uint SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000U; - - [NativeTypeName("#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)")] - public const uint SDL_WINDOWPOS_CENTERED = (0x2FFF0000U | (0)); - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs deleted file mode 100644 index 027f7f78..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCVT.cs +++ /dev/null @@ -1,80 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.CompilerServices; - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_AudioCVT - { - public int needed; - - [NativeTypeName("SDL_AudioFormat")] - public ushort src_format; - - [NativeTypeName("SDL_AudioFormat")] - public ushort dst_format; - - public double rate_incr; - - [NativeTypeName("Uint8 *")] - public byte* buf; - - public int len; - - public int len_cvt; - - public int len_mult; - - public double len_ratio; - - [NativeTypeName("SDL_AudioFilter[10]")] - public _filters_e__FixedBuffer filters; - - public int filter_index; - - public partial struct _filters_e__FixedBuffer - { - public IntPtr e0; - public IntPtr e1; - public IntPtr e2; - public IntPtr e3; - public IntPtr e4; - public IntPtr e5; - public IntPtr e6; - public IntPtr e7; - public IntPtr e8; - public IntPtr e9; - - public unsafe ref IntPtr this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - fixed (IntPtr* pThis = &e0) - { - return ref pThis[index]; - } - } - } - } - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs deleted file mode 100644 index 19851f45..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioCallback.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_AudioCallback(void* userdata, [NativeTypeName("Uint8 *")] byte* stream, int len); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs deleted file mode 100644 index 6d696655..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioFilter.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_AudioFilter([NativeTypeName("struct SDL_AudioCVT *")] SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort format); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs deleted file mode 100644 index fe0e438e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_AudioSpec.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_AudioSpec - { - public int freq; - - [NativeTypeName("SDL_AudioFormat")] - public ushort format; - - [NativeTypeName("Uint8")] - public byte channels; - - [NativeTypeName("Uint8")] - public byte silence; - - [NativeTypeName("Uint16")] - public ushort samples; - - [NativeTypeName("Uint16")] - public ushort padding; - - [NativeTypeName("Uint32")] - public uint size; - - [NativeTypeName("SDL_AudioCallback")] - public IntPtr callback; - - public void* userdata; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs deleted file mode 100644 index 2dfb1b42..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_ControllerSensorEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_ControllerSensorEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Sint32")] - public int sensor; - - [NativeTypeName("float[3]")] - public fixed float data[3]; - - [NativeTypeName("Uint64")] - public ulong timestamp_us; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs deleted file mode 100644 index 7db609df..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_Event.cs +++ /dev/null @@ -1,126 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [StructLayout(LayoutKind.Explicit)] - public unsafe partial struct SDL_Event - { - [FieldOffset(0)] - [NativeTypeName("Uint32")] - public uint type; - - [FieldOffset(0)] - public SDL_CommonEvent common; - - [FieldOffset(0)] - public SDL_DisplayEvent display; - - [FieldOffset(0)] - public SDL_WindowEvent window; - - [FieldOffset(0)] - public SDL_KeyboardEvent key; - - [FieldOffset(0)] - public SDL_TextEditingEvent edit; - - [FieldOffset(0)] - public SDL_TextEditingExtEvent editExt; - - [FieldOffset(0)] - public SDL_TextInputEvent text; - - [FieldOffset(0)] - public SDL_MouseMotionEvent motion; - - [FieldOffset(0)] - public SDL_MouseButtonEvent button; - - [FieldOffset(0)] - public SDL_MouseWheelEvent wheel; - - [FieldOffset(0)] - public SDL_JoyAxisEvent jaxis; - - [FieldOffset(0)] - public SDL_JoyBallEvent jball; - - [FieldOffset(0)] - public SDL_JoyHatEvent jhat; - - [FieldOffset(0)] - public SDL_JoyButtonEvent jbutton; - - [FieldOffset(0)] - public SDL_JoyDeviceEvent jdevice; - - [FieldOffset(0)] - public SDL_JoyBatteryEvent jbattery; - - [FieldOffset(0)] - public SDL_ControllerAxisEvent caxis; - - [FieldOffset(0)] - public SDL_ControllerButtonEvent cbutton; - - [FieldOffset(0)] - public SDL_ControllerDeviceEvent cdevice; - - [FieldOffset(0)] - public SDL_ControllerTouchpadEvent ctouchpad; - - [FieldOffset(0)] - public SDL_ControllerSensorEvent csensor; - - [FieldOffset(0)] - public SDL_AudioDeviceEvent adevice; - - [FieldOffset(0)] - public SDL_SensorEvent sensor; - - [FieldOffset(0)] - public SDL_QuitEvent quit; - - [FieldOffset(0)] - public SDL_UserEvent user; - - [FieldOffset(0)] - public SDL_SysWMEvent syswm; - - [FieldOffset(0)] - public SDL_TouchFingerEvent tfinger; - - [FieldOffset(0)] - public SDL_MultiGestureEvent mgesture; - - [FieldOffset(0)] - public SDL_DollarGestureEvent dgesture; - - [FieldOffset(0)] - public SDL_DropEvent drop; - - [FieldOffset(0)] - [NativeTypeName("Uint8[56]")] - public fixed byte padding[56]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs deleted file mode 100644 index 21f529a8..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_EventFilter.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate int SDL_EventFilter(void* userdata, SDL_Event* @event); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs deleted file mode 100644 index fb41ca1e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_GUID.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_GUID - { - [NativeTypeName("Uint8[16]")] - public fixed byte data[16]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs deleted file mode 100644 index 799a0d49..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HintCallback.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_HintCallback(void* userdata, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* oldValue, [NativeTypeName("const char *")] sbyte* newValue); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs deleted file mode 100644 index fd412ad2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_HitTest.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate SDL_HitTestResult SDL_HitTest(SDL_Window* win, [NativeTypeName("const SDL_Point *")] SDL_Point* area, void* data); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs deleted file mode 100644 index 08b8f567..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_LogOutputFunction.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_LogOutputFunction(void* userdata, int category, SDL_LogPriority priority, [NativeTypeName("const char *")] sbyte* message); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs deleted file mode 100644 index fa3c1100..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_PixelFormat.cs +++ /dev/null @@ -1,80 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_PixelFormat - { - [NativeTypeName("Uint32")] - public uint format; - - public SDL_Palette* palette; - - [NativeTypeName("Uint8")] - public byte BitsPerPixel; - - [NativeTypeName("Uint8")] - public byte BytesPerPixel; - - [NativeTypeName("Uint8[2]")] - public fixed byte padding[2]; - - [NativeTypeName("Uint32")] - public uint Rmask; - - [NativeTypeName("Uint32")] - public uint Gmask; - - [NativeTypeName("Uint32")] - public uint Bmask; - - [NativeTypeName("Uint32")] - public uint Amask; - - [NativeTypeName("Uint8")] - public byte Rloss; - - [NativeTypeName("Uint8")] - public byte Gloss; - - [NativeTypeName("Uint8")] - public byte Bloss; - - [NativeTypeName("Uint8")] - public byte Aloss; - - [NativeTypeName("Uint8")] - public byte Rshift; - - [NativeTypeName("Uint8")] - public byte Gshift; - - [NativeTypeName("Uint8")] - public byte Bshift; - - [NativeTypeName("Uint8")] - public byte Ashift; - - public int refcount; - - [NativeTypeName("struct SDL_PixelFormat *")] - public SDL_PixelFormat* next; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs deleted file mode 100644 index 54b9583d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RWops.cs +++ /dev/null @@ -1,105 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_RWops - { - [NativeTypeName("Sint64 (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public IntPtr size; - - [NativeTypeName("Sint64 (*)(struct SDL_RWops *, Sint64, int) __attribute__((cdecl))")] - public IntPtr seek; - - [NativeTypeName("size_t (*)(struct SDL_RWops *, void *, size_t, size_t) __attribute__((cdecl))")] - public IntPtr read; - - [NativeTypeName("size_t (*)(struct SDL_RWops *, const void *, size_t, size_t) __attribute__((cdecl))")] - public IntPtr write; - - [NativeTypeName("int (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public IntPtr close; - - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("__AnonymousRecord_SDL_rwops_L94_C5")] - public _hidden_e__Union hidden; - - [StructLayout(LayoutKind.Explicit)] - public partial struct _hidden_e__Union - { - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L102_C9")] - public _windowsio_e__Struct windowsio; - - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L122_C9")] - public _mem_e__Struct mem; - - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L128_C9")] - public _unknown_e__Struct unknown; - - public unsafe partial struct _windowsio_e__Struct - { - public SDL_bool append; - - public void* h; - - [NativeTypeName("__AnonymousRecord_SDL_rwops_L106_C13")] - public _buffer_e__Struct buffer; - - public unsafe partial struct _buffer_e__Struct - { - public void* data; - - [NativeTypeName("size_t")] - public UIntPtr size; - - [NativeTypeName("size_t")] - public UIntPtr left; - } - } - - public unsafe partial struct _mem_e__Struct - { - [NativeTypeName("Uint8 *")] - public byte* @base; - - [NativeTypeName("Uint8 *")] - public byte* here; - - [NativeTypeName("Uint8 *")] - public byte* stop; - } - - public unsafe partial struct _unknown_e__Struct - { - public void* data1; - - public void* data2; - } - } - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs deleted file mode 100644 index c21a4ba1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_RendererInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_RendererInfo - { - [NativeTypeName("const char *")] - public sbyte* name; - - [NativeTypeName("Uint32")] - public uint flags; - - [NativeTypeName("Uint32")] - public uint num_texture_formats; - - [NativeTypeName("Uint32[16]")] - public fixed uint texture_formats[16]; - - public int max_texture_width; - - public int max_texture_height; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs deleted file mode 100644 index ce329d9f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_SensorEvent.cs +++ /dev/null @@ -1,40 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_SensorEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - - [NativeTypeName("float[6]")] - public fixed float data[6]; - - [NativeTypeName("Uint64")] - public ulong timestamp_us; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs deleted file mode 100644 index 40f05865..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextEditingEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextEditingEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char[32]")] - public fixed sbyte text[32]; - - [NativeTypeName("Sint32")] - public int start; - - [NativeTypeName("Sint32")] - public int length; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs deleted file mode 100644 index 285e9416..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_TextInputEvent.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextInputEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char[32]")] - public fixed sbyte text[32]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs deleted file mode 100644 index 34a9ad27..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_VirtualJoystickDesc.cs +++ /dev/null @@ -1,80 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_VirtualJoystickDesc - { - [NativeTypeName("Uint16")] - public ushort version; - - [NativeTypeName("Uint16")] - public ushort type; - - [NativeTypeName("Uint16")] - public ushort naxes; - - [NativeTypeName("Uint16")] - public ushort nbuttons; - - [NativeTypeName("Uint16")] - public ushort nhats; - - [NativeTypeName("Uint16")] - public ushort vendor_id; - - [NativeTypeName("Uint16")] - public ushort product_id; - - [NativeTypeName("Uint16")] - public ushort padding; - - [NativeTypeName("Uint32")] - public uint button_mask; - - [NativeTypeName("Uint32")] - public uint axis_mask; - - [NativeTypeName("const char *")] - public sbyte* name; - - public void* userdata; - - [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] - public IntPtr Update; - - [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] - public IntPtr SetPlayerIndex; - - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public IntPtr Rumble; - - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public IntPtr RumbleTriggers; - - [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] - public IntPtr SetLED; - - [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] - public IntPtr SendEffect; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs deleted file mode 100644 index fda93f33..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_WindowsMessageHook.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_WindowsMessageHook(void* userdata, void* hWnd, [NativeTypeName("unsigned int")] uint message, [NativeTypeName("Uint64")] ulong wParam, [NativeTypeName("Sint64")] long lParam); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs deleted file mode 100644 index 35ece88a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_blit.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate int SDL_blit([NativeTypeName("struct SDL_Surface *")] SDL_Surface* src, SDL_Rect* srcrect, [NativeTypeName("struct SDL_Surface *")] SDL_Surface* dst, SDL_Rect* dstrect); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs deleted file mode 100644 index 968f9973..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_calloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_calloc_func([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs deleted file mode 100644 index e4cc9387..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_free_func.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_free_func(void* mem); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs deleted file mode 100644 index 8bbd3a31..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_malloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_malloc_func([NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs b/sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs deleted file mode 100644 index 322a5eb0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/compatible/SDL_realloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_realloc_func(void* mem, [NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs deleted file mode 100644 index 8ea3fc3a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/ID3D11Device.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct ID3D11Device - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs deleted file mode 100644 index ade1cb11..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/ID3D12Device.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct ID3D12Device - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs deleted file mode 100644 index 42715080..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/IDirect3DDevice9.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct IDirect3DDevice9 - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG.cs b/sources/SDL2Sharp.Interop/codegen/default/IMG.cs deleted file mode 100644 index 33f72853..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/IMG.cs +++ /dev/null @@ -1,214 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class IMG - { - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Linked_Version", ExactSpelling = true)] - [return: NativeTypeName("const SDL_version *")] - public static extern SDL_version* Linked_Version(); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Init", ExactSpelling = true)] - public static extern int Init(int flags); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTyped_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load", ExactSpelling = true)] - public static extern SDL_Surface* Load([NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load_RW", ExactSpelling = true)] - public static extern SDL_Surface* Load_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture", ExactSpelling = true)] - public static extern SDL_Texture* LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture_RW", ExactSpelling = true)] - public static extern SDL_Texture* LoadTexture_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTextureTyped_RW", ExactSpelling = true)] - public static extern SDL_Texture* LoadTextureTyped_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isAVIF", ExactSpelling = true)] - public static extern int isAVIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isICO", ExactSpelling = true)] - public static extern int isICO(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isCUR", ExactSpelling = true)] - public static extern int isCUR(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isBMP", ExactSpelling = true)] - public static extern int isBMP(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isGIF", ExactSpelling = true)] - public static extern int isGIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJPG", ExactSpelling = true)] - public static extern int isJPG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJXL", ExactSpelling = true)] - public static extern int isJXL(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isLBM", ExactSpelling = true)] - public static extern int isLBM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPCX", ExactSpelling = true)] - public static extern int isPCX(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNG", ExactSpelling = true)] - public static extern int isPNG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNM", ExactSpelling = true)] - public static extern int isPNM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isSVG", ExactSpelling = true)] - public static extern int isSVG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isQOI", ExactSpelling = true)] - public static extern int isQOI(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isTIF", ExactSpelling = true)] - public static extern int isTIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXCF", ExactSpelling = true)] - public static extern int isXCF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXPM", ExactSpelling = true)] - public static extern int isXPM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXV", ExactSpelling = true)] - public static extern int isXV(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isWEBP", ExactSpelling = true)] - public static extern int isWEBP(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAVIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadAVIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadICO_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadICO_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadCUR_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadCUR_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadBMP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadGIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJPG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadJPG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJXL_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadJXL_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadLBM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadLBM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPCX_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPCX_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPNG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPNM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSVG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadSVG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadQOI_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadQOI_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTGA_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTGA_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXCF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXCF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXPM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXPM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXV_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXV_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadWEBP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadWEBP_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSizedSVG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadSizedSVG_RW(SDL_RWops* src, int width, int height); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArray", ExactSpelling = true)] - public static extern SDL_Surface* ReadXPMFromArray([NativeTypeName("char **")] sbyte** xpm); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArrayToRGB888", ExactSpelling = true)] - public static extern SDL_Surface* ReadXPMFromArrayToRGB888([NativeTypeName("char **")] sbyte** xpm); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG", ExactSpelling = true)] - public static extern int SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG_RW", ExactSpelling = true)] - public static extern int SavePNG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG", ExactSpelling = true)] - public static extern int SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file, int quality); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG_RW", ExactSpelling = true)] - public static extern int SaveJPG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst, int quality); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimation([NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimation_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimationTyped_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimationTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_FreeAnimation", ExactSpelling = true)] - public static extern void FreeAnimation(IMG_Animation* anim); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIFAnimation_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadGIFAnimation_RW(SDL_RWops* src); - - [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 2")] - public const int SDL_IMAGE_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 6")] - public const int SDL_IMAGE_MINOR_VERSION = 6; - - [NativeTypeName("#define SDL_IMAGE_PATCHLEVEL 3")] - public const int SDL_IMAGE_PATCHLEVEL = 3; - - [NativeTypeName("#define SDL_IMAGE_COMPILEDVERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL)")] - public const int SDL_IMAGE_COMPILEDVERSION = ((2) * 1000 + (6) * 100 + (3)); - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs deleted file mode 100644 index 01d7abbb..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/IMG_InitFlags.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum IMG_InitFlags - { - IMG_INIT_JPG = 0x00000001, - IMG_INIT_PNG = 0x00000002, - IMG_INIT_TIF = 0x00000004, - IMG_INIT_WEBP = 0x00000008, - IMG_INIT_JXL = 0x00000010, - IMG_INIT_AVIF = 0x00000020, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL.cs deleted file mode 100644 index 121259a6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL.cs +++ /dev/null @@ -1,2387 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class SDL - { - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)] - public static extern int Init([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_InitSubSystem", ExactSpelling = true)] - public static extern int InitSubSystem([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QuitSubSystem", ExactSpelling = true)] - public static extern void QuitSubSystem([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WasInit", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint WasInit([NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")] - public const uint SDL_INIT_TIMER = 0x00000001U; - - [NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")] - public const uint SDL_INIT_AUDIO = 0x00000010U; - - [NativeTypeName("#define SDL_INIT_VIDEO 0x00000020u")] - public const uint SDL_INIT_VIDEO = 0x00000020U; - - [NativeTypeName("#define SDL_INIT_JOYSTICK 0x00000200u")] - public const uint SDL_INIT_JOYSTICK = 0x00000200U; - - [NativeTypeName("#define SDL_INIT_HAPTIC 0x00001000u")] - public const uint SDL_INIT_HAPTIC = 0x00001000U; - - [NativeTypeName("#define SDL_INIT_GAMECONTROLLER 0x00002000u")] - public const uint SDL_INIT_GAMECONTROLLER = 0x00002000U; - - [NativeTypeName("#define SDL_INIT_EVENTS 0x00004000u")] - public const uint SDL_INIT_EVENTS = 0x00004000U; - - [NativeTypeName("#define SDL_INIT_SENSOR 0x00008000u")] - public const uint SDL_INIT_SENSOR = 0x00008000U; - - [NativeTypeName("#define SDL_INIT_NOPARACHUTE 0x00100000u")] - public const uint SDL_INIT_NOPARACHUTE = 0x00100000U; - - [NativeTypeName("#define SDL_INIT_EVERYTHING ( \\\r\n SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \\\r\n SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \\\r\n )")] - public const uint SDL_INIT_EVERYTHING = (0x00000001U | 0x00000010U | 0x00000020U | 0x00004000U | 0x00000200U | 0x00001000U | 0x00002000U | 0x00008000U); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDrivers", ExactSpelling = true)] - public static extern int GetNumAudioDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetAudioDriver(int index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioInit", ExactSpelling = true)] - public static extern int AudioInit([NativeTypeName("const char *")] sbyte* driver_name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioQuit", ExactSpelling = true)] - public static extern void AudioQuit(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentAudioDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetCurrentAudioDriver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudio", ExactSpelling = true)] - public static extern int OpenAudio(SDL_AudioSpec* desired, SDL_AudioSpec* obtained); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAudioDevices", ExactSpelling = true)] - public static extern int GetNumAudioDevices(int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetAudioDeviceName(int index, int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceSpec", ExactSpelling = true)] - public static extern int GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec* spec); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultAudioInfo", ExactSpelling = true)] - public static extern int GetDefaultAudioInfo([NativeTypeName("char **")] sbyte** name, SDL_AudioSpec* spec, int iscapture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OpenAudioDevice", ExactSpelling = true)] - [return: NativeTypeName("SDL_AudioDeviceID")] - public static extern uint OpenAudioDevice([NativeTypeName("const char *")] sbyte* device, int iscapture, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* desired, SDL_AudioSpec* obtained, int allowed_changes); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioStatus", ExactSpelling = true)] - public static extern SDL_AudioStatus GetAudioStatus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioDeviceStatus", ExactSpelling = true)] - public static extern SDL_AudioStatus GetAudioDeviceStatus([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudio", ExactSpelling = true)] - public static extern void PauseAudio(int pause_on); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PauseAudioDevice", ExactSpelling = true)] - public static extern void PauseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev, int pause_on); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadWAV_RW", ExactSpelling = true)] - public static extern SDL_AudioSpec* LoadWAV_RW(SDL_RWops* src, int freesrc, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeWAV", ExactSpelling = true)] - public static extern void FreeWAV([NativeTypeName("Uint8 *")] byte* audio_buf); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_BuildAudioCVT", ExactSpelling = true)] - public static extern int BuildAudioCVT(SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort src_format, [NativeTypeName("Uint8")] byte src_channels, int src_rate, [NativeTypeName("SDL_AudioFormat")] ushort dst_format, [NativeTypeName("Uint8")] byte dst_channels, int dst_rate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertAudio", ExactSpelling = true)] - public static extern int ConvertAudio(SDL_AudioCVT* cvt); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NewAudioStream", ExactSpelling = true)] - [return: NativeTypeName("SDL_AudioStream *")] - public static extern _SDL_AudioStream* NewAudioStream([NativeTypeName("const SDL_AudioFormat")] ushort src_format, [NativeTypeName("const Uint8")] byte src_channels, [NativeTypeName("const int")] int src_rate, [NativeTypeName("const SDL_AudioFormat")] ushort dst_format, [NativeTypeName("const Uint8")] byte dst_channels, [NativeTypeName("const int")] int dst_rate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamPut", ExactSpelling = true)] - public static extern int AudioStreamPut([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, [NativeTypeName("const void *")] void* buf, int len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamGet", ExactSpelling = true)] - public static extern int AudioStreamGet([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream, void* buf, int len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamAvailable", ExactSpelling = true)] - public static extern int AudioStreamAvailable([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamFlush", ExactSpelling = true)] - public static extern int AudioStreamFlush([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AudioStreamClear", ExactSpelling = true)] - public static extern void AudioStreamClear([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeAudioStream", ExactSpelling = true)] - public static extern void FreeAudioStream([NativeTypeName("SDL_AudioStream *")] _SDL_AudioStream* stream); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudio", ExactSpelling = true)] - public static extern void MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("Uint32")] uint len, int volume); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MixAudioFormat", ExactSpelling = true)] - public static extern void MixAudioFormat([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("SDL_AudioFormat")] ushort format, [NativeTypeName("Uint32")] uint len, int volume); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueueAudio", ExactSpelling = true)] - public static extern int QueueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, [NativeTypeName("const void *")] void* data, [NativeTypeName("Uint32")] uint len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DequeueAudio", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint DequeueAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev, void* data, [NativeTypeName("Uint32")] uint len); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetQueuedAudioSize", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetQueuedAudioSize([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearQueuedAudio", ExactSpelling = true)] - public static extern void ClearQueuedAudio([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudio", ExactSpelling = true)] - public static extern void LockAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockAudioDevice", ExactSpelling = true)] - public static extern void LockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudio", ExactSpelling = true)] - public static extern void UnlockAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockAudioDevice", ExactSpelling = true)] - public static extern void UnlockAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudio", ExactSpelling = true)] - public static extern void CloseAudio(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CloseAudioDevice", ExactSpelling = true)] - public static extern void CloseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev); - - [NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFF)")] - public const int SDL_AUDIO_MASK_BITSIZE = (0xFF); - - [NativeTypeName("#define SDL_AUDIO_MASK_DATATYPE (1<<8)")] - public const int SDL_AUDIO_MASK_DATATYPE = (1 << 8); - - [NativeTypeName("#define SDL_AUDIO_MASK_ENDIAN (1<<12)")] - public const int SDL_AUDIO_MASK_ENDIAN = (1 << 12); - - [NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1<<15)")] - public const int SDL_AUDIO_MASK_SIGNED = (1 << 15); - - [NativeTypeName("#define AUDIO_U8 0x0008")] - public const int AUDIO_U8 = 0x0008; - - [NativeTypeName("#define AUDIO_S8 0x8008")] - public const int AUDIO_S8 = 0x8008; - - [NativeTypeName("#define AUDIO_U16LSB 0x0010")] - public const int AUDIO_U16LSB = 0x0010; - - [NativeTypeName("#define AUDIO_S16LSB 0x8010")] - public const int AUDIO_S16LSB = 0x8010; - - [NativeTypeName("#define AUDIO_U16MSB 0x1010")] - public const int AUDIO_U16MSB = 0x1010; - - [NativeTypeName("#define AUDIO_S16MSB 0x9010")] - public const int AUDIO_S16MSB = 0x9010; - - [NativeTypeName("#define AUDIO_U16 AUDIO_U16LSB")] - public const int AUDIO_U16 = 0x0010; - - [NativeTypeName("#define AUDIO_S16 AUDIO_S16LSB")] - public const int AUDIO_S16 = 0x8010; - - [NativeTypeName("#define AUDIO_S32LSB 0x8020")] - public const int AUDIO_S32LSB = 0x8020; - - [NativeTypeName("#define AUDIO_S32MSB 0x9020")] - public const int AUDIO_S32MSB = 0x9020; - - [NativeTypeName("#define AUDIO_S32 AUDIO_S32LSB")] - public const int AUDIO_S32 = 0x8020; - - [NativeTypeName("#define AUDIO_F32LSB 0x8120")] - public const int AUDIO_F32LSB = 0x8120; - - [NativeTypeName("#define AUDIO_F32MSB 0x9120")] - public const int AUDIO_F32MSB = 0x9120; - - [NativeTypeName("#define AUDIO_F32 AUDIO_F32LSB")] - public const int AUDIO_F32 = 0x8120; - - [NativeTypeName("#define AUDIO_U16SYS AUDIO_U16LSB")] - public const int AUDIO_U16SYS = 0x0010; - - [NativeTypeName("#define AUDIO_S16SYS AUDIO_S16LSB")] - public const int AUDIO_S16SYS = 0x8010; - - [NativeTypeName("#define AUDIO_S32SYS AUDIO_S32LSB")] - public const int AUDIO_S32SYS = 0x8020; - - [NativeTypeName("#define AUDIO_F32SYS AUDIO_F32LSB")] - public const int AUDIO_F32SYS = 0x8120; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001")] - public const int SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002")] - public const int SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004")] - public const int SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008")] - public const int SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008; - - [NativeTypeName("#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)")] - public const int SDL_AUDIO_ALLOW_ANY_CHANGE = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008); - - [NativeTypeName("#define SDL_AUDIOCVT_MAX_FILTERS 9")] - public const int SDL_AUDIOCVT_MAX_FILTERS = 9; - - [NativeTypeName("#define SDL_MIX_MAXVOLUME 128")] - public const int SDL_MIX_MAXVOLUME = 128; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ComposeCustomBlendMode", ExactSpelling = true)] - public static extern SDL_BlendMode ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetError", ExactSpelling = true)] - public static extern int SetError([NativeTypeName("const char *")] sbyte* fmt, __arglist); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetError(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetErrorMsg", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* GetErrorMsg([NativeTypeName("char *")] sbyte* errstr, int maxlen); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearError", ExactSpelling = true)] - public static extern void ClearError(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Error", ExactSpelling = true)] - public static extern int Error(SDL_errorcode code); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PumpEvents", ExactSpelling = true)] - public static extern void PumpEvents(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PeepEvents", ExactSpelling = true)] - public static extern int PeepEvents(SDL_Event* events, int numevents, SDL_eventaction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvent", ExactSpelling = true)] - public static extern SDL_bool HasEvent([NativeTypeName("Uint32")] uint type); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasEvents", ExactSpelling = true)] - public static extern SDL_bool HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvent", ExactSpelling = true)] - public static extern void FlushEvent([NativeTypeName("Uint32")] uint type); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlushEvents", ExactSpelling = true)] - public static extern void FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PollEvent", ExactSpelling = true)] - public static extern int PollEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEvent", ExactSpelling = true)] - public static extern int WaitEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WaitEventTimeout", ExactSpelling = true)] - public static extern int WaitEventTimeout(SDL_Event* @event, int timeout); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PushEvent", ExactSpelling = true)] - public static extern int PushEvent(SDL_Event* @event); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetEventFilter", ExactSpelling = true)] - public static extern void SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEventFilter", ExactSpelling = true)] - public static extern SDL_bool GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]* filter, void** userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddEventWatch", ExactSpelling = true)] - public static extern void AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelEventWatch", ExactSpelling = true)] - public static extern void DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FilterEvents", ExactSpelling = true)] - public static extern void FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl] filter, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EventState", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte EventState([NativeTypeName("Uint32")] uint type, int state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RegisterEvents", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint RegisterEvents(int numevents); - - [NativeTypeName("#define SDL_RELEASED 0")] - public const int SDL_RELEASED = 0; - - [NativeTypeName("#define SDL_PRESSED 1")] - public const int SDL_PRESSED = 1; - - [NativeTypeName("#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)")] - public const int SDL_TEXTEDITINGEVENT_TEXT_SIZE = (32); - - [NativeTypeName("#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)")] - public const int SDL_TEXTINPUTEVENT_TEXT_SIZE = (32); - - [NativeTypeName("#define SDL_QUERY -1")] - public const int SDL_QUERY = -1; - - [NativeTypeName("#define SDL_IGNORE 0")] - public const int SDL_IGNORE = 0; - - [NativeTypeName("#define SDL_DISABLE 0")] - public const int SDL_DISABLE = 0; - - [NativeTypeName("#define SDL_ENABLE 1")] - public const int SDL_ENABLE = 1; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDToString", ExactSpelling = true)] - public static extern void GUIDToString(SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GUIDFromString", ExactSpelling = true)] - public static extern SDL_GUID GUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHintWithPriority", ExactSpelling = true)] - public static extern SDL_bool SetHintWithPriority([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value, SDL_HintPriority priority); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)] - public static extern SDL_bool SetHint([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHint", ExactSpelling = true)] - public static extern SDL_bool ResetHint([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetHints", ExactSpelling = true)] - public static extern void ResetHints(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHint", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetHint([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetHintBoolean", ExactSpelling = true)] - public static extern SDL_bool GetHintBoolean([NativeTypeName("const char *")] sbyte* name, SDL_bool default_value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AddHintCallback", ExactSpelling = true)] - public static extern void AddHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DelHintCallback", ExactSpelling = true)] - public static extern void DelHintCallback([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl] callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearHints", ExactSpelling = true)] - public static extern void ClearHints(); - - [NativeTypeName("#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"SDL_ACCELEROMETER_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_ACCELEROMETER_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x4F, 0x4D, 0x45, 0x54, 0x45, 0x52, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x54, 0x41, 0x42, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x42, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ALLOW_TOPMOST \"SDL_ALLOW_TOPMOST\"")] - public static ReadOnlySpan SDL_HINT_ALLOW_TOPMOST => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x4F, 0x50, 0x4D, 0x4F, 0x53, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x4D, 0x41, 0x49, 0x4E, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x41, 0x50, 0x4B, 0x5F, 0x45, 0x58, 0x50, 0x41, 0x4E, 0x53, 0x49, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x42, 0x4C, 0x4F, 0x43, 0x4B, 0x5F, 0x4F, 0x4E, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x5F, 0x50, 0x41, 0x55, 0x53, 0x45, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_ANDROID_TRAP_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x4E, 0x44, 0x52, 0x4F, 0x49, 0x44, 0x5F, 0x54, 0x52, 0x41, 0x50, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APP_NAME \"SDL_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS \"SDL_APPLE_TV_CONTROLLER_UI_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x49, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION \"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION\"")] - public static ReadOnlySpan SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x50, 0x50, 0x4C, 0x45, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x52, 0x4F, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_CATEGORY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4F, 0x52, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"SDL_AUDIO_DEVICE_APP_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_APP_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x41, 0x50, 0x50, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"SDL_AUDIO_DEVICE_STREAM_NAME\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x5F, 0x52, 0x4F, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_RESAMPLING_MODE \"SDL_AUDIO_RESAMPLING_MODE\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_RESAMPLING_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x52, 0x45, 0x53, 0x41, 0x4D, 0x50, 0x4C, 0x49, 0x4E, 0x47, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_JOYSTICKS \"SDL_AUTO_UPDATE_JOYSTICKS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_JOYSTICKS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUTO_UPDATE_SENSORS \"SDL_AUTO_UPDATE_SENSORS\"")] - public static ReadOnlySpan SDL_HINT_AUTO_UPDATE_SENSORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5F, 0x53, 0x45, 0x4E, 0x53, 0x4F, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT \"SDL_BMP_SAVE_LEGACY_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_BMP_SAVE_LEGACY_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x42, 0x4D, 0x50, 0x5F, 0x53, 0x41, 0x56, 0x45, 0x5F, 0x4C, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] - public static ReadOnlySpan SDL_HINT_DISPLAY_USABLE_BOUNDS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x4C, 0x41, 0x59, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x4F, 0x55, 0x4E, 0x44, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_ASYNCIFY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x49, 0x46, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] - public static ReadOnlySpan SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4D, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x5F, 0x45, 0x4C, 0x45, 0x4D, 0x45, 0x4E, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_SCREEN_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ENABLE_STEAM_CONTROLLERS \"SDL_ENABLE_STEAM_CONTROLLERS\"")] - public static ReadOnlySpan SDL_HINT_ENABLE_STEAM_CONTROLLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_EVENT_LOGGING \"SDL_EVENT_LOGGING\"")] - public static ReadOnlySpan SDL_HINT_EVENT_LOGGING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x5F, 0x4C, 0x4F, 0x47, 0x47, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_FORCE_RAISEWINDOW \"SDL_HINT_FORCE_RAISEWINDOW\"")] - public static ReadOnlySpan SDL_HINT_FORCE_RAISEWINDOW => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x41, 0x49, 0x53, 0x45, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x00 }; - - [NativeTypeName("#define SDL_HINT_FRAMEBUFFER_ACCELERATION \"SDL_FRAMEBUFFER_ACCELERATION\"")] - public static ReadOnlySpan SDL_HINT_FRAMEBUFFER_ACCELERATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x5F, 0x41, 0x43, 0x43, 0x45, 0x4C, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG \"SDL_GAMECONTROLLERCONFIG\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"SDL_GAMECONTROLLERCONFIG_FILE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERCONFIG_FILE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x43, 0x4F, 0x4E, 0x46, 0x49, 0x47, 0x5F, 0x46, 0x49, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLERTYPE \"SDL_GAMECONTROLLERTYPE\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLERTYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x54, 0x59, 0x50, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES \"SDL_GAMECONTROLLER_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT \"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x5F, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"SDL_GAMECONTROLLER_USE_BUTTON_LABELS\"")] - public static ReadOnlySpan SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x4F, 0x4E, 0x54, 0x52, 0x4F, 0x4C, 0x4C, 0x45, 0x52, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_GRAB_KEYBOARD \"SDL_GRAB_KEYBOARD\"")] - public static ReadOnlySpan SDL_HINT_GRAB_KEYBOARD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x47, 0x52, 0x41, 0x42, 0x5F, 0x4B, 0x45, 0x59, 0x42, 0x4F, 0x41, 0x52, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_HIDAPI_IGNORE_DEVICES \"SDL_HIDAPI_IGNORE_DEVICES\"")] - public static ReadOnlySpan SDL_HINT_HIDAPI_IGNORE_DEVICES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x49, 0x47, 0x4E, 0x4F, 0x52, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IDLE_TIMER_DISABLED \"SDL_IOS_IDLE_TIMER_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_IDLE_TIMER_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x49, 0x44, 0x4C, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_INTERNAL_EDITING \"SDL_IME_INTERNAL_EDITING\"")] - public static ReadOnlySpan SDL_HINT_IME_INTERNAL_EDITING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_SHOW_UI \"SDL_IME_SHOW_UI\"")] - public static ReadOnlySpan SDL_HINT_IME_SHOW_UI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x5F, 0x55, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"SDL_IME_SUPPORT_EXTENDED_TEXT\"")] - public static ReadOnlySpan SDL_HINT_IME_SUPPORT_EXTENDED_TEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4D, 0x45, 0x5F, 0x53, 0x55, 0x50, 0x50, 0x4F, 0x52, 0x54, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"SDL_IOS_HIDE_HOME_INDICATOR\"")] - public static ReadOnlySpan SDL_HINT_IOS_HIDE_HOME_INDICATOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x49, 0x43, 0x41, 0x54, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS \"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI \"SDL_JOYSTICK_HIDAPI\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"SDL_JOYSTICK_HIDAPI_GAMECUBE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE \"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x47, 0x41, 0x4D, 0x45, 0x43, 0x55, 0x42, 0x45, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x52, 0x41, 0x4B, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS \"SDL_JOYSTICK_HIDAPI_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS \"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x43, 0x4F, 0x4D, 0x42, 0x49, 0x4E, 0x45, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x56, 0x45, 0x52, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x5F, 0x43, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LUNA \"SDL_JOYSTICK_HIDAPI_LUNA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_LUNA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4C, 0x55, 0x4E, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC \"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4E, 0x49, 0x4E, 0x54, 0x45, 0x4E, 0x44, 0x4F, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SHIELD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x48, 0x49, 0x45, 0x4C, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS3 \"SDL_JOYSTICK_HIDAPI_PS3\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS3 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x33, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4 \"SDL_JOYSTICK_HIDAPI_PS4\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x34, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x50, 0x53, 0x35, 0x5F, 0x52, 0x55, 0x4D, 0x42, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STADIA \"SDL_JOYSTICK_HIDAPI_STADIA\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STADIA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x41, 0x44, 0x49, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_STEAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x54, 0x45, 0x41, 0x4D, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED \"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x4A, 0x4F, 0x59, 0x43, 0x4F, 0x4E, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII \"SDL_JOYSTICK_HIDAPI_WII\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x57, 0x49, 0x49, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX \"SDL_JOYSTICK_HIDAPI_XBOX\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 \"SDL_JOYSTICK_HIDAPI_XBOX_360\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x50, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS \"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x33, 0x36, 0x30, 0x5F, 0x57, 0x49, 0x52, 0x45, 0x4C, 0x45, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE \"SDL_JOYSTICK_HIDAPI_XBOX_ONE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x48, 0x49, 0x44, 0x41, 0x50, 0x49, 0x5F, 0x58, 0x42, 0x4F, 0x58, 0x5F, 0x4F, 0x4E, 0x45, 0x5F, 0x48, 0x4F, 0x4D, 0x45, 0x5F, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT \"SDL_JOYSTICK_RAWINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x57, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x43, 0x4F, 0x52, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"SDL_JOYSTICK_ROG_CHAKRAM\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_ROG_CHAKRAM => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x4F, 0x47, 0x5F, 0x43, 0x48, 0x41, 0x4B, 0x52, 0x41, 0x4D, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_THREAD \"SDL_JOYSTICK_THREAD\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_THREAD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5F, 0x44, 0x52, 0x4D, 0x5F, 0x4D, 0x41, 0x53, 0x54, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_JOYSTICK_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_DIGITAL_HATS \"SDL_LINUX_DIGITAL_HATS\"")] - public static ReadOnlySpan SDL_HINT_LINUX_DIGITAL_HATS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_HAT_DEADZONES \"SDL_LINUX_HAT_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_HAT_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x48, 0x41, 0x54, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"SDL_LINUX_JOYSTICK_CLASSIC\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_CLASSIC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x43, 0x4C, 0x41, 0x53, 0x53, 0x49, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"SDL_LINUX_JOYSTICK_DEADZONES\"")] - public static ReadOnlySpan SDL_HINT_LINUX_JOYSTICK_DEADZONES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4C, 0x49, 0x4E, 0x55, 0x58, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x44, 0x45, 0x41, 0x44, 0x5A, 0x4F, 0x4E, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_BACKGROUND_APP \"SDL_MAC_BACKGROUND_APP\"")] - public static ReadOnlySpan SDL_HINT_MAC_BACKGROUND_APP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x47, 0x52, 0x4F, 0x55, 0x4E, 0x44, 0x5F, 0x41, 0x50, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")] - public static ReadOnlySpan SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x43, 0x54, 0x52, 0x4C, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x52, 0x49, 0x47, 0x48, 0x54, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")] - public static ReadOnlySpan SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x41, 0x53, 0x59, 0x4E, 0x43, 0x5F, 0x44, 0x49, 0x53, 0x50, 0x41, 0x54, 0x43, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"SDL_MOUSE_DOUBLE_CLICK_RADIUS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x52, 0x41, 0x44, 0x49, 0x55, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH \"SDL_MOUSE_FOCUS_CLICKTHROUGH\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x43, 0x4C, 0x49, 0x43, 0x4B, 0x54, 0x48, 0x52, 0x4F, 0x55, 0x47, 0x48, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"SDL_MOUSE_NORMAL_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_NORMAL_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x4E, 0x4F, 0x52, 0x4D, 0x41, 0x4C, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x43, 0x45, 0x4E, 0x54, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_MODE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SCALING \"SDL_MOUSE_RELATIVE_SCALING\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE \"SDL_MOUSE_RELATIVE_SYSTEM_SCALE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION \"SDL_MOUSE_RELATIVE_WARP_MOTION\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_RELATIVE_WARP_MOTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x52, 0x45, 0x4C, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x5F, 0x4D, 0x4F, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_TOUCH_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_MOUSE_AUTO_CAPTURE \"SDL_MOUSE_AUTO_CAPTURE\"")] - public static ReadOnlySpan SDL_HINT_MOUSE_AUTO_CAPTURE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x41, 0x55, 0x54, 0x4F, 0x5F, 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_NO_SIGNAL_HANDLERS \"SDL_NO_SIGNAL_HANDLERS\"")] - public static ReadOnlySpan SDL_HINT_NO_SIGNAL_HANDLERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4E, 0x4F, 0x5F, 0x53, 0x49, 0x47, 0x4E, 0x41, 0x4C, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_OPENGL_ES_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x45, 0x53, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_IOS_ORIENTATIONS\"")] - public static ReadOnlySpan SDL_HINT_ORIENTATIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x49, 0x4F, 0x53, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")] - public static ReadOnlySpan SDL_HINT_POLL_SENTINEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x4F, 0x4C, 0x4C, 0x5F, 0x53, 0x45, 0x4E, 0x54, 0x49, 0x4E, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_PREFERRED_LOCALES \"SDL_PREFERRED_LOCALES\"")] - public static ReadOnlySpan SDL_HINT_PREFERRED_LOCALES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x52, 0x45, 0x44, 0x5F, 0x4C, 0x4F, 0x43, 0x41, 0x4C, 0x45, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION \"SDL_QTWAYLAND_CONTENT_ORIENTATION\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x4E, 0x54, 0x5F, 0x4F, 0x52, 0x49, 0x45, 0x4E, 0x54, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS \"SDL_QTWAYLAND_WINDOW_FLAGS\"")] - public static ReadOnlySpan SDL_HINT_QTWAYLAND_WINDOW_FLAGS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x54, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x4C, 0x41, 0x47, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_BATCHING \"SDL_RENDER_BATCHING\"")] - public static ReadOnlySpan SDL_HINT_RENDER_BATCHING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x42, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_LINE_METHOD \"SDL_RENDER_LINE_METHOD\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LINE_METHOD => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x4E, 0x45, 0x5F, 0x4D, 0x45, 0x54, 0x48, 0x4F, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D11_DEBUG => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x31, 0x31, 0x5F, 0x44, 0x45, 0x42, 0x55, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"SDL_RENDER_DIRECT3D_THREADSAFE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DIRECT3D_THREADSAFE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x33, 0x44, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x53, 0x41, 0x46, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")] - public static ReadOnlySpan SDL_HINT_RENDER_DRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"SDL_RENDER_LOGICAL_SIZE_MODE\"")] - public static ReadOnlySpan SDL_HINT_RENDER_LOGICAL_SIZE_MODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_OPENGL_SHADERS \"SDL_RENDER_OPENGL_SHADERS\"")] - public static ReadOnlySpan SDL_HINT_RENDER_OPENGL_SHADERS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x5F, 0x53, 0x48, 0x41, 0x44, 0x45, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_SCALE_QUALITY \"SDL_RENDER_SCALE_QUALITY\"")] - public static ReadOnlySpan SDL_HINT_RENDER_SCALE_QUALITY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x45, 0x5F, 0x51, 0x55, 0x41, 0x4C, 0x49, 0x54, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RENDER_VSYNC \"SDL_RENDER_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_RENDER_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x4E, 0x44, 0x45, 0x52, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_PS2_DYNAMIC_VSYNC \"SDL_PS2_DYNAMIC_VSYNC\"")] - public static ReadOnlySpan SDL_HINT_PS2_DYNAMIC_VSYNC => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x50, 0x53, 0x32, 0x5F, 0x44, 0x59, 0x4E, 0x41, 0x4D, 0x49, 0x43, 0x5F, 0x56, 0x53, 0x59, 0x4E, 0x43, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RETURN_KEY_HIDES_IME \"SDL_RETURN_KEY_HIDES_IME\"")] - public static ReadOnlySpan SDL_HINT_RETURN_KEY_HIDES_IME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4E, 0x5F, 0x4B, 0x45, 0x59, 0x5F, 0x48, 0x49, 0x44, 0x45, 0x53, 0x5F, 0x49, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] - public static ReadOnlySpan SDL_HINT_RPI_VIDEO_LAYER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x52, 0x50, 0x49, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4C, 0x41, 0x59, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME\"")] - public static ReadOnlySpan SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x5F, 0x49, 0x4E, 0x48, 0x49, 0x42, 0x49, 0x54, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5F, 0x4E, 0x41, 0x4D, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL\"")] - public static ReadOnlySpan SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x52, 0x45, 0x41, 0x4C, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_PRIORITY_POLICY \"SDL_THREAD_PRIORITY_POLICY\"")] - public static ReadOnlySpan SDL_HINT_THREAD_PRIORITY_POLICY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x50, 0x52, 0x49, 0x4F, 0x52, 0x49, 0x54, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_THREAD_STACK_SIZE \"SDL_THREAD_STACK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_THREAD_STACK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x53, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TIMER_RESOLUTION \"SDL_TIMER_RESOLUTION\"")] - public static ReadOnlySpan SDL_HINT_TIMER_RESOLUTION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x49, 0x4D, 0x45, 0x52, 0x5F, 0x52, 0x45, 0x53, 0x4F, 0x4C, 0x55, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TOUCH_MOUSE_EVENTS \"SDL_TOUCH_MOUSE_EVENTS\"")] - public static ReadOnlySpan SDL_HINT_TOUCH_MOUSE_EVENTS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE \"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE\"")] - public static ReadOnlySpan SDL_HINT_VITA_TOUCH_MOUSE_DEVICE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x48, 0x49, 0x4E, 0x54, 0x5F, 0x56, 0x49, 0x54, 0x41, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"SDL_TV_REMOTE_AS_JOYSTICK\"")] - public static ReadOnlySpan SDL_HINT_TV_REMOTE_AS_JOYSTICK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x56, 0x5F, 0x52, 0x45, 0x4D, 0x4F, 0x54, 0x45, 0x5F, 0x41, 0x53, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_ALLOW_SCREENSAVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x53, 0x41, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_DOUBLE_BUFFER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x44, 0x4F, 0x55, 0x42, 0x4C, 0x45, 0x5F, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x47, 0x4C, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x54, 0x52, 0x41, 0x4E, 0x53, 0x50, 0x41, 0x52, 0x45, 0x4E, 0x43, 0x59, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT \"SDL_VIDEO_EXTERNAL_CONTEXT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_EXTERNAL_CONTEXT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4E, 0x41, 0x4C, 0x5F, 0x43, 0x4F, 0x4E, 0x54, 0x45, 0x58, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"SDL_VIDEO_HIGHDPI_DISABLED\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_HIGHDPI_DISABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x48, 0x49, 0x47, 0x48, 0x44, 0x50, 0x49, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x41, 0x43, 0x5F, 0x46, 0x55, 0x4C, 0x4C, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4E, 0x5F, 0x53, 0x50, 0x41, 0x43, 0x45, 0x53, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x4D, 0x49, 0x4E, 0x49, 0x4D, 0x49, 0x5A, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x46, 0x4F, 0x43, 0x55, 0x53, 0x5F, 0x4C, 0x4F, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR \"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x41, 0x4C, 0x4C, 0x4F, 0x57, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5F, 0x4C, 0x49, 0x42, 0x44, 0x45, 0x43, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION \"SDL_VIDEO_WAYLAND_MODE_EMULATION\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x4F, 0x44, 0x45, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP \"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x41, 0x59, 0x4C, 0x41, 0x4E, 0x44, 0x5F, 0x45, 0x4D, 0x55, 0x4C, 0x41, 0x54, 0x45, 0x5F, 0x4D, 0x4F, 0x55, 0x53, 0x45, 0x5F, 0x57, 0x41, 0x52, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5F, 0x50, 0x49, 0x58, 0x45, 0x4C, 0x5F, 0x46, 0x4F, 0x52, 0x4D, 0x41, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"SDL_VIDEO_FOREIGN_WINDOW_OPENGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4F, 0x50, 0x45, 0x4E, 0x47, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"SDL_VIDEO_FOREIGN_WINDOW_VULKAN\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x46, 0x4F, 0x52, 0x45, 0x49, 0x47, 0x4E, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x55, 0x4C, 0x4B, 0x41, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_WIN_D3DCOMPILER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x57, 0x49, 0x4E, 0x5F, 0x44, 0x33, 0x44, 0x43, 0x4F, 0x4D, 0x50, 0x49, 0x4C, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_FORCE_EGL \"SDL_VIDEO_X11_FORCE_EGL\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_FORCE_EGL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x45, 0x47, 0x4C, 0x00 }; - - [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 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x42, 0x59, 0x50, 0x41, 0x53, 0x53, 0x5F, 0x43, 0x4F, 0x4D, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x4F, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_PING \"SDL_VIDEO_X11_NET_WM_PING\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_NET_WM_PING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x4E, 0x45, 0x54, 0x5F, 0x57, 0x4D, 0x5F, 0x50, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"SDL_VIDEO_X11_WINDOW_VISUALID\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_WINDOW_VISUALID => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x56, 0x49, 0x53, 0x55, 0x41, 0x4C, 0x49, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XINERAMA \"SDL_VIDEO_X11_XINERAMA\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XINERAMA => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x49, 0x4E, 0x45, 0x52, 0x41, 0x4D, 0x41, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XRANDR \"SDL_VIDEO_X11_XRANDR\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XRANDR => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x52, 0x41, 0x4E, 0x44, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEO_X11_XVIDMODE \"SDL_VIDEO_X11_XVIDMODE\"")] - public static ReadOnlySpan SDL_HINT_VIDEO_X11_XVIDMODE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x58, 0x56, 0x49, 0x44, 0x4D, 0x4F, 0x44, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_FACT_CHUNK \"SDL_WAVE_FACT_CHUNK\"")] - public static ReadOnlySpan SDL_HINT_WAVE_FACT_CHUNK => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x46, 0x41, 0x43, 0x54, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE \"SDL_WAVE_RIFF_CHUNK_SIZE\"")] - public static ReadOnlySpan SDL_HINT_WAVE_RIFF_CHUNK_SIZE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x52, 0x49, 0x46, 0x46, 0x5F, 0x43, 0x48, 0x55, 0x4E, 0x4B, 0x5F, 0x53, 0x49, 0x5A, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WAVE_TRUNCATION \"SDL_WAVE_TRUNCATION\"")] - public static ReadOnlySpan SDL_HINT_WAVE_TRUNCATION => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x41, 0x56, 0x45, 0x5F, 0x54, 0x52, 0x55, 0x4E, 0x43, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING \"SDL_WINDOWS_DISABLE_THREAD_NAMING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x5F, 0x4E, 0x41, 0x4D, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS \"SDL_WINDOWS_ENABLE_MENU_MNEMONICS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x4E, 0x55, 0x5F, 0x4D, 0x4E, 0x45, 0x4D, 0x4F, 0x4E, 0x49, 0x43, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x4D, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x4C, 0x4F, 0x4F, 0x50, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS \"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4D, 0x55, 0x54, 0x45, 0x58, 0x5F, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4C, 0x5F, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4F, 0x4E, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x53, 0x45, 0x4D, 0x41, 0x50, 0x48, 0x4F, 0x52, 0x45, 0x5F, 0x4B, 0x45, 0x52, 0x4E, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON \"SDL_WINDOWS_INTRESOURCE_ICON\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"SDL_WINDOWS_INTRESOURCE_ICON_SMALL\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x49, 0x4E, 0x54, 0x52, 0x45, 0x53, 0x4F, 0x55, 0x52, 0x43, 0x45, 0x5F, 0x49, 0x43, 0x4F, 0x4E, 0x5F, 0x53, 0x4D, 0x41, 0x4C, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x4E, 0x4F, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x5F, 0x4F, 0x4E, 0x5F, 0x41, 0x4C, 0x54, 0x5F, 0x46, 0x34, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_USE_D3D9EX \"SDL_WINDOWS_USE_D3D9EX\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_USE_D3D9EX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x44, 0x33, 0x44, 0x39, 0x45, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_AWARENESS \"SDL_WINDOWS_DPI_AWARENESS\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_AWARENESS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x41, 0x57, 0x41, 0x52, 0x45, 0x4E, 0x45, 0x53, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOWS_DPI_SCALING \"SDL_WINDOWS_DPI_SCALING\"")] - public static ReadOnlySpan SDL_HINT_WINDOWS_DPI_SCALING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x53, 0x5F, 0x44, 0x50, 0x49, 0x5F, 0x53, 0x43, 0x41, 0x4C, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x46, 0x52, 0x41, 0x4D, 0x45, 0x5F, 0x55, 0x53, 0x41, 0x42, 0x4C, 0x45, 0x5F, 0x57, 0x48, 0x49, 0x4C, 0x45, 0x5F, 0x43, 0x55, 0x52, 0x53, 0x4F, 0x52, 0x5F, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN \"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN\"")] - public static ReadOnlySpan SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x4E, 0x4F, 0x5F, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4F, 0x4E, 0x5F, 0x57, 0x48, 0x45, 0x4E, 0x5F, 0x53, 0x48, 0x4F, 0x57, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")] - public static ReadOnlySpan SDL_HINT_WINRT_HANDLE_BACK_BUTTON => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x48, 0x41, 0x4E, 0x44, 0x4C, 0x45, 0x5F, 0x42, 0x41, 0x43, 0x4B, 0x5F, 0x42, 0x55, 0x54, 0x54, 0x4F, 0x4E, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x4C, 0x41, 0x42, 0x45, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")] - public static ReadOnlySpan SDL_HINT_WINRT_PRIVACY_POLICY_URL => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x57, 0x49, 0x4E, 0x52, 0x54, 0x5F, 0x50, 0x52, 0x49, 0x56, 0x41, 0x43, 0x59, 0x5F, 0x50, 0x4F, 0x4C, 0x49, 0x43, 0x59, 0x5F, 0x55, 0x52, 0x4C, 0x00 }; - - [NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")] - public static ReadOnlySpan SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x46, 0x4F, 0x52, 0x43, 0x45, 0x5F, 0x4F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x5F, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x00 }; - - [NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_DIRECTINPUT_ENABLED \"SDL_DIRECTINPUT_ENABLED\"")] - public static ReadOnlySpan SDL_HINT_DIRECTINPUT_ENABLED => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x45, 0x4E, 0x41, 0x42, 0x4C, 0x45, 0x44, 0x00 }; - - [NativeTypeName("#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING\"")] - public static ReadOnlySpan SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x49, 0x4E, 0x50, 0x55, 0x54, 0x5F, 0x55, 0x53, 0x45, 0x5F, 0x4F, 0x4C, 0x44, 0x5F, 0x4A, 0x4F, 0x59, 0x53, 0x54, 0x49, 0x43, 0x4B, 0x5F, 0x4D, 0x41, 0x50, 0x50, 0x49, 0x4E, 0x47, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"SDL_AUDIO_INCLUDE_MONITORS\"")] - public static ReadOnlySpan SDL_HINT_AUDIO_INCLUDE_MONITORS => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x5F, 0x49, 0x4E, 0x43, 0x4C, 0x55, 0x44, 0x45, 0x5F, 0x4D, 0x4F, 0x4E, 0x49, 0x54, 0x4F, 0x52, 0x53, 0x00 }; - - [NativeTypeName("#define SDL_HINT_X11_WINDOW_TYPE \"SDL_X11_WINDOW_TYPE\"")] - public static ReadOnlySpan SDL_HINT_X11_WINDOW_TYPE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x58, 0x31, 0x31, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"SDL_QUIT_ON_LAST_WINDOW_CLOSE\"")] - public static ReadOnlySpan SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x51, 0x55, 0x49, 0x54, 0x5F, 0x4F, 0x4E, 0x5F, 0x4C, 0x41, 0x53, 0x54, 0x5F, 0x57, 0x49, 0x4E, 0x44, 0x4F, 0x57, 0x5F, 0x43, 0x4C, 0x4F, 0x53, 0x45, 0x00 }; - - [NativeTypeName("#define SDL_HINT_VIDEODRIVER \"SDL_VIDEODRIVER\"")] - public static ReadOnlySpan SDL_HINT_VIDEODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x56, 0x49, 0x44, 0x45, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_AUDIODRIVER \"SDL_AUDIODRIVER\"")] - public static ReadOnlySpan SDL_HINT_AUDIODRIVER => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x41, 0x55, 0x44, 0x49, 0x4F, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x00 }; - - [NativeTypeName("#define SDL_HINT_KMSDRM_DEVICE_INDEX \"SDL_KMSDRM_DEVICE_INDEX\"")] - public static ReadOnlySpan SDL_HINT_KMSDRM_DEVICE_INDEX => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x4B, 0x4D, 0x53, 0x44, 0x52, 0x4D, 0x5F, 0x44, 0x45, 0x56, 0x49, 0x43, 0x45, 0x5F, 0x49, 0x4E, 0x44, 0x45, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY \"SDL_TRACKPAD_IS_TOUCH_ONLY\"")] - public static ReadOnlySpan SDL_HINT_TRACKPAD_IS_TOUCH_ONLY => new byte[] { 0x53, 0x44, 0x4C, 0x5F, 0x54, 0x52, 0x41, 0x43, 0x4B, 0x50, 0x41, 0x44, 0x5F, 0x49, 0x53, 0x5F, 0x54, 0x4F, 0x55, 0x43, 0x48, 0x5F, 0x4F, 0x4E, 0x4C, 0x59, 0x00 }; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockJoysticks", ExactSpelling = true)] - public static extern void LockJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockJoysticks", ExactSpelling = true)] - public static extern void UnlockJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_NumJoysticks", ExactSpelling = true)] - public static extern int NumJoysticks(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNameForIndex", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickNameForIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPathForIndex", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickPathForIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDevicePlayerIndex", ExactSpelling = true)] - public static extern int JoystickGetDevicePlayerIndex(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceGUID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetDeviceGUID(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceVendor", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceVendor(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProduct", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceProduct(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceProductVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetDeviceProductVersion(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceType", ExactSpelling = true)] - public static extern SDL_JoystickType JoystickGetDeviceType(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetDeviceInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickID")] - public static extern int JoystickGetDeviceInstanceID(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickOpen", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickOpen(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickFromInstanceID([NativeTypeName("SDL_JoystickID")] int instance_id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickFromPlayerIndex", ExactSpelling = true)] - [return: NativeTypeName("SDL_Joystick *")] - public static extern _SDL_Joystick* JoystickFromPlayerIndex(int player_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtual", ExactSpelling = true)] - public static extern int JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickAttachVirtualEx", ExactSpelling = true)] - public static extern int JoystickAttachVirtualEx([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickDetachVirtual", ExactSpelling = true)] - public static extern int JoystickDetachVirtual(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickIsVirtual", ExactSpelling = true)] - public static extern SDL_bool JoystickIsVirtual(int device_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualAxis", ExactSpelling = true)] - public static extern int JoystickSetVirtualAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualButton", ExactSpelling = true)] - public static extern int JoystickSetVirtualButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetVirtualHat", ExactSpelling = true)] - public static extern int JoystickSetVirtualHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickName([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickPath", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickPath([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetPlayerIndex", ExactSpelling = true)] - public static extern int JoystickGetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetPlayerIndex", ExactSpelling = true)] - public static extern void JoystickSetPlayerIndex([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int player_index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetGUID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetVendor", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetVendor([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProduct", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetProduct([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetProductVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetProductVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetFirmwareVersion", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort JoystickGetFirmwareVersion([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetSerial", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* JoystickGetSerial([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetType", ExactSpelling = true)] - public static extern SDL_JoystickType JoystickGetType([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDString", ExactSpelling = true)] - public static extern void JoystickGetGUIDString([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("char *")] sbyte* pszGUID, int cbGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetGUIDFromString", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickGUID")] - public static extern SDL_GUID JoystickGetGUIDFromString([NativeTypeName("const char *")] sbyte* pchGUID); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetJoystickGUIDInfo", ExactSpelling = true)] - public static extern void GetJoystickGUIDInfo([NativeTypeName("SDL_JoystickGUID")] SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAttached", ExactSpelling = true)] - public static extern SDL_bool JoystickGetAttached([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickInstanceID", ExactSpelling = true)] - [return: NativeTypeName("SDL_JoystickID")] - public static extern int JoystickInstanceID([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumAxes", ExactSpelling = true)] - public static extern int JoystickNumAxes([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumBalls", ExactSpelling = true)] - public static extern int JoystickNumBalls([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumHats", ExactSpelling = true)] - public static extern int JoystickNumHats([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickNumButtons", ExactSpelling = true)] - public static extern int JoystickNumButtons([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickUpdate", ExactSpelling = true)] - public static extern void JoystickUpdate(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickEventState", ExactSpelling = true)] - public static extern int JoystickEventState(int state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxis", ExactSpelling = true)] - [return: NativeTypeName("Sint16")] - public static extern short JoystickGetAxis([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetAxisInitialState", ExactSpelling = true)] - public static extern SDL_bool JoystickGetAxisInitialState([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetHat", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte JoystickGetHat([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int hat); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetBall", ExactSpelling = true)] - public static extern int JoystickGetBall([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int ball, int* dx, int* dy); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickGetButton", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte JoystickGetButton([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, int button); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumble", ExactSpelling = true)] - public static extern int JoystickRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickRumbleTriggers", ExactSpelling = true)] - public static extern int JoystickRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasLED", ExactSpelling = true)] - public static extern SDL_bool JoystickHasLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumble", ExactSpelling = true)] - public static extern SDL_bool JoystickHasRumble([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickHasRumbleTriggers", ExactSpelling = true)] - public static extern SDL_bool JoystickHasRumbleTriggers([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSetLED", ExactSpelling = true)] - public static extern int JoystickSetLED([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickSendEffect", ExactSpelling = true)] - public static extern int JoystickSendEffect([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick, [NativeTypeName("const void *")] void* data, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickClose", ExactSpelling = true)] - public static extern void JoystickClose([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_JoystickCurrentPowerLevel", ExactSpelling = true)] - public static extern SDL_JoystickPowerLevel JoystickCurrentPowerLevel([NativeTypeName("SDL_Joystick *")] _SDL_Joystick* joystick); - - [NativeTypeName("#define SDL_IPHONE_MAX_GFORCE 5.0")] - public const double SDL_IPHONE_MAX_GFORCE = 5.0; - - [NativeTypeName("#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1")] - public const int SDL_VIRTUAL_JOYSTICK_DESC_VERSION = 1; - - [NativeTypeName("#define SDL_JOYSTICK_AXIS_MAX 32767")] - public const int SDL_JOYSTICK_AXIS_MAX = 32767; - - [NativeTypeName("#define SDL_JOYSTICK_AXIS_MIN -32768")] - public const int SDL_JOYSTICK_AXIS_MIN = -32768; - - [NativeTypeName("#define SDL_HAT_CENTERED 0x00")] - public const int SDL_HAT_CENTERED = 0x00; - - [NativeTypeName("#define SDL_HAT_UP 0x01")] - public const int SDL_HAT_UP = 0x01; - - [NativeTypeName("#define SDL_HAT_RIGHT 0x02")] - public const int SDL_HAT_RIGHT = 0x02; - - [NativeTypeName("#define SDL_HAT_DOWN 0x04")] - public const int SDL_HAT_DOWN = 0x04; - - [NativeTypeName("#define SDL_HAT_LEFT 0x08")] - public const int SDL_HAT_LEFT = 0x08; - - [NativeTypeName("#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)")] - public const int SDL_HAT_RIGHTUP = (0x02 | 0x01); - - [NativeTypeName("#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)")] - public const int SDL_HAT_RIGHTDOWN = (0x02 | 0x04); - - [NativeTypeName("#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)")] - public const int SDL_HAT_LEFTUP = (0x08 | 0x01); - - [NativeTypeName("#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)")] - public const int SDL_HAT_LEFTDOWN = (0x08 | 0x04); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardFocus", ExactSpelling = true)] - public static extern SDL_Window* GetKeyboardFocus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyboardState", ExactSpelling = true)] - [return: NativeTypeName("const Uint8 *")] - public static extern byte* GetKeyboardState(int* numkeys); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ResetKeyboard", ExactSpelling = true)] - public static extern void ResetKeyboard(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetModState", ExactSpelling = true)] - public static extern SDL_Keymod GetModState(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetModState", ExactSpelling = true)] - public static extern void SetModState(SDL_Keymod modstate); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromScancode", ExactSpelling = true)] - [return: NativeTypeName("SDL_Keycode")] - public static extern int GetKeyFromScancode(SDL_Scancode scancode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromKey", ExactSpelling = true)] - public static extern SDL_Scancode GetScancodeFromKey([NativeTypeName("SDL_Keycode")] int key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetScancodeName(SDL_Scancode scancode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeFromName", ExactSpelling = true)] - public static extern SDL_Scancode GetScancodeFromName([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetKeyName([NativeTypeName("SDL_Keycode")] int key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetKeyFromName", ExactSpelling = true)] - [return: NativeTypeName("SDL_Keycode")] - public static extern int GetKeyFromName([NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StartTextInput", ExactSpelling = true)] - public static extern void StartTextInput(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputActive", ExactSpelling = true)] - public static extern SDL_bool IsTextInputActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_StopTextInput", ExactSpelling = true)] - public static extern void StopTextInput(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ClearComposition", ExactSpelling = true)] - public static extern void ClearComposition(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTextInputShown", ExactSpelling = true)] - public static extern SDL_bool IsTextInputShown(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextInputRect", ExactSpelling = true)] - public static extern void SetTextInputRect([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasScreenKeyboardSupport", ExactSpelling = true)] - public static extern SDL_bool HasScreenKeyboardSupport(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenKeyboardShown", ExactSpelling = true)] - public static extern SDL_bool IsScreenKeyboardShown(SDL_Window* window); - - [NativeTypeName("#define SDLK_SCANCODE_MASK (1<<30)")] - public const int SDLK_SCANCODE_MASK = (1 << 30); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseFocus", ExactSpelling = true)] - public static extern SDL_Window* GetMouseFocus(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGlobalMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetGlobalMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseState", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetRelativeMouseState(int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseInWindow", ExactSpelling = true)] - public static extern void WarpMouseInWindow(SDL_Window* window, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseGlobal", ExactSpelling = true)] - public static extern int WarpMouseGlobal(int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRelativeMouseMode", ExactSpelling = true)] - public static extern int SetRelativeMouseMode(SDL_bool enabled); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CaptureMouse", ExactSpelling = true)] - public static extern int CaptureMouse(SDL_bool enabled); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRelativeMouseMode", ExactSpelling = true)] - public static extern SDL_bool GetRelativeMouseMode(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateColorCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSystemCursor", ExactSpelling = true)] - public static extern SDL_Cursor* CreateSystemCursor(SDL_SystemCursor id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetCursor", ExactSpelling = true)] - public static extern void SetCursor(SDL_Cursor* cursor); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCursor", ExactSpelling = true)] - public static extern SDL_Cursor* GetCursor(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDefaultCursor", ExactSpelling = true)] - public static extern SDL_Cursor* GetDefaultCursor(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeCursor", ExactSpelling = true)] - public static extern void FreeCursor(SDL_Cursor* cursor); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowCursor", ExactSpelling = true)] - public static extern int ShowCursor(int toggle); - - [NativeTypeName("#define SDL_BUTTON_LEFT 1")] - public const int SDL_BUTTON_LEFT = 1; - - [NativeTypeName("#define SDL_BUTTON_MIDDLE 2")] - public const int SDL_BUTTON_MIDDLE = 2; - - [NativeTypeName("#define SDL_BUTTON_RIGHT 3")] - public const int SDL_BUTTON_RIGHT = 3; - - [NativeTypeName("#define SDL_BUTTON_X1 4")] - public const int SDL_BUTTON_X1 = 4; - - [NativeTypeName("#define SDL_BUTTON_X2 5")] - public const int SDL_BUTTON_X2 = 5; - - [NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)")] - public const int SDL_BUTTON_LMASK = (1 << ((1) - 1)); - - [NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)")] - public const int SDL_BUTTON_MMASK = (1 << ((2) - 1)); - - [NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)")] - public const int SDL_BUTTON_RMASK = (1 << ((3) - 1)); - - [NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)")] - public const int SDL_BUTTON_X1MASK = (1 << ((4) - 1)); - - [NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)")] - public const int SDL_BUTTON_X2MASK = (1 << ((5) - 1)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPixelFormatName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetPixelFormatName([NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PixelFormatEnumToMasks", ExactSpelling = true)] - public static extern SDL_bool PixelFormatEnumToMasks([NativeTypeName("Uint32")] uint format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MasksToPixelFormatEnum", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MasksToPixelFormatEnum(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocFormat", ExactSpelling = true)] - public static extern SDL_PixelFormat* AllocFormat([NativeTypeName("Uint32")] uint pixel_format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeFormat", ExactSpelling = true)] - public static extern void FreeFormat(SDL_PixelFormat* format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocPalette", ExactSpelling = true)] - public static extern SDL_Palette* AllocPalette(int ncolors); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPixelFormatPalette", ExactSpelling = true)] - public static extern int SetPixelFormatPalette(SDL_PixelFormat* format, SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetPaletteColors", ExactSpelling = true)] - public static extern int SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreePalette", ExactSpelling = true)] - public static extern void FreePalette(SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGB", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MapRGB([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MapRGBA", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint MapRGBA([NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGB", ExactSpelling = true)] - public static extern void GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* format, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRGBA", ExactSpelling = true)] - public static extern void 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); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CalculateGammaRamp", ExactSpelling = true)] - public static extern void CalculateGammaRamp(float gamma, [NativeTypeName("Uint16 *")] ushort* ramp); - - [NativeTypeName("#define SDL_ALPHA_OPAQUE 255")] - public const int SDL_ALPHA_OPAQUE = 255; - - [NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")] - public const int SDL_ALPHA_TRANSPARENT = 0; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumRenderDrivers", ExactSpelling = true)] - public static extern int GetNumRenderDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDriverInfo", ExactSpelling = true)] - public static extern int GetRenderDriverInfo(int index, SDL_RendererInfo* info); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowAndRenderer", ExactSpelling = true)] - public static extern int CreateWindowAndRenderer(int width, int height, [NativeTypeName("Uint32")] uint window_flags, SDL_Window** window, SDL_Renderer** renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* CreateRenderer(SDL_Window* window, int index, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateSoftwareRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* CreateSoftwareRenderer(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderer", ExactSpelling = true)] - public static extern SDL_Renderer* GetRenderer(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetWindow", ExactSpelling = true)] - public static extern SDL_Window* RenderGetWindow(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererInfo", ExactSpelling = true)] - public static extern int GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRendererOutputSize", ExactSpelling = true)] - public static extern int GetRendererOutputSize(SDL_Renderer* renderer, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTexture", ExactSpelling = true)] - public static extern SDL_Texture* CreateTexture(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint format, int access, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateTextureFromSurface", ExactSpelling = true)] - public static extern SDL_Texture* CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_QueryTexture", ExactSpelling = true)] - public static extern int QueryTexture(SDL_Texture* texture, [NativeTypeName("Uint32 *")] uint* format, int* access, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureColorMod", ExactSpelling = true)] - public static extern int SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureColorMod", ExactSpelling = true)] - public static extern int GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureAlphaMod", ExactSpelling = true)] - public static extern int SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureAlphaMod", ExactSpelling = true)] - public static extern int GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureBlendMode", ExactSpelling = true)] - public static extern int SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureBlendMode", ExactSpelling = true)] - public static extern int GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureScaleMode", ExactSpelling = true)] - public static extern int SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureScaleMode", ExactSpelling = true)] - public static extern int GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetTextureUserData", ExactSpelling = true)] - public static extern int SetTextureUserData(SDL_Texture* texture, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetTextureUserData", ExactSpelling = true)] - public static extern void* GetTextureUserData(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateTexture", ExactSpelling = true)] - public static extern int UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] void* pixels, int pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateYUVTexture", ExactSpelling = true)] - public static extern int UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateNVTexture", ExactSpelling = true)] - public static extern int UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTexture", ExactSpelling = true)] - public static extern int LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, void** pixels, int* pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockTextureToSurface", ExactSpelling = true)] - public static extern int LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockTexture", ExactSpelling = true)] - public static extern void UnlockTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderTargetSupported", ExactSpelling = true)] - public static extern SDL_bool RenderTargetSupported(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderTarget", ExactSpelling = true)] - public static extern int SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderTarget", ExactSpelling = true)] - public static extern SDL_Texture* GetRenderTarget(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetLogicalSize", ExactSpelling = true)] - public static extern int RenderSetLogicalSize(SDL_Renderer* renderer, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetLogicalSize", ExactSpelling = true)] - public static extern void RenderGetLogicalSize(SDL_Renderer* renderer, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetIntegerScale", ExactSpelling = true)] - public static extern int RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetIntegerScale", ExactSpelling = true)] - public static extern SDL_bool RenderGetIntegerScale(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetViewport", ExactSpelling = true)] - public static extern int RenderSetViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetViewport", ExactSpelling = true)] - public static extern void RenderGetViewport(SDL_Renderer* renderer, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetClipRect", ExactSpelling = true)] - public static extern int RenderSetClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetClipRect", ExactSpelling = true)] - public static extern void RenderGetClipRect(SDL_Renderer* renderer, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderIsClipEnabled", ExactSpelling = true)] - public static extern SDL_bool RenderIsClipEnabled(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetScale", ExactSpelling = true)] - public static extern int RenderSetScale(SDL_Renderer* renderer, float scaleX, float scaleY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetScale", ExactSpelling = true)] - public static extern void RenderGetScale(SDL_Renderer* renderer, float* scaleX, float* scaleY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderWindowToLogical", ExactSpelling = true)] - public static extern void RenderWindowToLogical(SDL_Renderer* renderer, int windowX, int windowY, float* logicalX, float* logicalY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderLogicalToWindow", ExactSpelling = true)] - public static extern void RenderLogicalToWindow(SDL_Renderer* renderer, float logicalX, float logicalY, int* windowX, int* windowY); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawColor", ExactSpelling = true)] - public static extern int SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawColor", ExactSpelling = true)] - public static extern int GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetRenderDrawBlendMode", ExactSpelling = true)] - public static extern int SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRenderDrawBlendMode", ExactSpelling = true)] - public static extern int GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderClear", ExactSpelling = true)] - public static extern int RenderClear(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoint", ExactSpelling = true)] - public static extern int RenderDrawPoint(SDL_Renderer* renderer, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPoints", ExactSpelling = true)] - public static extern int RenderDrawPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLine", ExactSpelling = true)] - public static extern int RenderDrawLine(SDL_Renderer* renderer, int x1, int y1, int x2, int y2); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLines", ExactSpelling = true)] - public static extern int RenderDrawLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_Point *")] SDL_Point* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRect", ExactSpelling = true)] - public static extern int RenderDrawRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRects", ExactSpelling = true)] - public static extern int RenderDrawRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRect", ExactSpelling = true)] - public static extern int RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRects", ExactSpelling = true)] - public static extern int RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopy", ExactSpelling = true)] - public static extern int RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyEx", ExactSpelling = true)] - public static extern int RenderCopyEx(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_Point *")] SDL_Point* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointF", ExactSpelling = true)] - public static extern int RenderDrawPointF(SDL_Renderer* renderer, float x, float y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawPointsF", ExactSpelling = true)] - public static extern int RenderDrawPointsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLineF", ExactSpelling = true)] - public static extern int RenderDrawLineF(SDL_Renderer* renderer, float x1, float y1, float x2, float y2); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawLinesF", ExactSpelling = true)] - public static extern int RenderDrawLinesF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectF", ExactSpelling = true)] - public static extern int RenderDrawRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderDrawRectsF", ExactSpelling = true)] - public static extern int RenderDrawRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectF", ExactSpelling = true)] - public static extern int RenderFillRectF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFillRectsF", ExactSpelling = true)] - public static extern int RenderFillRectsF(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyF", ExactSpelling = true)] - public static extern int RenderCopyF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderCopyExF", ExactSpelling = true)] - public static extern int RenderCopyExF(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_RendererFlip")] SDL_RendererFlip flip); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometry", ExactSpelling = true)] - public static extern int 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("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGeometryRaw", ExactSpelling = true)] - public static extern int 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 *")] void* indices, int num_indices, int size_indices); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderReadPixels", ExactSpelling = true)] - public static extern int RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint format, void* pixels, int pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderPresent", ExactSpelling = true)] - public static extern void RenderPresent(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyTexture", ExactSpelling = true)] - public static extern void DestroyTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyRenderer", ExactSpelling = true)] - public static extern void DestroyRenderer(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderFlush", ExactSpelling = true)] - public static extern int RenderFlush(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_BindTexture", ExactSpelling = true)] - public static extern int GL_BindTexture(SDL_Texture* texture, float* texw, float* texh); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnbindTexture", ExactSpelling = true)] - public static extern int GL_UnbindTexture(SDL_Texture* texture); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalLayer", ExactSpelling = true)] - public static extern void* RenderGetMetalLayer(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetMetalCommandEncoder", ExactSpelling = true)] - public static extern void* RenderGetMetalCommandEncoder(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderSetVSync", ExactSpelling = true)] - public static extern int RenderSetVSync(SDL_Renderer* renderer, int vsync); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFile", ExactSpelling = true)] - public static extern SDL_RWops* RWFromFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("const char *")] sbyte* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromFP", ExactSpelling = true)] - public static extern SDL_RWops* RWFromFP(void* fp, SDL_bool autoclose); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromMem", ExactSpelling = true)] - public static extern SDL_RWops* RWFromMem(void* mem, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWFromConstMem", ExactSpelling = true)] - public static extern SDL_RWops* RWFromConstMem([NativeTypeName("const void *")] void* mem, int size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_AllocRW", ExactSpelling = true)] - public static extern SDL_RWops* AllocRW(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeRW", ExactSpelling = true)] - public static extern void FreeRW(SDL_RWops* area); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWsize", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWsize(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWseek", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWseek(SDL_RWops* context, [NativeTypeName("Sint64")] long offset, int whence); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWtell", ExactSpelling = true)] - [return: NativeTypeName("Sint64")] - public static extern long RWtell(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWread", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint RWread(SDL_RWops* context, void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint maxnum); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWwrite", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint RWwrite(SDL_RWops* context, [NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] nuint size, [NativeTypeName("size_t")] nuint num); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RWclose", ExactSpelling = true)] - public static extern int RWclose(SDL_RWops* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile_RW", ExactSpelling = true)] - public static extern void* LoadFile_RW(SDL_RWops* src, [NativeTypeName("size_t *")] nuint* datasize, int freesrc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadFile", ExactSpelling = true)] - public static extern void* LoadFile([NativeTypeName("const char *")] sbyte* file, [NativeTypeName("size_t *")] nuint* datasize); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadU8", ExactSpelling = true)] - [return: NativeTypeName("Uint8")] - public static extern byte ReadU8(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE16", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort ReadLE16(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE16", ExactSpelling = true)] - [return: NativeTypeName("Uint16")] - public static extern ushort ReadBE16(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE32", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint ReadLE32(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE32", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint ReadBE32(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadLE64", ExactSpelling = true)] - [return: NativeTypeName("Uint64")] - public static extern ulong ReadLE64(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ReadBE64", ExactSpelling = true)] - [return: NativeTypeName("Uint64")] - public static extern ulong ReadBE64(SDL_RWops* src); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteU8", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteU8(SDL_RWops* dst, [NativeTypeName("Uint8")] byte value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE16", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteLE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE16", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteBE16(SDL_RWops* dst, [NativeTypeName("Uint16")] ushort value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE32", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteLE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE32", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteBE32(SDL_RWops* dst, [NativeTypeName("Uint32")] uint value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteLE64", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteLE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WriteBE64", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint WriteBE64(SDL_RWops* dst, [NativeTypeName("Uint64")] ulong value); - - [NativeTypeName("#define SDL_RWOPS_UNKNOWN 0U")] - public const uint SDL_RWOPS_UNKNOWN = 0U; - - [NativeTypeName("#define SDL_RWOPS_WINFILE 1U")] - public const uint SDL_RWOPS_WINFILE = 1U; - - [NativeTypeName("#define SDL_RWOPS_STDFILE 2U")] - public const uint SDL_RWOPS_STDFILE = 2U; - - [NativeTypeName("#define SDL_RWOPS_JNIFILE 3U")] - public const uint SDL_RWOPS_JNIFILE = 3U; - - [NativeTypeName("#define SDL_RWOPS_MEMORY 4U")] - public const uint SDL_RWOPS_MEMORY = 4U; - - [NativeTypeName("#define SDL_RWOPS_MEMORY_RO 5U")] - public const uint SDL_RWOPS_MEMORY_RO = 5U; - - [NativeTypeName("#define RW_SEEK_SET 0")] - public const int RW_SEEK_SET = 0; - - [NativeTypeName("#define RW_SEEK_CUR 1")] - public const int RW_SEEK_CUR = 1; - - [NativeTypeName("#define RW_SEEK_END 2")] - public const int RW_SEEK_END = 2; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_malloc", ExactSpelling = true)] - public static extern void* malloc([NativeTypeName("size_t")] nuint size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_calloc", ExactSpelling = true)] - public static extern void* calloc([NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_realloc", ExactSpelling = true)] - public static extern void* realloc(void* mem, [NativeTypeName("size_t")] nuint size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_free", ExactSpelling = true)] - public static extern void free(void* mem); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetOriginalMemoryFunctions", ExactSpelling = true)] - public static extern void GetOriginalMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMemoryFunctions", ExactSpelling = true)] - public static extern void GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]* free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMemoryFunctions", ExactSpelling = true)] - public static extern int SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl] malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl] calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl] realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl] free_func); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumAllocations", ExactSpelling = true)] - public static extern int GetNumAllocations(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strcasestr", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* strcasestr([NativeTypeName("const char *")] sbyte* haystack, [NativeTypeName("const char *")] sbyte* needle); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_open", ExactSpelling = true)] - [return: NativeTypeName("SDL_iconv_t")] - public static extern _SDL_iconv_t* iconv_open([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_close", ExactSpelling = true)] - public static extern int iconv_close([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv", ExactSpelling = true)] - [return: NativeTypeName("size_t")] - public static extern nuint iconv([NativeTypeName("SDL_iconv_t")] _SDL_iconv_t* cd, [NativeTypeName("const char **")] sbyte** inbuf, [NativeTypeName("size_t *")] nuint* inbytesleft, [NativeTypeName("char **")] sbyte** outbuf, [NativeTypeName("size_t *")] nuint* outbytesleft); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_iconv_string", ExactSpelling = true)] - [return: NativeTypeName("char *")] - public static extern sbyte* iconv_string([NativeTypeName("const char *")] sbyte* tocode, [NativeTypeName("const char *")] sbyte* fromcode, [NativeTypeName("const char *")] sbyte* inbuf, [NativeTypeName("size_t")] nuint inbytesleft); - - [NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")] - public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL; - - [NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")] - public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F)); - - [NativeTypeName("#define SDL_MIN_SINT8 ((Sint8)(~0x7F))")] - public const sbyte SDL_MIN_SINT8 = ((sbyte)(~0x7F)); - - [NativeTypeName("#define SDL_MAX_UINT8 ((Uint8)0xFF)")] - public const byte SDL_MAX_UINT8 = ((byte)(0xFF)); - - [NativeTypeName("#define SDL_MIN_UINT8 ((Uint8)0x00)")] - public const byte SDL_MIN_UINT8 = ((byte)(0x00)); - - [NativeTypeName("#define SDL_MAX_SINT16 ((Sint16)0x7FFF)")] - public const short SDL_MAX_SINT16 = ((short)(0x7FFF)); - - [NativeTypeName("#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF))")] - public const short SDL_MIN_SINT16 = ((short)(~0x7FFF)); - - [NativeTypeName("#define SDL_MAX_UINT16 ((Uint16)0xFFFF)")] - public const ushort SDL_MAX_UINT16 = ((ushort)(0xFFFF)); - - [NativeTypeName("#define SDL_MIN_UINT16 ((Uint16)0x0000)")] - public const ushort SDL_MIN_UINT16 = ((ushort)(0x0000)); - - [NativeTypeName("#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF)")] - public const int SDL_MAX_SINT32 = ((int)(0x7FFFFFFF)); - - [NativeTypeName("#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF))")] - public const int SDL_MIN_SINT32 = ((int)(~0x7FFFFFFF)); - - [NativeTypeName("#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu)")] - public const uint SDL_MAX_UINT32 = ((uint)(0xFFFFFFFFU)); - - [NativeTypeName("#define SDL_MIN_UINT32 ((Uint32)0x00000000)")] - public const uint SDL_MIN_UINT32 = ((uint)(0x00000000)); - - [NativeTypeName("#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll)")] - public const long SDL_MAX_SINT64 = ((long)(0x7FFFFFFFFFFFFFFFL)); - - [NativeTypeName("#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll))")] - public const long SDL_MIN_SINT64 = ((long)(~0x7FFFFFFFFFFFFFFFL)); - - [NativeTypeName("#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull)")] - public const ulong SDL_MAX_UINT64 = ((ulong)(0xFFFFFFFFFFFFFFFFUL)); - - [NativeTypeName("#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull))")] - public const ulong SDL_MIN_UINT64 = ((ulong)(0x0000000000000000UL)); - - [NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")] - public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; - - [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] - public static ReadOnlySpan SDL_PRIs64 => new byte[] { 0x49, 0x36, 0x34, 0x64, 0x00 }; - - [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] - public static ReadOnlySpan SDL_PRIu64 => new byte[] { 0x49, 0x36, 0x34, 0x75, 0x00 }; - - [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] - public static ReadOnlySpan SDL_PRIx64 => new byte[] { 0x49, 0x36, 0x34, 0x78, 0x00 }; - - [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] - public static ReadOnlySpan SDL_PRIX64 => new byte[] { 0x49, 0x36, 0x34, 0x58, 0x00 }; - - [NativeTypeName("#define SDL_PRIs32 \"d\"")] - public static ReadOnlySpan SDL_PRIs32 => new byte[] { 0x64, 0x00 }; - - [NativeTypeName("#define SDL_PRIu32 \"u\"")] - public static ReadOnlySpan SDL_PRIu32 => new byte[] { 0x75, 0x00 }; - - [NativeTypeName("#define SDL_PRIx32 \"x\"")] - public static ReadOnlySpan SDL_PRIx32 => new byte[] { 0x78, 0x00 }; - - [NativeTypeName("#define SDL_PRIX32 \"X\"")] - public static ReadOnlySpan SDL_PRIX32 => new byte[] { 0x58, 0x00 }; - - [NativeTypeName("#define M_PI 3.14159265358979323846264338327950288")] - public const double M_PI = 3.14159265358979323846264338327950288; - - [NativeTypeName("#define SDL_ICONV_ERROR (size_t)-1")] - public static readonly nuint SDL_ICONV_ERROR = unchecked((nuint)(-1)); - - [NativeTypeName("#define SDL_ICONV_E2BIG (size_t)-2")] - public static readonly nuint SDL_ICONV_E2BIG = unchecked((nuint)(-2)); - - [NativeTypeName("#define SDL_ICONV_EILSEQ (size_t)-3")] - public static readonly nuint SDL_ICONV_EILSEQ = unchecked((nuint)(-3)); - - [NativeTypeName("#define SDL_ICONV_EINVAL (size_t)-4")] - public static readonly nuint SDL_ICONV_EINVAL = unchecked((nuint)(-4)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurface", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurface([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormat", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceWithFormat([NativeTypeName("Uint32")] uint flags, int width, int height, int depth, [NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceFrom", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateRGBSurfaceWithFormatFrom", ExactSpelling = true)] - public static extern SDL_Surface* CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, [NativeTypeName("Uint32")] uint format); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FreeSurface", ExactSpelling = true)] - public static extern void FreeSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfacePalette", ExactSpelling = true)] - public static extern int SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LockSurface", ExactSpelling = true)] - public static extern int LockSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UnlockSurface", ExactSpelling = true)] - public static extern void UnlockSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LoadBMP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SaveBMP_RW", ExactSpelling = true)] - public static extern int SaveBMP_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceRLE", ExactSpelling = true)] - public static extern int SetSurfaceRLE(SDL_Surface* surface, int flag); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasSurfaceRLE", ExactSpelling = true)] - public static extern SDL_bool HasSurfaceRLE(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetColorKey", ExactSpelling = true)] - public static extern int SetColorKey(SDL_Surface* surface, int flag, [NativeTypeName("Uint32")] uint key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasColorKey", ExactSpelling = true)] - public static extern SDL_bool HasColorKey(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetColorKey", ExactSpelling = true)] - public static extern int GetColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceColorMod", ExactSpelling = true)] - public static extern int SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceColorMod", ExactSpelling = true)] - public static extern int GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceAlphaMod", ExactSpelling = true)] - public static extern int SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceAlphaMod", ExactSpelling = true)] - public static extern int GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetSurfaceBlendMode", ExactSpelling = true)] - public static extern int SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetSurfaceBlendMode", ExactSpelling = true)] - public static extern int GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetClipRect", ExactSpelling = true)] - public static extern SDL_bool SetClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipRect", ExactSpelling = true)] - public static extern void GetClipRect(SDL_Surface* surface, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DuplicateSurface", ExactSpelling = true)] - public static extern SDL_Surface* DuplicateSurface(SDL_Surface* surface); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurface", ExactSpelling = true)] - public static extern SDL_Surface* ConvertSurface(SDL_Surface* src, [NativeTypeName("const SDL_PixelFormat *")] SDL_PixelFormat* fmt, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertSurfaceFormat", ExactSpelling = true)] - public static extern SDL_Surface* ConvertSurfaceFormat(SDL_Surface* src, [NativeTypeName("Uint32")] uint pixel_format, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ConvertPixels", ExactSpelling = true)] - public static extern int ConvertPixels(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_PremultiplyAlpha", ExactSpelling = true)] - public static extern int PremultiplyAlpha(int width, int height, [NativeTypeName("Uint32")] uint src_format, [NativeTypeName("const void *")] void* src, int src_pitch, [NativeTypeName("Uint32")] uint dst_format, void* dst, int dst_pitch); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRect", ExactSpelling = true)] - public static extern int FillRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FillRects", ExactSpelling = true)] - public static extern int FillRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlit", ExactSpelling = true)] - public static extern int UpperBlit(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlit", ExactSpelling = true)] - public static extern int LowerBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretch", ExactSpelling = true)] - public static extern int SoftStretch(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SoftStretchLinear", ExactSpelling = true)] - public static extern int SoftStretchLinear(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpperBlitScaled", ExactSpelling = true)] - public static extern int UpperBlitScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_LowerBlitScaled", ExactSpelling = true)] - public static extern int LowerBlitScaled(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetYUVConversionMode", ExactSpelling = true)] - public static extern void SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionMode", ExactSpelling = true)] - public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionMode(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetYUVConversionModeForResolution", ExactSpelling = true)] - public static extern SDL_YUV_CONVERSION_MODE GetYUVConversionModeForResolution(int width, int height); - - [NativeTypeName("#define SDL_SWSURFACE 0")] - public const int SDL_SWSURFACE = 0; - - [NativeTypeName("#define SDL_PREALLOC 0x00000001")] - public const int SDL_PREALLOC = 0x00000001; - - [NativeTypeName("#define SDL_RLEACCEL 0x00000002")] - public const int SDL_RLEACCEL = 0x00000002; - - [NativeTypeName("#define SDL_DONTFREE 0x00000004")] - public const int SDL_DONTFREE = 0x00000004; - - [NativeTypeName("#define SDL_SIMD_ALIGNED 0x00000008")] - public const int SDL_SIMD_ALIGNED = 0x00000008; - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowsMessageHook", ExactSpelling = true)] - public static extern void SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Direct3D9GetAdapterIndex", ExactSpelling = true)] - public static extern int Direct3D9GetAdapterIndex(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D9Device", ExactSpelling = true)] - public static extern IDirect3DDevice9* RenderGetD3D9Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D11Device", ExactSpelling = true)] - public static extern ID3D11Device* RenderGetD3D11Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RenderGetD3D12Device", ExactSpelling = true)] - public static extern ID3D12Device* RenderGetD3D12Device(SDL_Renderer* renderer); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DXGIGetOutputInfo", ExactSpelling = true)] - public static extern SDL_bool DXGIGetOutputInfo(int displayIndex, int* adapterIndex, int* outputIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsTablet", ExactSpelling = true)] - public static extern SDL_bool IsTablet(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillTerminate", ExactSpelling = true)] - public static extern void OnApplicationWillTerminate(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidReceiveMemoryWarning", ExactSpelling = true)] - public static extern void OnApplicationDidReceiveMemoryWarning(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillResignActive", ExactSpelling = true)] - public static extern void OnApplicationWillResignActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidEnterBackground", ExactSpelling = true)] - public static extern void OnApplicationDidEnterBackground(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationWillEnterForeground", ExactSpelling = true)] - public static extern void OnApplicationWillEnterForeground(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_OnApplicationDidBecomeActive", ExactSpelling = true)] - public static extern void OnApplicationDidBecomeActive(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVersion", ExactSpelling = true)] - public static extern void GetVersion(SDL_version* ver); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevision", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetRevision(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRevisionNumber", ExactSpelling = true)] - public static extern int GetRevisionNumber(); - - [NativeTypeName("#define SDL_MAJOR_VERSION 2")] - public const int SDL_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_MINOR_VERSION 28")] - public const int SDL_MINOR_VERSION = 28; - - [NativeTypeName("#define SDL_PATCHLEVEL 0")] - public const int SDL_PATCHLEVEL = 0; - - [NativeTypeName("#define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)")] - public const int SDL_COMPILEDVERSION = ((2) * 1000 + (28) * 100 + (0)); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDrivers", ExactSpelling = true)] - public static extern int GetNumVideoDrivers(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetVideoDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetVideoDriver(int index); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoInit", ExactSpelling = true)] - public static extern int VideoInit([NativeTypeName("const char *")] sbyte* driver_name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_VideoQuit", ExactSpelling = true)] - public static extern void VideoQuit(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentVideoDriver", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetCurrentVideoDriver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumVideoDisplays", ExactSpelling = true)] - public static extern int GetNumVideoDisplays(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetDisplayName(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayBounds", ExactSpelling = true)] - public static extern int GetDisplayBounds(int displayIndex, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayUsableBounds", ExactSpelling = true)] - public static extern int GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayDPI", ExactSpelling = true)] - public static extern int GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayOrientation", ExactSpelling = true)] - public static extern SDL_DisplayOrientation GetDisplayOrientation(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetNumDisplayModes", ExactSpelling = true)] - public static extern int GetNumDisplayModes(int displayIndex); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDisplayMode", ExactSpelling = true)] - public static extern int GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetDesktopDisplayMode", ExactSpelling = true)] - public static extern int GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentDisplayMode", ExactSpelling = true)] - public static extern int GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClosestDisplayMode", ExactSpelling = true)] - public static extern SDL_DisplayMode* GetClosestDisplayMode(int displayIndex, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode, SDL_DisplayMode* closest); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPointDisplayIndex", ExactSpelling = true)] - public static extern int GetPointDisplayIndex([NativeTypeName("const SDL_Point *")] SDL_Point* point); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetRectDisplayIndex", ExactSpelling = true)] - public static extern int GetRectDisplayIndex([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayIndex", ExactSpelling = true)] - public static extern int GetWindowDisplayIndex(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowDisplayMode", ExactSpelling = true)] - public static extern int SetWindowDisplayMode(SDL_Window* window, [NativeTypeName("const SDL_DisplayMode *")] SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowDisplayMode", ExactSpelling = true)] - public static extern int GetWindowDisplayMode(SDL_Window* window, SDL_DisplayMode* mode); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowICCProfile", ExactSpelling = true)] - public static extern void* GetWindowICCProfile(SDL_Window* window, [NativeTypeName("size_t *")] nuint* size); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPixelFormat", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowPixelFormat(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindow", ExactSpelling = true)] - public static extern SDL_Window* CreateWindow([NativeTypeName("const char *")] sbyte* title, int x, int y, int w, int h, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowFrom", ExactSpelling = true)] - public static extern SDL_Window* CreateWindowFrom([NativeTypeName("const void *")] void* data); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowID", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowID(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFromID", ExactSpelling = true)] - public static extern SDL_Window* GetWindowFromID([NativeTypeName("Uint32")] uint id); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowFlags", ExactSpelling = true)] - [return: NativeTypeName("Uint32")] - public static extern uint GetWindowFlags(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowTitle", ExactSpelling = true)] - public static extern void SetWindowTitle(SDL_Window* window, [NativeTypeName("const char *")] sbyte* title); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowTitle", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* GetWindowTitle(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowIcon", ExactSpelling = true)] - public static extern void SetWindowIcon(SDL_Window* window, SDL_Surface* icon); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowData", ExactSpelling = true)] - public static extern void* SetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name, void* userdata); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowData", ExactSpelling = true)] - public static extern void* GetWindowData(SDL_Window* window, [NativeTypeName("const char *")] sbyte* name); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowPosition", ExactSpelling = true)] - public static extern void SetWindowPosition(SDL_Window* window, int x, int y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowPosition", ExactSpelling = true)] - public static extern void GetWindowPosition(SDL_Window* window, int* x, int* y); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowSize", ExactSpelling = true)] - public static extern void SetWindowSize(SDL_Window* window, int w, int h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSize", ExactSpelling = true)] - public static extern void GetWindowSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBordersSize", ExactSpelling = true)] - public static extern int GetWindowBordersSize(SDL_Window* window, int* top, int* left, int* bottom, int* right); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSizeInPixels", ExactSpelling = true)] - public static extern void GetWindowSizeInPixels(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMinimumSize", ExactSpelling = true)] - public static extern void SetWindowMinimumSize(SDL_Window* window, int min_w, int min_h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMinimumSize", ExactSpelling = true)] - public static extern void GetWindowMinimumSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMaximumSize", ExactSpelling = true)] - public static extern void SetWindowMaximumSize(SDL_Window* window, int max_w, int max_h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMaximumSize", ExactSpelling = true)] - public static extern void GetWindowMaximumSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBordered", ExactSpelling = true)] - public static extern void SetWindowBordered(SDL_Window* window, SDL_bool bordered); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowResizable", ExactSpelling = true)] - public static extern void SetWindowResizable(SDL_Window* window, SDL_bool resizable); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowAlwaysOnTop", ExactSpelling = true)] - public static extern void SetWindowAlwaysOnTop(SDL_Window* window, SDL_bool on_top); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ShowWindow", ExactSpelling = true)] - public static extern void ShowWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)] - public static extern void HideWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RaiseWindow", ExactSpelling = true)] - public static extern void RaiseWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MaximizeWindow", ExactSpelling = true)] - public static extern void MaximizeWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_MinimizeWindow", ExactSpelling = true)] - public static extern void MinimizeWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_RestoreWindow", ExactSpelling = true)] - public static extern void RestoreWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowFullscreen", ExactSpelling = true)] - public static extern int SetWindowFullscreen(SDL_Window* window, [NativeTypeName("Uint32")] uint flags); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HasWindowSurface", ExactSpelling = true)] - public static extern SDL_bool HasWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowSurface", ExactSpelling = true)] - public static extern SDL_Surface* GetWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurface", ExactSpelling = true)] - public static extern int UpdateWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UpdateWindowSurfaceRects", ExactSpelling = true)] - public static extern int UpdateWindowSurfaceRects(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int numrects); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindowSurface", ExactSpelling = true)] - public static extern int DestroyWindowSurface(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGrab", ExactSpelling = true)] - public static extern void SetWindowGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowKeyboardGrab", ExactSpelling = true)] - public static extern void SetWindowKeyboardGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseGrab", ExactSpelling = true)] - public static extern void SetWindowMouseGrab(SDL_Window* window, SDL_bool grabbed); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowKeyboardGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowKeyboardGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseGrab", ExactSpelling = true)] - public static extern SDL_bool GetWindowMouseGrab(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGrabbedWindow", ExactSpelling = true)] - public static extern SDL_Window* GetGrabbedWindow(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowMouseRect", ExactSpelling = true)] - public static extern int SetWindowMouseRect(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowMouseRect", ExactSpelling = true)] - [return: NativeTypeName("const SDL_Rect *")] - public static extern SDL_Rect* GetWindowMouseRect(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowBrightness", ExactSpelling = true)] - public static extern int SetWindowBrightness(SDL_Window* window, float brightness); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowBrightness", ExactSpelling = true)] - public static extern float GetWindowBrightness(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)] - public static extern int SetWindowOpacity(SDL_Window* window, float opacity); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowOpacity", ExactSpelling = true)] - public static extern int GetWindowOpacity(SDL_Window* window, float* out_opacity); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowModalFor", ExactSpelling = true)] - public static extern int SetWindowModalFor(SDL_Window* modal_window, SDL_Window* parent_window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowInputFocus", ExactSpelling = true)] - public static extern int SetWindowInputFocus(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowGammaRamp", ExactSpelling = true)] - public static extern int SetWindowGammaRamp(SDL_Window* window, [NativeTypeName("const Uint16 *")] ushort* red, [NativeTypeName("const Uint16 *")] ushort* green, [NativeTypeName("const Uint16 *")] ushort* blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowGammaRamp", ExactSpelling = true)] - public static extern int GetWindowGammaRamp(SDL_Window* window, [NativeTypeName("Uint16 *")] ushort* red, [NativeTypeName("Uint16 *")] ushort* green, [NativeTypeName("Uint16 *")] ushort* blue); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowHitTest", ExactSpelling = true)] - public static extern int SetWindowHitTest(SDL_Window* window, [NativeTypeName("SDL_HitTest")] delegate* unmanaged[Cdecl] callback, void* callback_data); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_FlashWindow", ExactSpelling = true)] - public static extern int FlashWindow(SDL_Window* window, SDL_FlashOperation operation); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DestroyWindow", ExactSpelling = true)] - public static extern void DestroyWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_IsScreenSaverEnabled", ExactSpelling = true)] - public static extern SDL_bool IsScreenSaverEnabled(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_EnableScreenSaver", ExactSpelling = true)] - public static extern void EnableScreenSaver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)] - public static extern void DisableScreenSaver(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_LoadLibrary", ExactSpelling = true)] - public static extern int GL_LoadLibrary([NativeTypeName("const char *")] sbyte* path); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetProcAddress", ExactSpelling = true)] - public static extern void* GL_GetProcAddress([NativeTypeName("const char *")] sbyte* proc); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_UnloadLibrary", ExactSpelling = true)] - public static extern void GL_UnloadLibrary(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ExtensionSupported", ExactSpelling = true)] - public static extern SDL_bool GL_ExtensionSupported([NativeTypeName("const char *")] sbyte* extension); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_ResetAttributes", ExactSpelling = true)] - public static extern void GL_ResetAttributes(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetAttribute", ExactSpelling = true)] - public static extern int GL_SetAttribute(SDL_GLattr attr, int value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetAttribute", ExactSpelling = true)] - public static extern int GL_GetAttribute(SDL_GLattr attr, int* value); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_CreateContext", ExactSpelling = true)] - [return: NativeTypeName("SDL_GLContext")] - public static extern void* GL_CreateContext(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_MakeCurrent", ExactSpelling = true)] - public static extern int GL_MakeCurrent(SDL_Window* window, [NativeTypeName("SDL_GLContext")] void* context); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentWindow", ExactSpelling = true)] - public static extern SDL_Window* GL_GetCurrentWindow(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetCurrentContext", ExactSpelling = true)] - [return: NativeTypeName("SDL_GLContext")] - public static extern void* GL_GetCurrentContext(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetDrawableSize", ExactSpelling = true)] - public static extern void GL_GetDrawableSize(SDL_Window* window, int* w, int* h); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SetSwapInterval", ExactSpelling = true)] - public static extern int GL_SetSwapInterval(int interval); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_GetSwapInterval", ExactSpelling = true)] - public static extern int GL_GetSwapInterval(); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_SwapWindow", ExactSpelling = true)] - public static extern void GL_SwapWindow(SDL_Window* window); - - [DllImport("SDL2", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GL_DeleteContext", ExactSpelling = true)] - public static extern void GL_DeleteContext([NativeTypeName("SDL_GLContext")] void* context); - - [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u")] - public const uint SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000U; - - [NativeTypeName("#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)")] - public const uint SDL_WINDOWPOS_UNDEFINED = (0x1FFF0000U | (0)); - - [NativeTypeName("#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u")] - public const uint SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000U; - - [NativeTypeName("#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)")] - public const uint SDL_WINDOWPOS_CENTERED = (0x2FFF0000U | (0)); - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs deleted file mode 100644 index 2d13efdf..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ArrayOrder.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_ArrayOrder - { - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs deleted file mode 100644 index 6a2b4be4..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioDeviceEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_AudioDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint8")] - public byte iscapture; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs deleted file mode 100644 index c6b63238..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_AudioStatus.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_AudioStatus - { - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs deleted file mode 100644 index ac362fd1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_BitmapOrder.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BitmapOrder - { - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs deleted file mode 100644 index c4a03b8c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendFactor.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendFactor - { - SDL_BLENDFACTOR_ZERO = 0x1, - SDL_BLENDFACTOR_ONE = 0x2, - SDL_BLENDFACTOR_SRC_COLOR = 0x3, - SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, - SDL_BLENDFACTOR_SRC_ALPHA = 0x5, - SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, - SDL_BLENDFACTOR_DST_COLOR = 0x7, - SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, - SDL_BLENDFACTOR_DST_ALPHA = 0x9, - SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs deleted file mode 100644 index aa717040..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendMode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendMode - { - SDL_BLENDMODE_NONE = 0x00000000, - SDL_BLENDMODE_BLEND = 0x00000001, - SDL_BLENDMODE_ADD = 0x00000002, - SDL_BLENDMODE_MOD = 0x00000004, - SDL_BLENDMODE_MUL = 0x00000008, - SDL_BLENDMODE_INVALID = 0x7FFFFFFF, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs deleted file mode 100644 index 557a4d0c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlendOperation.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendOperation - { - SDL_BLENDOPERATION_ADD = 0x1, - SDL_BLENDOPERATION_SUBTRACT = 0x2, - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, - SDL_BLENDOPERATION_MINIMUM = 0x4, - SDL_BLENDOPERATION_MAXIMUM = 0x5, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs deleted file mode 100644 index d5a0249d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_BlitMap.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_BlitMap - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs deleted file mode 100644 index f38be379..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Color.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Color - { - [NativeTypeName("Uint8")] - public byte r; - - [NativeTypeName("Uint8")] - public byte g; - - [NativeTypeName("Uint8")] - public byte b; - - [NativeTypeName("Uint8")] - public byte a; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs deleted file mode 100644 index 318da18f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_CommonEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_CommonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs deleted file mode 100644 index 1fdb2b85..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerAxisEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerAxisEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte axis; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short value; - - [NativeTypeName("Uint16")] - public ushort padding4; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs deleted file mode 100644 index 6a09ba56..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerButtonEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs deleted file mode 100644 index 06b1f09a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerDeviceEvent.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs deleted file mode 100644 index 2dfb1b42..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerSensorEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_ControllerSensorEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Sint32")] - public int sensor; - - [NativeTypeName("float[3]")] - public fixed float data[3]; - - [NativeTypeName("Uint64")] - public ulong timestamp_us; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs deleted file mode 100644 index e86d5147..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ControllerTouchpadEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerTouchpadEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Sint32")] - public int touchpad; - - [NativeTypeName("Sint32")] - public int finger; - - public float x; - - public float y; - - public float pressure; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs deleted file mode 100644 index fd3dac2a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Cursor.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Cursor - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs deleted file mode 100644 index 20c1d52a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DUMMY_ENUM.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DUMMY_ENUM - { - DUMMY_ENUM_VALUE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs deleted file mode 100644 index a7d53cd7..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEvent.cs +++ /dev/null @@ -1,49 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_DisplayEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint display; - - [NativeTypeName("Uint8")] - public byte @event; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint32")] - public int data1; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs deleted file mode 100644 index 070eb26f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayEventID.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DisplayEventID - { - SDL_DISPLAYEVENT_NONE, - SDL_DISPLAYEVENT_ORIENTATION, - SDL_DISPLAYEVENT_CONNECTED, - SDL_DISPLAYEVENT_DISCONNECTED, - SDL_DISPLAYEVENT_MOVED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs deleted file mode 100644 index 0f662cb2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayMode.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_DisplayMode - { - [NativeTypeName("Uint32")] - public uint format; - - public int w; - - public int h; - - public int refresh_rate; - - public void* driverdata; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs deleted file mode 100644 index 5424346b..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DisplayOrientation.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DisplayOrientation - { - SDL_ORIENTATION_UNKNOWN, - SDL_ORIENTATION_LANDSCAPE, - SDL_ORIENTATION_LANDSCAPE_FLIPPED, - SDL_ORIENTATION_PORTRAIT, - SDL_ORIENTATION_PORTRAIT_FLIPPED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs deleted file mode 100644 index 4a9a2155..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DollarGestureEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_DollarGestureEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - [NativeTypeName("SDL_GestureID")] - public long gestureId; - - [NativeTypeName("Uint32")] - public uint numFingers; - - public float error; - - public float x; - - public float y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs deleted file mode 100644 index 67b47f20..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_DropEvent.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_DropEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("char *")] - public sbyte* file; - - [NativeTypeName("Uint32")] - public uint windowID; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs deleted file mode 100644 index 7db609df..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Event.cs +++ /dev/null @@ -1,126 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [StructLayout(LayoutKind.Explicit)] - public unsafe partial struct SDL_Event - { - [FieldOffset(0)] - [NativeTypeName("Uint32")] - public uint type; - - [FieldOffset(0)] - public SDL_CommonEvent common; - - [FieldOffset(0)] - public SDL_DisplayEvent display; - - [FieldOffset(0)] - public SDL_WindowEvent window; - - [FieldOffset(0)] - public SDL_KeyboardEvent key; - - [FieldOffset(0)] - public SDL_TextEditingEvent edit; - - [FieldOffset(0)] - public SDL_TextEditingExtEvent editExt; - - [FieldOffset(0)] - public SDL_TextInputEvent text; - - [FieldOffset(0)] - public SDL_MouseMotionEvent motion; - - [FieldOffset(0)] - public SDL_MouseButtonEvent button; - - [FieldOffset(0)] - public SDL_MouseWheelEvent wheel; - - [FieldOffset(0)] - public SDL_JoyAxisEvent jaxis; - - [FieldOffset(0)] - public SDL_JoyBallEvent jball; - - [FieldOffset(0)] - public SDL_JoyHatEvent jhat; - - [FieldOffset(0)] - public SDL_JoyButtonEvent jbutton; - - [FieldOffset(0)] - public SDL_JoyDeviceEvent jdevice; - - [FieldOffset(0)] - public SDL_JoyBatteryEvent jbattery; - - [FieldOffset(0)] - public SDL_ControllerAxisEvent caxis; - - [FieldOffset(0)] - public SDL_ControllerButtonEvent cbutton; - - [FieldOffset(0)] - public SDL_ControllerDeviceEvent cdevice; - - [FieldOffset(0)] - public SDL_ControllerTouchpadEvent ctouchpad; - - [FieldOffset(0)] - public SDL_ControllerSensorEvent csensor; - - [FieldOffset(0)] - public SDL_AudioDeviceEvent adevice; - - [FieldOffset(0)] - public SDL_SensorEvent sensor; - - [FieldOffset(0)] - public SDL_QuitEvent quit; - - [FieldOffset(0)] - public SDL_UserEvent user; - - [FieldOffset(0)] - public SDL_SysWMEvent syswm; - - [FieldOffset(0)] - public SDL_TouchFingerEvent tfinger; - - [FieldOffset(0)] - public SDL_MultiGestureEvent mgesture; - - [FieldOffset(0)] - public SDL_DollarGestureEvent dgesture; - - [FieldOffset(0)] - public SDL_DropEvent drop; - - [FieldOffset(0)] - [NativeTypeName("Uint8[56]")] - public fixed byte padding[56]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs deleted file mode 100644 index 422627c3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_EventType.cs +++ /dev/null @@ -1,86 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_EventType : uint - { - SDL_FIRSTEVENT = 0, - SDL_QUIT = 0x100, - SDL_APP_TERMINATING, - SDL_APP_LOWMEMORY, - SDL_APP_WILLENTERBACKGROUND, - SDL_APP_DIDENTERBACKGROUND, - SDL_APP_WILLENTERFOREGROUND, - SDL_APP_DIDENTERFOREGROUND, - SDL_LOCALECHANGED, - SDL_DISPLAYEVENT = 0x150, - SDL_WINDOWEVENT = 0x200, - SDL_SYSWMEVENT, - SDL_KEYDOWN = 0x300, - SDL_KEYUP, - SDL_TEXTEDITING, - SDL_TEXTINPUT, - SDL_KEYMAPCHANGED, - SDL_TEXTEDITING_EXT, - SDL_MOUSEMOTION = 0x400, - SDL_MOUSEBUTTONDOWN, - SDL_MOUSEBUTTONUP, - SDL_MOUSEWHEEL, - SDL_JOYAXISMOTION = 0x600, - SDL_JOYBALLMOTION, - SDL_JOYHATMOTION, - SDL_JOYBUTTONDOWN, - SDL_JOYBUTTONUP, - SDL_JOYDEVICEADDED, - SDL_JOYDEVICEREMOVED, - SDL_JOYBATTERYUPDATED, - SDL_CONTROLLERAXISMOTION = 0x650, - SDL_CONTROLLERBUTTONDOWN, - SDL_CONTROLLERBUTTONUP, - SDL_CONTROLLERDEVICEADDED, - SDL_CONTROLLERDEVICEREMOVED, - SDL_CONTROLLERDEVICEREMAPPED, - SDL_CONTROLLERTOUCHPADDOWN, - SDL_CONTROLLERTOUCHPADMOTION, - SDL_CONTROLLERTOUCHPADUP, - SDL_CONTROLLERSENSORUPDATE, - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - SDL_CLIPBOARDUPDATE = 0x900, - SDL_DROPFILE = 0x1000, - SDL_DROPTEXT, - SDL_DROPBEGIN, - SDL_DROPCOMPLETE, - SDL_AUDIODEVICEADDED = 0x1100, - SDL_AUDIODEVICEREMOVED, - SDL_SENSORUPDATE = 0x1200, - SDL_RENDER_TARGETS_RESET = 0x2000, - SDL_RENDER_DEVICE_RESET, - SDL_POLLSENTINEL = 0x7F00, - SDL_USEREVENT = 0x8000, - SDL_LASTEVENT = 0xFFFF, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs deleted file mode 100644 index 49f5b786..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_FPoint.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_FPoint - { - public float x; - - public float y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs deleted file mode 100644 index 4761637e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_FRect.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_FRect - { - public float x; - - public float y; - - public float w; - - public float h; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs deleted file mode 100644 index d019c1ce..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_FlashOperation.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_FlashOperation - { - SDL_FLASH_CANCEL, - SDL_FLASH_BRIEFLY, - SDL_FLASH_UNTIL_FOCUSED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs deleted file mode 100644 index 513410ec..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLContextResetNotification.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLContextResetNotification - { - SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, - SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs deleted file mode 100644 index 99c7f3e9..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLattr.cs +++ /dev/null @@ -1,54 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLattr - { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, - SDL_GL_CONTEXT_NO_ERROR, - SDL_GL_FLOATBUFFERS, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs deleted file mode 100644 index c3ca834f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextFlag.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLcontextFlag - { - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs deleted file mode 100644 index eb309fc6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLcontextReleaseFlag.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLcontextReleaseFlag - { - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs deleted file mode 100644 index cf5f8a36..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GLprofile.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLprofile - { - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs deleted file mode 100644 index fb41ca1e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_GUID.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_GUID - { - [NativeTypeName("Uint8[16]")] - public fixed byte data[16]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs deleted file mode 100644 index 55338d44..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_HintPriority.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_HintPriority - { - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs deleted file mode 100644 index 876a0aee..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_HitTestResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_HitTestResult - { - SDL_HITTEST_NORMAL, - SDL_HITTEST_DRAGGABLE, - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs deleted file mode 100644 index c6576305..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyAxisEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyAxisEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte axis; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short value; - - [NativeTypeName("Uint16")] - public ushort padding4; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs deleted file mode 100644 index 88536464..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBallEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyBallEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte ball; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short xrel; - - [NativeTypeName("Sint16")] - public short yrel; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs deleted file mode 100644 index f8b2098c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyBatteryEvent.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyBatteryEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - public SDL_JoystickPowerLevel level; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs deleted file mode 100644 index 3ae12b30..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyButtonEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs deleted file mode 100644 index 0cd02b89..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyDeviceEvent.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs deleted file mode 100644 index 6aa8815e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoyHatEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyHatEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte hat; - - [NativeTypeName("Uint8")] - public byte value; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs deleted file mode 100644 index 17e0de3c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickPowerLevel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_JoystickPowerLevel - { - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, - SDL_JOYSTICK_POWER_LOW, - SDL_JOYSTICK_POWER_MEDIUM, - SDL_JOYSTICK_POWER_FULL, - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs deleted file mode 100644 index e1302bcb..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_JoystickType.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_JoystickType - { - SDL_JOYSTICK_TYPE_UNKNOWN, - SDL_JOYSTICK_TYPE_GAMECONTROLLER, - SDL_JOYSTICK_TYPE_WHEEL, - SDL_JOYSTICK_TYPE_ARCADE_STICK, - SDL_JOYSTICK_TYPE_FLIGHT_STICK, - SDL_JOYSTICK_TYPE_DANCE_PAD, - SDL_JOYSTICK_TYPE_GUITAR, - SDL_JOYSTICK_TYPE_DRUM_KIT, - SDL_JOYSTICK_TYPE_ARCADE_PAD, - SDL_JOYSTICK_TYPE_THROTTLE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs deleted file mode 100644 index 3d04b9d6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyCode.cs +++ /dev/null @@ -1,272 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using static SDL2Sharp.Interop.SDL_Scancode; - -namespace SDL2Sharp.Interop -{ - public enum SDL_KeyCode - { - SDLK_UNKNOWN = 0, - SDLK_RETURN = '\r', - SDLK_ESCAPE = '', - SDLK_BACKSPACE = '', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - SDLK_CAPSLOCK = (SDL_SCANCODE_CAPSLOCK | (1 << 30)), - SDLK_F1 = (SDL_SCANCODE_F1 | (1 << 30)), - SDLK_F2 = (SDL_SCANCODE_F2 | (1 << 30)), - SDLK_F3 = (SDL_SCANCODE_F3 | (1 << 30)), - SDLK_F4 = (SDL_SCANCODE_F4 | (1 << 30)), - SDLK_F5 = (SDL_SCANCODE_F5 | (1 << 30)), - SDLK_F6 = (SDL_SCANCODE_F6 | (1 << 30)), - SDLK_F7 = (SDL_SCANCODE_F7 | (1 << 30)), - SDLK_F8 = (SDL_SCANCODE_F8 | (1 << 30)), - SDLK_F9 = (SDL_SCANCODE_F9 | (1 << 30)), - SDLK_F10 = (SDL_SCANCODE_F10 | (1 << 30)), - SDLK_F11 = (SDL_SCANCODE_F11 | (1 << 30)), - SDLK_F12 = (SDL_SCANCODE_F12 | (1 << 30)), - SDLK_PRINTSCREEN = (SDL_SCANCODE_PRINTSCREEN | (1 << 30)), - SDLK_SCROLLLOCK = (SDL_SCANCODE_SCROLLLOCK | (1 << 30)), - SDLK_PAUSE = (SDL_SCANCODE_PAUSE | (1 << 30)), - SDLK_INSERT = (SDL_SCANCODE_INSERT | (1 << 30)), - SDLK_HOME = (SDL_SCANCODE_HOME | (1 << 30)), - SDLK_PAGEUP = (SDL_SCANCODE_PAGEUP | (1 << 30)), - SDLK_DELETE = '', - SDLK_END = (SDL_SCANCODE_END | (1 << 30)), - SDLK_PAGEDOWN = (SDL_SCANCODE_PAGEDOWN | (1 << 30)), - SDLK_RIGHT = (SDL_SCANCODE_RIGHT | (1 << 30)), - SDLK_LEFT = (SDL_SCANCODE_LEFT | (1 << 30)), - SDLK_DOWN = (SDL_SCANCODE_DOWN | (1 << 30)), - SDLK_UP = (SDL_SCANCODE_UP | (1 << 30)), - SDLK_NUMLOCKCLEAR = (SDL_SCANCODE_NUMLOCKCLEAR | (1 << 30)), - SDLK_KP_DIVIDE = (SDL_SCANCODE_KP_DIVIDE | (1 << 30)), - SDLK_KP_MULTIPLY = (SDL_SCANCODE_KP_MULTIPLY | (1 << 30)), - SDLK_KP_MINUS = (SDL_SCANCODE_KP_MINUS | (1 << 30)), - SDLK_KP_PLUS = (SDL_SCANCODE_KP_PLUS | (1 << 30)), - SDLK_KP_ENTER = (SDL_SCANCODE_KP_ENTER | (1 << 30)), - SDLK_KP_1 = (SDL_SCANCODE_KP_1 | (1 << 30)), - SDLK_KP_2 = (SDL_SCANCODE_KP_2 | (1 << 30)), - SDLK_KP_3 = (SDL_SCANCODE_KP_3 | (1 << 30)), - SDLK_KP_4 = (SDL_SCANCODE_KP_4 | (1 << 30)), - SDLK_KP_5 = (SDL_SCANCODE_KP_5 | (1 << 30)), - SDLK_KP_6 = (SDL_SCANCODE_KP_6 | (1 << 30)), - SDLK_KP_7 = (SDL_SCANCODE_KP_7 | (1 << 30)), - SDLK_KP_8 = (SDL_SCANCODE_KP_8 | (1 << 30)), - SDLK_KP_9 = (SDL_SCANCODE_KP_9 | (1 << 30)), - SDLK_KP_0 = (SDL_SCANCODE_KP_0 | (1 << 30)), - SDLK_KP_PERIOD = (SDL_SCANCODE_KP_PERIOD | (1 << 30)), - SDLK_APPLICATION = (SDL_SCANCODE_APPLICATION | (1 << 30)), - SDLK_POWER = (SDL_SCANCODE_POWER | (1 << 30)), - SDLK_KP_EQUALS = (SDL_SCANCODE_KP_EQUALS | (1 << 30)), - SDLK_F13 = (SDL_SCANCODE_F13 | (1 << 30)), - SDLK_F14 = (SDL_SCANCODE_F14 | (1 << 30)), - SDLK_F15 = (SDL_SCANCODE_F15 | (1 << 30)), - SDLK_F16 = (SDL_SCANCODE_F16 | (1 << 30)), - SDLK_F17 = (SDL_SCANCODE_F17 | (1 << 30)), - SDLK_F18 = (SDL_SCANCODE_F18 | (1 << 30)), - SDLK_F19 = (SDL_SCANCODE_F19 | (1 << 30)), - SDLK_F20 = (SDL_SCANCODE_F20 | (1 << 30)), - SDLK_F21 = (SDL_SCANCODE_F21 | (1 << 30)), - SDLK_F22 = (SDL_SCANCODE_F22 | (1 << 30)), - SDLK_F23 = (SDL_SCANCODE_F23 | (1 << 30)), - SDLK_F24 = (SDL_SCANCODE_F24 | (1 << 30)), - SDLK_EXECUTE = (SDL_SCANCODE_EXECUTE | (1 << 30)), - SDLK_HELP = (SDL_SCANCODE_HELP | (1 << 30)), - SDLK_MENU = (SDL_SCANCODE_MENU | (1 << 30)), - SDLK_SELECT = (SDL_SCANCODE_SELECT | (1 << 30)), - SDLK_STOP = (SDL_SCANCODE_STOP | (1 << 30)), - SDLK_AGAIN = (SDL_SCANCODE_AGAIN | (1 << 30)), - SDLK_UNDO = (SDL_SCANCODE_UNDO | (1 << 30)), - SDLK_CUT = (SDL_SCANCODE_CUT | (1 << 30)), - SDLK_COPY = (SDL_SCANCODE_COPY | (1 << 30)), - SDLK_PASTE = (SDL_SCANCODE_PASTE | (1 << 30)), - SDLK_FIND = (SDL_SCANCODE_FIND | (1 << 30)), - SDLK_MUTE = (SDL_SCANCODE_MUTE | (1 << 30)), - SDLK_VOLUMEUP = (SDL_SCANCODE_VOLUMEUP | (1 << 30)), - SDLK_VOLUMEDOWN = (SDL_SCANCODE_VOLUMEDOWN | (1 << 30)), - SDLK_KP_COMMA = (SDL_SCANCODE_KP_COMMA | (1 << 30)), - SDLK_KP_EQUALSAS400 = (SDL_SCANCODE_KP_EQUALSAS400 | (1 << 30)), - SDLK_ALTERASE = (SDL_SCANCODE_ALTERASE | (1 << 30)), - SDLK_SYSREQ = (SDL_SCANCODE_SYSREQ | (1 << 30)), - SDLK_CANCEL = (SDL_SCANCODE_CANCEL | (1 << 30)), - SDLK_CLEAR = (SDL_SCANCODE_CLEAR | (1 << 30)), - SDLK_PRIOR = (SDL_SCANCODE_PRIOR | (1 << 30)), - SDLK_RETURN2 = (SDL_SCANCODE_RETURN2 | (1 << 30)), - SDLK_SEPARATOR = (SDL_SCANCODE_SEPARATOR | (1 << 30)), - SDLK_OUT = (SDL_SCANCODE_OUT | (1 << 30)), - SDLK_OPER = (SDL_SCANCODE_OPER | (1 << 30)), - SDLK_CLEARAGAIN = (SDL_SCANCODE_CLEARAGAIN | (1 << 30)), - SDLK_CRSEL = (SDL_SCANCODE_CRSEL | (1 << 30)), - SDLK_EXSEL = (SDL_SCANCODE_EXSEL | (1 << 30)), - SDLK_KP_00 = (SDL_SCANCODE_KP_00 | (1 << 30)), - SDLK_KP_000 = (SDL_SCANCODE_KP_000 | (1 << 30)), - SDLK_THOUSANDSSEPARATOR = (SDL_SCANCODE_THOUSANDSSEPARATOR | (1 << 30)), - SDLK_DECIMALSEPARATOR = (SDL_SCANCODE_DECIMALSEPARATOR | (1 << 30)), - SDLK_CURRENCYUNIT = (SDL_SCANCODE_CURRENCYUNIT | (1 << 30)), - SDLK_CURRENCYSUBUNIT = (SDL_SCANCODE_CURRENCYSUBUNIT | (1 << 30)), - SDLK_KP_LEFTPAREN = (SDL_SCANCODE_KP_LEFTPAREN | (1 << 30)), - SDLK_KP_RIGHTPAREN = (SDL_SCANCODE_KP_RIGHTPAREN | (1 << 30)), - SDLK_KP_LEFTBRACE = (SDL_SCANCODE_KP_LEFTBRACE | (1 << 30)), - SDLK_KP_RIGHTBRACE = (SDL_SCANCODE_KP_RIGHTBRACE | (1 << 30)), - SDLK_KP_TAB = (SDL_SCANCODE_KP_TAB | (1 << 30)), - SDLK_KP_BACKSPACE = (SDL_SCANCODE_KP_BACKSPACE | (1 << 30)), - SDLK_KP_A = (SDL_SCANCODE_KP_A | (1 << 30)), - SDLK_KP_B = (SDL_SCANCODE_KP_B | (1 << 30)), - SDLK_KP_C = (SDL_SCANCODE_KP_C | (1 << 30)), - SDLK_KP_D = (SDL_SCANCODE_KP_D | (1 << 30)), - SDLK_KP_E = (SDL_SCANCODE_KP_E | (1 << 30)), - SDLK_KP_F = (SDL_SCANCODE_KP_F | (1 << 30)), - SDLK_KP_XOR = (SDL_SCANCODE_KP_XOR | (1 << 30)), - SDLK_KP_POWER = (SDL_SCANCODE_KP_POWER | (1 << 30)), - SDLK_KP_PERCENT = (SDL_SCANCODE_KP_PERCENT | (1 << 30)), - SDLK_KP_LESS = (SDL_SCANCODE_KP_LESS | (1 << 30)), - SDLK_KP_GREATER = (SDL_SCANCODE_KP_GREATER | (1 << 30)), - SDLK_KP_AMPERSAND = (SDL_SCANCODE_KP_AMPERSAND | (1 << 30)), - SDLK_KP_DBLAMPERSAND = (SDL_SCANCODE_KP_DBLAMPERSAND | (1 << 30)), - SDLK_KP_VERTICALBAR = (SDL_SCANCODE_KP_VERTICALBAR | (1 << 30)), - SDLK_KP_DBLVERTICALBAR = (SDL_SCANCODE_KP_DBLVERTICALBAR | (1 << 30)), - SDLK_KP_COLON = (SDL_SCANCODE_KP_COLON | (1 << 30)), - SDLK_KP_HASH = (SDL_SCANCODE_KP_HASH | (1 << 30)), - SDLK_KP_SPACE = (SDL_SCANCODE_KP_SPACE | (1 << 30)), - SDLK_KP_AT = (SDL_SCANCODE_KP_AT | (1 << 30)), - SDLK_KP_EXCLAM = (SDL_SCANCODE_KP_EXCLAM | (1 << 30)), - SDLK_KP_MEMSTORE = (SDL_SCANCODE_KP_MEMSTORE | (1 << 30)), - SDLK_KP_MEMRECALL = (SDL_SCANCODE_KP_MEMRECALL | (1 << 30)), - SDLK_KP_MEMCLEAR = (SDL_SCANCODE_KP_MEMCLEAR | (1 << 30)), - SDLK_KP_MEMADD = (SDL_SCANCODE_KP_MEMADD | (1 << 30)), - SDLK_KP_MEMSUBTRACT = (SDL_SCANCODE_KP_MEMSUBTRACT | (1 << 30)), - SDLK_KP_MEMMULTIPLY = (SDL_SCANCODE_KP_MEMMULTIPLY | (1 << 30)), - SDLK_KP_MEMDIVIDE = (SDL_SCANCODE_KP_MEMDIVIDE | (1 << 30)), - SDLK_KP_PLUSMINUS = (SDL_SCANCODE_KP_PLUSMINUS | (1 << 30)), - SDLK_KP_CLEAR = (SDL_SCANCODE_KP_CLEAR | (1 << 30)), - SDLK_KP_CLEARENTRY = (SDL_SCANCODE_KP_CLEARENTRY | (1 << 30)), - SDLK_KP_BINARY = (SDL_SCANCODE_KP_BINARY | (1 << 30)), - SDLK_KP_OCTAL = (SDL_SCANCODE_KP_OCTAL | (1 << 30)), - SDLK_KP_DECIMAL = (SDL_SCANCODE_KP_DECIMAL | (1 << 30)), - SDLK_KP_HEXADECIMAL = (SDL_SCANCODE_KP_HEXADECIMAL | (1 << 30)), - SDLK_LCTRL = (SDL_SCANCODE_LCTRL | (1 << 30)), - SDLK_LSHIFT = (SDL_SCANCODE_LSHIFT | (1 << 30)), - SDLK_LALT = (SDL_SCANCODE_LALT | (1 << 30)), - SDLK_LGUI = (SDL_SCANCODE_LGUI | (1 << 30)), - SDLK_RCTRL = (SDL_SCANCODE_RCTRL | (1 << 30)), - SDLK_RSHIFT = (SDL_SCANCODE_RSHIFT | (1 << 30)), - SDLK_RALT = (SDL_SCANCODE_RALT | (1 << 30)), - SDLK_RGUI = (SDL_SCANCODE_RGUI | (1 << 30)), - SDLK_MODE = (SDL_SCANCODE_MODE | (1 << 30)), - SDLK_AUDIONEXT = (SDL_SCANCODE_AUDIONEXT | (1 << 30)), - SDLK_AUDIOPREV = (SDL_SCANCODE_AUDIOPREV | (1 << 30)), - SDLK_AUDIOSTOP = (SDL_SCANCODE_AUDIOSTOP | (1 << 30)), - SDLK_AUDIOPLAY = (SDL_SCANCODE_AUDIOPLAY | (1 << 30)), - SDLK_AUDIOMUTE = (SDL_SCANCODE_AUDIOMUTE | (1 << 30)), - SDLK_MEDIASELECT = (SDL_SCANCODE_MEDIASELECT | (1 << 30)), - SDLK_WWW = (SDL_SCANCODE_WWW | (1 << 30)), - SDLK_MAIL = (SDL_SCANCODE_MAIL | (1 << 30)), - SDLK_CALCULATOR = (SDL_SCANCODE_CALCULATOR | (1 << 30)), - SDLK_COMPUTER = (SDL_SCANCODE_COMPUTER | (1 << 30)), - SDLK_AC_SEARCH = (SDL_SCANCODE_AC_SEARCH | (1 << 30)), - SDLK_AC_HOME = (SDL_SCANCODE_AC_HOME | (1 << 30)), - SDLK_AC_BACK = (SDL_SCANCODE_AC_BACK | (1 << 30)), - SDLK_AC_FORWARD = (SDL_SCANCODE_AC_FORWARD | (1 << 30)), - SDLK_AC_STOP = (SDL_SCANCODE_AC_STOP | (1 << 30)), - SDLK_AC_REFRESH = (SDL_SCANCODE_AC_REFRESH | (1 << 30)), - SDLK_AC_BOOKMARKS = (SDL_SCANCODE_AC_BOOKMARKS | (1 << 30)), - SDLK_BRIGHTNESSDOWN = (SDL_SCANCODE_BRIGHTNESSDOWN | (1 << 30)), - SDLK_BRIGHTNESSUP = (SDL_SCANCODE_BRIGHTNESSUP | (1 << 30)), - SDLK_DISPLAYSWITCH = (SDL_SCANCODE_DISPLAYSWITCH | (1 << 30)), - SDLK_KBDILLUMTOGGLE = (SDL_SCANCODE_KBDILLUMTOGGLE | (1 << 30)), - SDLK_KBDILLUMDOWN = (SDL_SCANCODE_KBDILLUMDOWN | (1 << 30)), - SDLK_KBDILLUMUP = (SDL_SCANCODE_KBDILLUMUP | (1 << 30)), - SDLK_EJECT = (SDL_SCANCODE_EJECT | (1 << 30)), - SDLK_SLEEP = (SDL_SCANCODE_SLEEP | (1 << 30)), - SDLK_APP1 = (SDL_SCANCODE_APP1 | (1 << 30)), - SDLK_APP2 = (SDL_SCANCODE_APP2 | (1 << 30)), - SDLK_AUDIOREWIND = (SDL_SCANCODE_AUDIOREWIND | (1 << 30)), - SDLK_AUDIOFASTFORWARD = (SDL_SCANCODE_AUDIOFASTFORWARD | (1 << 30)), - SDLK_SOFTLEFT = (SDL_SCANCODE_SOFTLEFT | (1 << 30)), - SDLK_SOFTRIGHT = (SDL_SCANCODE_SOFTRIGHT | (1 << 30)), - SDLK_CALL = (SDL_SCANCODE_CALL | (1 << 30)), - SDLK_ENDCALL = (SDL_SCANCODE_ENDCALL | (1 << 30)), - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs deleted file mode 100644 index 6ec8a2e3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_KeyboardEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_KeyboardEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte repeat; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - public SDL_Keysym keysym; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs deleted file mode 100644 index 2acca89e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keymod.cs +++ /dev/null @@ -1,44 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_Keymod - { - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_SCROLL = 0x8000, - KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, - KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, - KMOD_ALT = KMOD_LALT | KMOD_RALT, - KMOD_GUI = KMOD_LGUI | KMOD_RGUI, - KMOD_RESERVED = KMOD_SCROLL, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs deleted file mode 100644 index d23836a8..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Keysym.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Keysym - { - public SDL_Scancode scancode; - - [NativeTypeName("SDL_Keycode")] - public int sym; - - [NativeTypeName("Uint16")] - public ushort mod; - - [NativeTypeName("Uint32")] - public uint unused; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs deleted file mode 100644 index 11d2c76a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogCategory.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_LogCategory - { - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - SDL_LOG_CATEGORY_CUSTOM, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs deleted file mode 100644 index 6c754af1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_LogPriority.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_LogPriority - { - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs deleted file mode 100644 index 61c1b959..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseButtonEvent.cs +++ /dev/null @@ -1,55 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte clicks; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs deleted file mode 100644 index df78952e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseMotionEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseMotionEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint32")] - public uint state; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - - [NativeTypeName("Sint32")] - public int xrel; - - [NativeTypeName("Sint32")] - public int yrel; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs deleted file mode 100644 index 2bf9e69d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelDirection.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_MouseWheelDirection - { - SDL_MOUSEWHEEL_NORMAL, - SDL_MOUSEWHEEL_FLIPPED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs deleted file mode 100644 index eebc6fe2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_MouseWheelEvent.cs +++ /dev/null @@ -1,56 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseWheelEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - - [NativeTypeName("Uint32")] - public uint direction; - - public float preciseX; - - public float preciseY; - - [NativeTypeName("Sint32")] - public int mouseX; - - [NativeTypeName("Sint32")] - public int mouseY; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs deleted file mode 100644 index 6048be59..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_MultiGestureEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MultiGestureEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - public float dTheta; - - public float dDist; - - public float x; - - public float y; - - [NativeTypeName("Uint16")] - public ushort numFingers; - - [NativeTypeName("Uint16")] - public ushort padding; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs deleted file mode 100644 index 00176cd6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_OSEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_OSEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs deleted file mode 100644 index 9e38cab3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedLayout.cs +++ /dev/null @@ -1,35 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PackedLayout - { - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs deleted file mode 100644 index abfa0753..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_PackedOrder.cs +++ /dev/null @@ -1,35 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PackedOrder - { - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs deleted file mode 100644 index 59b59cbc..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Palette.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_Palette - { - public int ncolors; - - public SDL_Color* colors; - - [NativeTypeName("Uint32")] - public uint version; - - public int refcount; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs deleted file mode 100644 index fa3c1100..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormat.cs +++ /dev/null @@ -1,80 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_PixelFormat - { - [NativeTypeName("Uint32")] - public uint format; - - public SDL_Palette* palette; - - [NativeTypeName("Uint8")] - public byte BitsPerPixel; - - [NativeTypeName("Uint8")] - public byte BytesPerPixel; - - [NativeTypeName("Uint8[2]")] - public fixed byte padding[2]; - - [NativeTypeName("Uint32")] - public uint Rmask; - - [NativeTypeName("Uint32")] - public uint Gmask; - - [NativeTypeName("Uint32")] - public uint Bmask; - - [NativeTypeName("Uint32")] - public uint Amask; - - [NativeTypeName("Uint8")] - public byte Rloss; - - [NativeTypeName("Uint8")] - public byte Gloss; - - [NativeTypeName("Uint8")] - public byte Bloss; - - [NativeTypeName("Uint8")] - public byte Aloss; - - [NativeTypeName("Uint8")] - public byte Rshift; - - [NativeTypeName("Uint8")] - public byte Gshift; - - [NativeTypeName("Uint8")] - public byte Bshift; - - [NativeTypeName("Uint8")] - public byte Ashift; - - public int refcount; - - [NativeTypeName("struct SDL_PixelFormat *")] - public SDL_PixelFormat* next; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs deleted file mode 100644 index 03f347b5..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelFormatEnum.cs +++ /dev/null @@ -1,83 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using static SDL2Sharp.Interop.SDL_ArrayOrder; -using static SDL2Sharp.Interop.SDL_BitmapOrder; -using static SDL2Sharp.Interop.SDL_PackedLayout; -using static SDL2Sharp.Interop.SDL_PackedOrder; -using static SDL2Sharp.Interop.SDL_PixelType; - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_PixelFormatEnum : uint - { - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX1MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX4LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX4MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), - 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)), - SDL_PIXELFORMAT_BGRA4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_ARGB1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGBA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_ABGR1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_BGRA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGB565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_BGR565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGB24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_RGB) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), - SDL_PIXELFORMAT_BGR24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_BGR) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), - SDL_PIXELFORMAT_XRGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_RGBX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_XBGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_BGRX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ARGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGBA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ABGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_BGRA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ARGB2101010 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_2101010) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_YV12 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_IYUV = (unchecked(((uint)((byte)('I')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('U')) << 16) | ((uint)((byte)('V')) << 24))), - SDL_PIXELFORMAT_YUY2 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('U')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_UYVY = (unchecked(((uint)((byte)('U')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('V')) << 16) | ((uint)((byte)('Y')) << 24))), - SDL_PIXELFORMAT_YVYU = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('U')) << 24))), - SDL_PIXELFORMAT_NV12 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_NV21 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('2')) << 16) | ((uint)((byte)('1')) << 24))), - SDL_PIXELFORMAT_EXTERNAL_OES = (unchecked(((uint)((byte)('O')) << 0) | ((uint)((byte)('E')) << 8) | ((uint)((byte)('S')) << 16) | ((uint)((byte)(' ')) << 24))), - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs deleted file mode 100644 index 9c1afa75..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_PixelType.cs +++ /dev/null @@ -1,38 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PixelType - { - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs deleted file mode 100644 index 694e3da0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Point.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Point - { - public int x; - - public int y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs deleted file mode 100644 index fe0f5025..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_QuitEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_QuitEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs deleted file mode 100644 index d54b0ea0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Rect.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Rect - { - public int x; - - public int y; - - public int w; - - public int h; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs deleted file mode 100644 index f7b963ca..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Renderer.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Renderer - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs deleted file mode 100644 index 71b6202d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlags.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_RendererFlags : uint - { - SDL_RENDERER_SOFTWARE = 0x00000001, - SDL_RENDERER_ACCELERATED = 0x00000002, - SDL_RENDERER_PRESENTVSYNC = 0x00000004, - SDL_RENDERER_TARGETTEXTURE = 0x00000008, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs deleted file mode 100644 index ca274bac..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererFlip.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_RendererFlip - { - SDL_FLIP_NONE = 0x00000000, - SDL_FLIP_HORIZONTAL = 0x00000001, - SDL_FLIP_VERTICAL = 0x00000002, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs deleted file mode 100644 index c21a4ba1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_RendererInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_RendererInfo - { - [NativeTypeName("const char *")] - public sbyte* name; - - [NativeTypeName("Uint32")] - public uint flags; - - [NativeTypeName("Uint32")] - public uint num_texture_formats; - - [NativeTypeName("Uint32[16]")] - public fixed uint texture_formats[16]; - - public int max_texture_width; - - public int max_texture_height; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs deleted file mode 100644 index 5f5313e0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_ScaleMode.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_ScaleMode - { - SDL_ScaleModeNearest, - SDL_ScaleModeLinear, - SDL_ScaleModeBest, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs deleted file mode 100644 index e2e09b33..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Scancode.cs +++ /dev/null @@ -1,274 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_Scancode - { - SDL_SCANCODE_UNKNOWN = 0, - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, - SDL_SCANCODE_NONUSHASH = 50, - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - SDL_SCANCODE_CAPSLOCK = 57, - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - SDL_SCANCODE_NUMLOCKCLEAR = 83, - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - SDL_SCANCODE_NONUSBACKSLASH = 100, - SDL_SCANCODE_APPLICATION = 101, - SDL_SCANCODE_POWER = 102, - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, - SDL_SCANCODE_MENU = 118, - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, - SDL_SCANCODE_UNDO = 122, - SDL_SCANCODE_CUT = 123, - SDL_SCANCODE_COPY = 124, - SDL_SCANCODE_PASTE = 125, - SDL_SCANCODE_FIND = 126, - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - SDL_SCANCODE_INTERNATIONAL1 = 135, - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, - SDL_SCANCODE_LANG2 = 145, - SDL_SCANCODE_LANG3 = 146, - SDL_SCANCODE_LANG4 = 147, - SDL_SCANCODE_LANG5 = 148, - SDL_SCANCODE_LANG6 = 149, - SDL_SCANCODE_LANG7 = 150, - SDL_SCANCODE_LANG8 = 151, - SDL_SCANCODE_LANG9 = 152, - SDL_SCANCODE_ALTERASE = 153, - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, - SDL_SCANCODE_LGUI = 227, - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - 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_SOFTLEFT = 287, - SDL_SCANCODE_SOFTRIGHT = 288, - SDL_SCANCODE_CALL = 289, - SDL_SCANCODE_ENDCALL = 290, - SDL_NUM_SCANCODES = 512, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs deleted file mode 100644 index ce329d9f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_SensorEvent.cs +++ /dev/null @@ -1,40 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_SensorEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - - [NativeTypeName("float[6]")] - public fixed float data[6]; - - [NativeTypeName("Uint64")] - public ulong timestamp_us; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs deleted file mode 100644 index af9d6e71..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Surface.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_Surface - { - [NativeTypeName("Uint32")] - public uint flags; - - public SDL_PixelFormat* format; - - public int w; - - public int h; - - public int pitch; - - public void* pixels; - - public void* userdata; - - public int locked; - - public void* list_blitmap; - - public SDL_Rect clip_rect; - - public SDL_BlitMap* map; - - public int refcount; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs deleted file mode 100644 index 1141d0ec..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMEvent.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_SysWMEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - public SDL_SysWMmsg* msg; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs deleted file mode 100644 index 0da87cae..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_SysWMmsg.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_SysWMmsg - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs deleted file mode 100644 index 3578e6d2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_SystemCursor.cs +++ /dev/null @@ -1,39 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_SystemCursor - { - SDL_SYSTEM_CURSOR_ARROW, - SDL_SYSTEM_CURSOR_IBEAM, - 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_NUM_SYSTEM_CURSORS, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs deleted file mode 100644 index 40f05865..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextEditingEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char[32]")] - public fixed sbyte text[32]; - - [NativeTypeName("Sint32")] - public int start; - - [NativeTypeName("Sint32")] - public int length; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs deleted file mode 100644 index 13afc1f3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextEditingExtEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextEditingExtEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char *")] - public sbyte* text; - - [NativeTypeName("Sint32")] - public int start; - - [NativeTypeName("Sint32")] - public int length; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs deleted file mode 100644 index 285e9416..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextInputEvent.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextInputEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char[32]")] - public fixed sbyte text[32]; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs deleted file mode 100644 index 4f76e639..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Texture.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Texture - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs deleted file mode 100644 index adadc839..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureAccess.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_TextureAccess - { - SDL_TEXTUREACCESS_STATIC, - SDL_TEXTUREACCESS_STREAMING, - SDL_TEXTUREACCESS_TARGET, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs deleted file mode 100644 index 7a092826..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TextureModulate.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_TextureModulate - { - SDL_TEXTUREMODULATE_NONE = 0x00000000, - SDL_TEXTUREMODULATE_COLOR = 0x00000001, - SDL_TEXTUREMODULATE_ALPHA = 0x00000002, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs deleted file mode 100644 index f0f603b1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_TouchFingerEvent.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_TouchFingerEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - [NativeTypeName("SDL_FingerID")] - public long fingerId; - - public float x; - - public float y; - - public float dx; - - public float dy; - - public float pressure; - - [NativeTypeName("Uint32")] - public uint windowID; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs deleted file mode 100644 index 86342093..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_UserEvent.cs +++ /dev/null @@ -1,41 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_UserEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Sint32")] - public int code; - - public void* data1; - - public void* data2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs deleted file mode 100644 index bc2349d1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Vertex.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Vertex - { - public SDL_FPoint position; - - public SDL_Color color; - - public SDL_FPoint tex_coord; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs deleted file mode 100644 index 8a0ea826..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_Window.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Window - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs deleted file mode 100644 index 34ae6ca4..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_WindowEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint8")] - public byte @event; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint32")] - public int data1; - - [NativeTypeName("Sint32")] - public int data2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs deleted file mode 100644 index 9ee1dd48..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowEventID.cs +++ /dev/null @@ -1,45 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_WindowEventID - { - SDL_WINDOWEVENT_NONE, - SDL_WINDOWEVENT_SHOWN, - SDL_WINDOWEVENT_HIDDEN, - SDL_WINDOWEVENT_EXPOSED, - SDL_WINDOWEVENT_MOVED, - SDL_WINDOWEVENT_RESIZED, - SDL_WINDOWEVENT_SIZE_CHANGED, - SDL_WINDOWEVENT_MINIMIZED, - SDL_WINDOWEVENT_MAXIMIZED, - SDL_WINDOWEVENT_RESTORED, - SDL_WINDOWEVENT_ENTER, - SDL_WINDOWEVENT_LEAVE, - SDL_WINDOWEVENT_FOCUS_GAINED, - SDL_WINDOWEVENT_FOCUS_LOST, - SDL_WINDOWEVENT_CLOSE, - SDL_WINDOWEVENT_TAKE_FOCUS, - SDL_WINDOWEVENT_HIT_TEST, - SDL_WINDOWEVENT_ICCPROF_CHANGED, - SDL_WINDOWEVENT_DISPLAY_CHANGED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs deleted file mode 100644 index 6b93c22f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_WindowFlags.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_WindowFlags - { - SDL_WINDOW_FULLSCREEN = 0x00000001, - SDL_WINDOW_OPENGL = 0x00000002, - SDL_WINDOW_SHOWN = 0x00000004, - SDL_WINDOW_HIDDEN = 0x00000008, - SDL_WINDOW_BORDERLESS = 0x00000010, - SDL_WINDOW_RESIZABLE = 0x00000020, - SDL_WINDOW_MINIMIZED = 0x00000040, - SDL_WINDOW_MAXIMIZED = 0x00000080, - SDL_WINDOW_MOUSE_GRABBED = 0x00000100, - SDL_WINDOW_INPUT_FOCUS = 0x00000200, - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, - SDL_WINDOW_FULLSCREEN_DESKTOP = (SDL_WINDOW_FULLSCREEN | 0x00001000), - SDL_WINDOW_FOREIGN = 0x00000800, - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, - SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, - SDL_WINDOW_SKIP_TASKBAR = 0x00010000, - SDL_WINDOW_UTILITY = 0x00020000, - SDL_WINDOW_TOOLTIP = 0x00040000, - SDL_WINDOW_POPUP_MENU = 0x00080000, - SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, - SDL_WINDOW_VULKAN = 0x10000000, - SDL_WINDOW_METAL = 0x20000000, - SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs deleted file mode 100644 index ed05fb6c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_YUV_CONVERSION_MODE.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_YUV_CONVERSION_MODE - { - SDL_YUV_CONVERSION_JPEG, - SDL_YUV_CONVERSION_BT601, - SDL_YUV_CONVERSION_BT709, - SDL_YUV_CONVERSION_AUTOMATIC, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs deleted file mode 100644 index 40fb33e9..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_bool.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_bool - { - SDL_FALSE = 0, - SDL_TRUE = 1, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs deleted file mode 100644 index 7f92c831..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_errorcode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_errorcode - { - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs deleted file mode 100644 index 4464a3e5..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_eventaction.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_eventaction - { - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs deleted file mode 100644 index 49d51362..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/SDL_version.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_version - { - [NativeTypeName("Uint8")] - public byte major; - - [NativeTypeName("Uint8")] - public byte minor; - - [NativeTypeName("Uint8")] - public byte patch; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/TTF.cs b/sources/SDL2Sharp.Interop/codegen/default/TTF.cs deleted file mode 100644 index 234bdde5..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/TTF.cs +++ /dev/null @@ -1,366 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class TTF - { - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Linked_Version", ExactSpelling = true)] - [return: NativeTypeName("const SDL_version *")] - public static extern SDL_version* Linked_Version(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFreeTypeVersion", ExactSpelling = true)] - public static extern void GetFreeTypeVersion(int* major, int* minor, int* patch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetHarfBuzzVersion", ExactSpelling = true)] - public static extern void GetHarfBuzzVersion(int* major, int* minor, int* patch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_ByteSwappedUNICODE", ExactSpelling = true)] - public static extern void ByteSwappedUNICODE(SDL_bool swapped); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Init", ExactSpelling = true)] - public static extern int Init(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFont", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFont([NativeTypeName("const char *")] sbyte* file, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndex", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndex([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontRW(SDL_RWops* src, int freesrc, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPI", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPI", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPIRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPIRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSize", ExactSpelling = true)] - public static extern int SetFontSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSizeDPI", ExactSpelling = true)] - public static extern int SetFontSizeDPI([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontStyle", ExactSpelling = true)] - public static extern int GetFontStyle([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontStyle", ExactSpelling = true)] - public static extern void SetFontStyle([NativeTypeName("TTF_Font *")] _TTF_Font* font, int style); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontOutline", ExactSpelling = true)] - public static extern int GetFontOutline([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontOutline", ExactSpelling = true)] - public static extern void SetFontOutline([NativeTypeName("TTF_Font *")] _TTF_Font* font, int outline); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontHinting", ExactSpelling = true)] - public static extern int GetFontHinting([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontHinting", ExactSpelling = true)] - public static extern void SetFontHinting([NativeTypeName("TTF_Font *")] _TTF_Font* font, int hinting); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontWrappedAlign", ExactSpelling = true)] - public static extern int GetFontWrappedAlign([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontWrappedAlign", ExactSpelling = true)] - public static extern void SetFontWrappedAlign([NativeTypeName("TTF_Font *")] _TTF_Font* font, int align); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontHeight", ExactSpelling = true)] - public static extern int FontHeight([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontAscent", ExactSpelling = true)] - public static extern int FontAscent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontDescent", ExactSpelling = true)] - public static extern int FontDescent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontLineSkip", ExactSpelling = true)] - public static extern int FontLineSkip([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerning", ExactSpelling = true)] - public static extern int GetFontKerning([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontKerning", ExactSpelling = true)] - public static extern void SetFontKerning([NativeTypeName("TTF_Font *")] _TTF_Font* font, int allowed); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaces", ExactSpelling = true)] - [return: NativeTypeName("long")] - public static extern int FontFaces([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceIsFixedWidth", ExactSpelling = true)] - public static extern int FontFaceIsFixedWidth([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceFamilyName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* FontFaceFamilyName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceStyleName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* FontFaceStyleName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided", ExactSpelling = true)] - public static extern int GlyphIsProvided([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided32", ExactSpelling = true)] - public static extern int GlyphIsProvided32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics", ExactSpelling = true)] - public static extern int GlyphMetrics([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics32", ExactSpelling = true)] - public static extern int GlyphMetrics32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeText", ExactSpelling = true)] - public static extern int SizeText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUTF8", ExactSpelling = true)] - public static extern int SizeUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUNICODE", ExactSpelling = true)] - public static extern int SizeUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureText", ExactSpelling = true)] - public static extern int MeasureText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUTF8", ExactSpelling = true)] - public static extern int MeasureUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUNICODE", ExactSpelling = true)] - public static extern int MeasureUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_CloseFont", ExactSpelling = true)] - public static extern void CloseFont([NativeTypeName("TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_WasInit", ExactSpelling = true)] - public static extern int WasInit(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSize", ExactSpelling = true)] - public static extern int GetFontKerningSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int prev_index, int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs", ExactSpelling = true)] - public static extern int GetFontKerningSizeGlyphs([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort previous_ch, [NativeTypeName("Uint16")] ushort ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs32", ExactSpelling = true)] - public static extern int GetFontKerningSizeGlyphs32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint previous_ch, [NativeTypeName("Uint32")] uint ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSDF", ExactSpelling = true)] - public static extern int SetFontSDF([NativeTypeName("TTF_Font *")] _TTF_Font* font, SDL_bool on_off); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontSDF", ExactSpelling = true)] - public static extern SDL_bool GetFontSDF([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetDirection", ExactSpelling = true)] - public static extern int SetDirection(int direction); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetScript", ExactSpelling = true)] - public static extern int SetScript(int script); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontDirection", ExactSpelling = true)] - public static extern int SetFontDirection([NativeTypeName("TTF_Font *")] _TTF_Font* font, TTF_Direction direction); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontScriptName", ExactSpelling = true)] - public static extern int SetFontScriptName([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* script); - - [NativeTypeName("#define SDL_TTF_MAJOR_VERSION 2")] - public const int SDL_TTF_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_TTF_MINOR_VERSION 20")] - public const int SDL_TTF_MINOR_VERSION = 20; - - [NativeTypeName("#define SDL_TTF_PATCHLEVEL 2")] - public const int SDL_TTF_PATCHLEVEL = 2; - - [NativeTypeName("#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION")] - public const int TTF_MAJOR_VERSION = 2; - - [NativeTypeName("#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION")] - public const int TTF_MINOR_VERSION = 20; - - [NativeTypeName("#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL")] - public const int TTF_PATCHLEVEL = 2; - - [NativeTypeName("#define SDL_TTF_COMPILEDVERSION SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL)")] - public const int SDL_TTF_COMPILEDVERSION = ((2) * 1000 + (20) * 100 + (2)); - - [NativeTypeName("#define UNICODE_BOM_NATIVE 0xFEFF")] - public const int UNICODE_BOM_NATIVE = 0xFEFF; - - [NativeTypeName("#define UNICODE_BOM_SWAPPED 0xFFFE")] - public const int UNICODE_BOM_SWAPPED = 0xFFFE; - - [NativeTypeName("#define TTF_STYLE_NORMAL 0x00")] - public const int TTF_STYLE_NORMAL = 0x00; - - [NativeTypeName("#define TTF_STYLE_BOLD 0x01")] - public const int TTF_STYLE_BOLD = 0x01; - - [NativeTypeName("#define TTF_STYLE_ITALIC 0x02")] - public const int TTF_STYLE_ITALIC = 0x02; - - [NativeTypeName("#define TTF_STYLE_UNDERLINE 0x04")] - public const int TTF_STYLE_UNDERLINE = 0x04; - - [NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")] - public const int TTF_STYLE_STRIKETHROUGH = 0x08; - - [NativeTypeName("#define TTF_HINTING_NORMAL 0")] - public const int TTF_HINTING_NORMAL = 0; - - [NativeTypeName("#define TTF_HINTING_LIGHT 1")] - public const int TTF_HINTING_LIGHT = 1; - - [NativeTypeName("#define TTF_HINTING_MONO 2")] - public const int TTF_HINTING_MONO = 2; - - [NativeTypeName("#define TTF_HINTING_NONE 3")] - public const int TTF_HINTING_NONE = 3; - - [NativeTypeName("#define TTF_HINTING_LIGHT_SUBPIXEL 4")] - public const int TTF_HINTING_LIGHT_SUBPIXEL = 4; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_LEFT 0")] - public const int TTF_WRAPPED_ALIGN_LEFT = 0; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_CENTER 1")] - public const int TTF_WRAPPED_ALIGN_CENTER = 1; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_RIGHT 2")] - public const int TTF_WRAPPED_ALIGN_RIGHT = 2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs deleted file mode 100644 index 2d791c45..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/TTF_Direction.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum TTF_Direction - { - TTF_DIRECTION_LTR = 0, - TTF_DIRECTION_RTL, - TTF_DIRECTION_TTB, - TTF_DIRECTION_BTT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs deleted file mode 100644 index ad322b94..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/_SDL_AudioStream.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_AudioStream - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs deleted file mode 100644 index d1280ec2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/_SDL_Joystick.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_Joystick - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs deleted file mode 100644 index 35f63f7c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/_SDL_iconv_t.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_iconv_t - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs deleted file mode 100644 index e62766cf..00000000 --- a/sources/SDL2Sharp.Interop/codegen/default/_TTF_Font.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _TTF_Font - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs b/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs deleted file mode 100644 index 8ea3fc3a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/ID3D11Device.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct ID3D11Device - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs b/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs deleted file mode 100644 index ade1cb11..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/ID3D12Device.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct ID3D12Device - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs b/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs deleted file mode 100644 index 42715080..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/IDirect3DDevice9.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct IDirect3DDevice9 - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs deleted file mode 100644 index 33f72853..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/IMG.cs +++ /dev/null @@ -1,214 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class IMG - { - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Linked_Version", ExactSpelling = true)] - [return: NativeTypeName("const SDL_version *")] - public static extern SDL_version* Linked_Version(); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Init", ExactSpelling = true)] - public static extern int Init(int flags); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTyped_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load", ExactSpelling = true)] - public static extern SDL_Surface* Load([NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_Load_RW", ExactSpelling = true)] - public static extern SDL_Surface* Load_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture", ExactSpelling = true)] - public static extern SDL_Texture* LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTexture_RW", ExactSpelling = true)] - public static extern SDL_Texture* LoadTexture_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTextureTyped_RW", ExactSpelling = true)] - public static extern SDL_Texture* LoadTextureTyped_RW(SDL_Renderer* renderer, SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isAVIF", ExactSpelling = true)] - public static extern int isAVIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isICO", ExactSpelling = true)] - public static extern int isICO(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isCUR", ExactSpelling = true)] - public static extern int isCUR(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isBMP", ExactSpelling = true)] - public static extern int isBMP(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isGIF", ExactSpelling = true)] - public static extern int isGIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJPG", ExactSpelling = true)] - public static extern int isJPG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isJXL", ExactSpelling = true)] - public static extern int isJXL(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isLBM", ExactSpelling = true)] - public static extern int isLBM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPCX", ExactSpelling = true)] - public static extern int isPCX(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNG", ExactSpelling = true)] - public static extern int isPNG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isPNM", ExactSpelling = true)] - public static extern int isPNM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isSVG", ExactSpelling = true)] - public static extern int isSVG(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isQOI", ExactSpelling = true)] - public static extern int isQOI(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isTIF", ExactSpelling = true)] - public static extern int isTIF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXCF", ExactSpelling = true)] - public static extern int isXCF(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXPM", ExactSpelling = true)] - public static extern int isXPM(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isXV", ExactSpelling = true)] - public static extern int isXV(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_isWEBP", ExactSpelling = true)] - public static extern int isWEBP(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAVIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadAVIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadICO_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadICO_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadCUR_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadCUR_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadBMP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadBMP_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadGIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJPG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadJPG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadJXL_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadJXL_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadLBM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadLBM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPCX_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPCX_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPNG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadPNM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadPNM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSVG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadSVG_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadQOI_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadQOI_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTGA_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTGA_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadTIF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadTIF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXCF_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXCF_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXPM_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXPM_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadXV_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadXV_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadWEBP_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadWEBP_RW(SDL_RWops* src); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadSizedSVG_RW", ExactSpelling = true)] - public static extern SDL_Surface* LoadSizedSVG_RW(SDL_RWops* src, int width, int height); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArray", ExactSpelling = true)] - public static extern SDL_Surface* ReadXPMFromArray([NativeTypeName("char **")] sbyte** xpm); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_ReadXPMFromArrayToRGB888", ExactSpelling = true)] - public static extern SDL_Surface* ReadXPMFromArrayToRGB888([NativeTypeName("char **")] sbyte** xpm); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG", ExactSpelling = true)] - public static extern int SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SavePNG_RW", ExactSpelling = true)] - public static extern int SavePNG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG", ExactSpelling = true)] - public static extern int SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] sbyte* file, int quality); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_SaveJPG_RW", ExactSpelling = true)] - public static extern int SaveJPG_RW(SDL_Surface* surface, SDL_RWops* dst, int freedst, int quality); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimation([NativeTypeName("const char *")] sbyte* file); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimation_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimation_RW(SDL_RWops* src, int freesrc); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadAnimationTyped_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadAnimationTyped_RW(SDL_RWops* src, int freesrc, [NativeTypeName("const char *")] sbyte* type); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_FreeAnimation", ExactSpelling = true)] - public static extern void FreeAnimation(IMG_Animation* anim); - - [DllImport("SDL2_image", CallingConvention = CallingConvention.Cdecl, EntryPoint = "IMG_LoadGIFAnimation_RW", ExactSpelling = true)] - public static extern IMG_Animation* LoadGIFAnimation_RW(SDL_RWops* src); - - [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 2")] - public const int SDL_IMAGE_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 6")] - public const int SDL_IMAGE_MINOR_VERSION = 6; - - [NativeTypeName("#define SDL_IMAGE_PATCHLEVEL 3")] - public const int SDL_IMAGE_PATCHLEVEL = 3; - - [NativeTypeName("#define SDL_IMAGE_COMPILEDVERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL)")] - public const int SDL_IMAGE_COMPILEDVERSION = ((2) * 1000 + (6) * 100 + (3)); - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs deleted file mode 100644 index ad4f4be3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/IMG_Animation.cs +++ /dev/null @@ -1,35 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct IMG_Animation - { - public int w; - - public int h; - - public int count; - - public SDL_Surface** frames; - - public int* delays; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs deleted file mode 100644 index 01d7abbb..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/IMG_InitFlags.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum IMG_InitFlags - { - IMG_INIT_JPG = 0x00000001, - IMG_INIT_PNG = 0x00000002, - IMG_INIT_TIF = 0x00000004, - IMG_INIT_WEBP = 0x00000008, - IMG_INIT_JXL = 0x00000010, - IMG_INIT_AVIF = 0x00000020, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs deleted file mode 100644 index 2d13efdf..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ArrayOrder.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_ArrayOrder - { - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs deleted file mode 100644 index 541c3ca4..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCVT.cs +++ /dev/null @@ -1,79 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.CompilerServices; - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_AudioCVT - { - public int needed; - - [NativeTypeName("SDL_AudioFormat")] - public ushort src_format; - - [NativeTypeName("SDL_AudioFormat")] - public ushort dst_format; - - public double rate_incr; - - [NativeTypeName("Uint8 *")] - public byte* buf; - - public int len; - - public int len_cvt; - - public int len_mult; - - public double len_ratio; - - [NativeTypeName("SDL_AudioFilter[10]")] - public _filters_e__FixedBuffer filters; - - public int filter_index; - - public unsafe partial struct _filters_e__FixedBuffer - { - public delegate* unmanaged[Cdecl] e0; - public delegate* unmanaged[Cdecl] e1; - public delegate* unmanaged[Cdecl] e2; - public delegate* unmanaged[Cdecl] e3; - public delegate* unmanaged[Cdecl] e4; - public delegate* unmanaged[Cdecl] e5; - public delegate* unmanaged[Cdecl] e6; - public delegate* unmanaged[Cdecl] e7; - public delegate* unmanaged[Cdecl] e8; - public delegate* unmanaged[Cdecl] e9; - - public ref delegate* unmanaged[Cdecl] this[int index] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - fixed (delegate* unmanaged[Cdecl]* pThis = &e0) - { - return ref pThis[index]; - } - } - } - } - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs deleted file mode 100644 index 19851f45..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioCallback.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_AudioCallback(void* userdata, [NativeTypeName("Uint8 *")] byte* stream, int len); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs deleted file mode 100644 index 6a2b4be4..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioDeviceEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_AudioDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint8")] - public byte iscapture; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs deleted file mode 100644 index 6d696655..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioFilter.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_AudioFilter([NativeTypeName("struct SDL_AudioCVT *")] SDL_AudioCVT* cvt, [NativeTypeName("SDL_AudioFormat")] ushort format); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs deleted file mode 100644 index 17080911..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioSpec.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_AudioSpec - { - public int freq; - - [NativeTypeName("SDL_AudioFormat")] - public ushort format; - - [NativeTypeName("Uint8")] - public byte channels; - - [NativeTypeName("Uint8")] - public byte silence; - - [NativeTypeName("Uint16")] - public ushort samples; - - [NativeTypeName("Uint16")] - public ushort padding; - - [NativeTypeName("Uint32")] - public uint size; - - [NativeTypeName("SDL_AudioCallback")] - public delegate* unmanaged[Cdecl] callback; - - public void* userdata; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs deleted file mode 100644 index c6b63238..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_AudioStatus.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_AudioStatus - { - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs deleted file mode 100644 index ac362fd1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BitmapOrder.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BitmapOrder - { - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs deleted file mode 100644 index c4a03b8c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendFactor.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendFactor - { - SDL_BLENDFACTOR_ZERO = 0x1, - SDL_BLENDFACTOR_ONE = 0x2, - SDL_BLENDFACTOR_SRC_COLOR = 0x3, - SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, - SDL_BLENDFACTOR_SRC_ALPHA = 0x5, - SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, - SDL_BLENDFACTOR_DST_COLOR = 0x7, - SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, - SDL_BLENDFACTOR_DST_ALPHA = 0x9, - SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs deleted file mode 100644 index aa717040..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendMode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendMode - { - SDL_BLENDMODE_NONE = 0x00000000, - SDL_BLENDMODE_BLEND = 0x00000001, - SDL_BLENDMODE_ADD = 0x00000002, - SDL_BLENDMODE_MOD = 0x00000004, - SDL_BLENDMODE_MUL = 0x00000008, - SDL_BLENDMODE_INVALID = 0x7FFFFFFF, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs deleted file mode 100644 index 557a4d0c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlendOperation.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_BlendOperation - { - SDL_BLENDOPERATION_ADD = 0x1, - SDL_BLENDOPERATION_SUBTRACT = 0x2, - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, - SDL_BLENDOPERATION_MINIMUM = 0x4, - SDL_BLENDOPERATION_MAXIMUM = 0x5, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs deleted file mode 100644 index d5a0249d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_BlitMap.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_BlitMap - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs deleted file mode 100644 index f38be379..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Color.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Color - { - [NativeTypeName("Uint8")] - public byte r; - - [NativeTypeName("Uint8")] - public byte g; - - [NativeTypeName("Uint8")] - public byte b; - - [NativeTypeName("Uint8")] - public byte a; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs deleted file mode 100644 index 318da18f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_CommonEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_CommonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs deleted file mode 100644 index 1fdb2b85..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerAxisEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerAxisEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte axis; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short value; - - [NativeTypeName("Uint16")] - public ushort padding4; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs deleted file mode 100644 index 6a09ba56..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerButtonEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs deleted file mode 100644 index 06b1f09a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerDeviceEvent.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs deleted file mode 100644 index e86d5147..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ControllerTouchpadEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_ControllerTouchpadEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Sint32")] - public int touchpad; - - [NativeTypeName("Sint32")] - public int finger; - - public float x; - - public float y; - - public float pressure; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs deleted file mode 100644 index fd3dac2a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Cursor.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Cursor - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs deleted file mode 100644 index 20c1d52a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DUMMY_ENUM.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DUMMY_ENUM - { - DUMMY_ENUM_VALUE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs deleted file mode 100644 index a7d53cd7..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEvent.cs +++ /dev/null @@ -1,49 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_DisplayEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint display; - - [NativeTypeName("Uint8")] - public byte @event; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint32")] - public int data1; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs deleted file mode 100644 index 070eb26f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayEventID.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DisplayEventID - { - SDL_DISPLAYEVENT_NONE, - SDL_DISPLAYEVENT_ORIENTATION, - SDL_DISPLAYEVENT_CONNECTED, - SDL_DISPLAYEVENT_DISCONNECTED, - SDL_DISPLAYEVENT_MOVED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs deleted file mode 100644 index 0f662cb2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayMode.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_DisplayMode - { - [NativeTypeName("Uint32")] - public uint format; - - public int w; - - public int h; - - public int refresh_rate; - - public void* driverdata; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs deleted file mode 100644 index 5424346b..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DisplayOrientation.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_DisplayOrientation - { - SDL_ORIENTATION_UNKNOWN, - SDL_ORIENTATION_LANDSCAPE, - SDL_ORIENTATION_LANDSCAPE_FLIPPED, - SDL_ORIENTATION_PORTRAIT, - SDL_ORIENTATION_PORTRAIT_FLIPPED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs deleted file mode 100644 index 4a9a2155..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DollarGestureEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_DollarGestureEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - [NativeTypeName("SDL_GestureID")] - public long gestureId; - - [NativeTypeName("Uint32")] - public uint numFingers; - - public float error; - - public float x; - - public float y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs deleted file mode 100644 index 67b47f20..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_DropEvent.cs +++ /dev/null @@ -1,37 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_DropEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("char *")] - public sbyte* file; - - [NativeTypeName("Uint32")] - public uint windowID; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs deleted file mode 100644 index 21f529a8..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventFilter.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate int SDL_EventFilter(void* userdata, SDL_Event* @event); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs deleted file mode 100644 index 422627c3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_EventType.cs +++ /dev/null @@ -1,86 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_EventType : uint - { - SDL_FIRSTEVENT = 0, - SDL_QUIT = 0x100, - SDL_APP_TERMINATING, - SDL_APP_LOWMEMORY, - SDL_APP_WILLENTERBACKGROUND, - SDL_APP_DIDENTERBACKGROUND, - SDL_APP_WILLENTERFOREGROUND, - SDL_APP_DIDENTERFOREGROUND, - SDL_LOCALECHANGED, - SDL_DISPLAYEVENT = 0x150, - SDL_WINDOWEVENT = 0x200, - SDL_SYSWMEVENT, - SDL_KEYDOWN = 0x300, - SDL_KEYUP, - SDL_TEXTEDITING, - SDL_TEXTINPUT, - SDL_KEYMAPCHANGED, - SDL_TEXTEDITING_EXT, - SDL_MOUSEMOTION = 0x400, - SDL_MOUSEBUTTONDOWN, - SDL_MOUSEBUTTONUP, - SDL_MOUSEWHEEL, - SDL_JOYAXISMOTION = 0x600, - SDL_JOYBALLMOTION, - SDL_JOYHATMOTION, - SDL_JOYBUTTONDOWN, - SDL_JOYBUTTONUP, - SDL_JOYDEVICEADDED, - SDL_JOYDEVICEREMOVED, - SDL_JOYBATTERYUPDATED, - SDL_CONTROLLERAXISMOTION = 0x650, - SDL_CONTROLLERBUTTONDOWN, - SDL_CONTROLLERBUTTONUP, - SDL_CONTROLLERDEVICEADDED, - SDL_CONTROLLERDEVICEREMOVED, - SDL_CONTROLLERDEVICEREMAPPED, - SDL_CONTROLLERTOUCHPADDOWN, - SDL_CONTROLLERTOUCHPADMOTION, - SDL_CONTROLLERTOUCHPADUP, - SDL_CONTROLLERSENSORUPDATE, - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - SDL_CLIPBOARDUPDATE = 0x900, - SDL_DROPFILE = 0x1000, - SDL_DROPTEXT, - SDL_DROPBEGIN, - SDL_DROPCOMPLETE, - SDL_AUDIODEVICEADDED = 0x1100, - SDL_AUDIODEVICEREMOVED, - SDL_SENSORUPDATE = 0x1200, - SDL_RENDER_TARGETS_RESET = 0x2000, - SDL_RENDER_DEVICE_RESET, - SDL_POLLSENTINEL = 0x7F00, - SDL_USEREVENT = 0x8000, - SDL_LASTEVENT = 0xFFFF, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs deleted file mode 100644 index 49f5b786..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FPoint.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_FPoint - { - public float x; - - public float y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs deleted file mode 100644 index 4761637e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FRect.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_FRect - { - public float x; - - public float y; - - public float w; - - public float h; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs deleted file mode 100644 index d019c1ce..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_FlashOperation.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_FlashOperation - { - SDL_FLASH_CANCEL, - SDL_FLASH_BRIEFLY, - SDL_FLASH_UNTIL_FOCUSED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs deleted file mode 100644 index 513410ec..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLContextResetNotification.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLContextResetNotification - { - SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, - SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs deleted file mode 100644 index 99c7f3e9..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLattr.cs +++ /dev/null @@ -1,54 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLattr - { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, - SDL_GL_CONTEXT_NO_ERROR, - SDL_GL_FLOATBUFFERS, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs deleted file mode 100644 index c3ca834f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextFlag.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLcontextFlag - { - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs deleted file mode 100644 index eb309fc6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLcontextReleaseFlag.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLcontextReleaseFlag - { - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs deleted file mode 100644 index cf5f8a36..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_GLprofile.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_GLprofile - { - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs deleted file mode 100644 index 799a0d49..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintCallback.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_HintCallback(void* userdata, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* oldValue, [NativeTypeName("const char *")] sbyte* newValue); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs deleted file mode 100644 index 55338d44..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HintPriority.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_HintPriority - { - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs deleted file mode 100644 index fd412ad2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTest.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate SDL_HitTestResult SDL_HitTest(SDL_Window* win, [NativeTypeName("const SDL_Point *")] SDL_Point* area, void* data); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs deleted file mode 100644 index 876a0aee..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_HitTestResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_HitTestResult - { - SDL_HITTEST_NORMAL, - SDL_HITTEST_DRAGGABLE, - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs deleted file mode 100644 index c6576305..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyAxisEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyAxisEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte axis; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short value; - - [NativeTypeName("Uint16")] - public ushort padding4; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs deleted file mode 100644 index 88536464..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBallEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyBallEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte ball; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint16")] - public short xrel; - - [NativeTypeName("Sint16")] - public short yrel; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs deleted file mode 100644 index f8b2098c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyBatteryEvent.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyBatteryEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - public SDL_JoystickPowerLevel level; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs deleted file mode 100644 index 3ae12b30..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyButtonEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs deleted file mode 100644 index 0cd02b89..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyDeviceEvent.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyDeviceEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Sint32")] - public int which; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs deleted file mode 100644 index 6aa8815e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoyHatEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_JoyHatEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_JoystickID")] - public int which; - - [NativeTypeName("Uint8")] - public byte hat; - - [NativeTypeName("Uint8")] - public byte value; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs deleted file mode 100644 index 17e0de3c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickPowerLevel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_JoystickPowerLevel - { - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, - SDL_JOYSTICK_POWER_LOW, - SDL_JOYSTICK_POWER_MEDIUM, - SDL_JOYSTICK_POWER_FULL, - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs deleted file mode 100644 index e1302bcb..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_JoystickType.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_JoystickType - { - SDL_JOYSTICK_TYPE_UNKNOWN, - SDL_JOYSTICK_TYPE_GAMECONTROLLER, - SDL_JOYSTICK_TYPE_WHEEL, - SDL_JOYSTICK_TYPE_ARCADE_STICK, - SDL_JOYSTICK_TYPE_FLIGHT_STICK, - SDL_JOYSTICK_TYPE_DANCE_PAD, - SDL_JOYSTICK_TYPE_GUITAR, - SDL_JOYSTICK_TYPE_DRUM_KIT, - SDL_JOYSTICK_TYPE_ARCADE_PAD, - SDL_JOYSTICK_TYPE_THROTTLE, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs deleted file mode 100644 index 3d04b9d6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyCode.cs +++ /dev/null @@ -1,272 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using static SDL2Sharp.Interop.SDL_Scancode; - -namespace SDL2Sharp.Interop -{ - public enum SDL_KeyCode - { - SDLK_UNKNOWN = 0, - SDLK_RETURN = '\r', - SDLK_ESCAPE = '', - SDLK_BACKSPACE = '', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - SDLK_CAPSLOCK = (SDL_SCANCODE_CAPSLOCK | (1 << 30)), - SDLK_F1 = (SDL_SCANCODE_F1 | (1 << 30)), - SDLK_F2 = (SDL_SCANCODE_F2 | (1 << 30)), - SDLK_F3 = (SDL_SCANCODE_F3 | (1 << 30)), - SDLK_F4 = (SDL_SCANCODE_F4 | (1 << 30)), - SDLK_F5 = (SDL_SCANCODE_F5 | (1 << 30)), - SDLK_F6 = (SDL_SCANCODE_F6 | (1 << 30)), - SDLK_F7 = (SDL_SCANCODE_F7 | (1 << 30)), - SDLK_F8 = (SDL_SCANCODE_F8 | (1 << 30)), - SDLK_F9 = (SDL_SCANCODE_F9 | (1 << 30)), - SDLK_F10 = (SDL_SCANCODE_F10 | (1 << 30)), - SDLK_F11 = (SDL_SCANCODE_F11 | (1 << 30)), - SDLK_F12 = (SDL_SCANCODE_F12 | (1 << 30)), - SDLK_PRINTSCREEN = (SDL_SCANCODE_PRINTSCREEN | (1 << 30)), - SDLK_SCROLLLOCK = (SDL_SCANCODE_SCROLLLOCK | (1 << 30)), - SDLK_PAUSE = (SDL_SCANCODE_PAUSE | (1 << 30)), - SDLK_INSERT = (SDL_SCANCODE_INSERT | (1 << 30)), - SDLK_HOME = (SDL_SCANCODE_HOME | (1 << 30)), - SDLK_PAGEUP = (SDL_SCANCODE_PAGEUP | (1 << 30)), - SDLK_DELETE = '', - SDLK_END = (SDL_SCANCODE_END | (1 << 30)), - SDLK_PAGEDOWN = (SDL_SCANCODE_PAGEDOWN | (1 << 30)), - SDLK_RIGHT = (SDL_SCANCODE_RIGHT | (1 << 30)), - SDLK_LEFT = (SDL_SCANCODE_LEFT | (1 << 30)), - SDLK_DOWN = (SDL_SCANCODE_DOWN | (1 << 30)), - SDLK_UP = (SDL_SCANCODE_UP | (1 << 30)), - SDLK_NUMLOCKCLEAR = (SDL_SCANCODE_NUMLOCKCLEAR | (1 << 30)), - SDLK_KP_DIVIDE = (SDL_SCANCODE_KP_DIVIDE | (1 << 30)), - SDLK_KP_MULTIPLY = (SDL_SCANCODE_KP_MULTIPLY | (1 << 30)), - SDLK_KP_MINUS = (SDL_SCANCODE_KP_MINUS | (1 << 30)), - SDLK_KP_PLUS = (SDL_SCANCODE_KP_PLUS | (1 << 30)), - SDLK_KP_ENTER = (SDL_SCANCODE_KP_ENTER | (1 << 30)), - SDLK_KP_1 = (SDL_SCANCODE_KP_1 | (1 << 30)), - SDLK_KP_2 = (SDL_SCANCODE_KP_2 | (1 << 30)), - SDLK_KP_3 = (SDL_SCANCODE_KP_3 | (1 << 30)), - SDLK_KP_4 = (SDL_SCANCODE_KP_4 | (1 << 30)), - SDLK_KP_5 = (SDL_SCANCODE_KP_5 | (1 << 30)), - SDLK_KP_6 = (SDL_SCANCODE_KP_6 | (1 << 30)), - SDLK_KP_7 = (SDL_SCANCODE_KP_7 | (1 << 30)), - SDLK_KP_8 = (SDL_SCANCODE_KP_8 | (1 << 30)), - SDLK_KP_9 = (SDL_SCANCODE_KP_9 | (1 << 30)), - SDLK_KP_0 = (SDL_SCANCODE_KP_0 | (1 << 30)), - SDLK_KP_PERIOD = (SDL_SCANCODE_KP_PERIOD | (1 << 30)), - SDLK_APPLICATION = (SDL_SCANCODE_APPLICATION | (1 << 30)), - SDLK_POWER = (SDL_SCANCODE_POWER | (1 << 30)), - SDLK_KP_EQUALS = (SDL_SCANCODE_KP_EQUALS | (1 << 30)), - SDLK_F13 = (SDL_SCANCODE_F13 | (1 << 30)), - SDLK_F14 = (SDL_SCANCODE_F14 | (1 << 30)), - SDLK_F15 = (SDL_SCANCODE_F15 | (1 << 30)), - SDLK_F16 = (SDL_SCANCODE_F16 | (1 << 30)), - SDLK_F17 = (SDL_SCANCODE_F17 | (1 << 30)), - SDLK_F18 = (SDL_SCANCODE_F18 | (1 << 30)), - SDLK_F19 = (SDL_SCANCODE_F19 | (1 << 30)), - SDLK_F20 = (SDL_SCANCODE_F20 | (1 << 30)), - SDLK_F21 = (SDL_SCANCODE_F21 | (1 << 30)), - SDLK_F22 = (SDL_SCANCODE_F22 | (1 << 30)), - SDLK_F23 = (SDL_SCANCODE_F23 | (1 << 30)), - SDLK_F24 = (SDL_SCANCODE_F24 | (1 << 30)), - SDLK_EXECUTE = (SDL_SCANCODE_EXECUTE | (1 << 30)), - SDLK_HELP = (SDL_SCANCODE_HELP | (1 << 30)), - SDLK_MENU = (SDL_SCANCODE_MENU | (1 << 30)), - SDLK_SELECT = (SDL_SCANCODE_SELECT | (1 << 30)), - SDLK_STOP = (SDL_SCANCODE_STOP | (1 << 30)), - SDLK_AGAIN = (SDL_SCANCODE_AGAIN | (1 << 30)), - SDLK_UNDO = (SDL_SCANCODE_UNDO | (1 << 30)), - SDLK_CUT = (SDL_SCANCODE_CUT | (1 << 30)), - SDLK_COPY = (SDL_SCANCODE_COPY | (1 << 30)), - SDLK_PASTE = (SDL_SCANCODE_PASTE | (1 << 30)), - SDLK_FIND = (SDL_SCANCODE_FIND | (1 << 30)), - SDLK_MUTE = (SDL_SCANCODE_MUTE | (1 << 30)), - SDLK_VOLUMEUP = (SDL_SCANCODE_VOLUMEUP | (1 << 30)), - SDLK_VOLUMEDOWN = (SDL_SCANCODE_VOLUMEDOWN | (1 << 30)), - SDLK_KP_COMMA = (SDL_SCANCODE_KP_COMMA | (1 << 30)), - SDLK_KP_EQUALSAS400 = (SDL_SCANCODE_KP_EQUALSAS400 | (1 << 30)), - SDLK_ALTERASE = (SDL_SCANCODE_ALTERASE | (1 << 30)), - SDLK_SYSREQ = (SDL_SCANCODE_SYSREQ | (1 << 30)), - SDLK_CANCEL = (SDL_SCANCODE_CANCEL | (1 << 30)), - SDLK_CLEAR = (SDL_SCANCODE_CLEAR | (1 << 30)), - SDLK_PRIOR = (SDL_SCANCODE_PRIOR | (1 << 30)), - SDLK_RETURN2 = (SDL_SCANCODE_RETURN2 | (1 << 30)), - SDLK_SEPARATOR = (SDL_SCANCODE_SEPARATOR | (1 << 30)), - SDLK_OUT = (SDL_SCANCODE_OUT | (1 << 30)), - SDLK_OPER = (SDL_SCANCODE_OPER | (1 << 30)), - SDLK_CLEARAGAIN = (SDL_SCANCODE_CLEARAGAIN | (1 << 30)), - SDLK_CRSEL = (SDL_SCANCODE_CRSEL | (1 << 30)), - SDLK_EXSEL = (SDL_SCANCODE_EXSEL | (1 << 30)), - SDLK_KP_00 = (SDL_SCANCODE_KP_00 | (1 << 30)), - SDLK_KP_000 = (SDL_SCANCODE_KP_000 | (1 << 30)), - SDLK_THOUSANDSSEPARATOR = (SDL_SCANCODE_THOUSANDSSEPARATOR | (1 << 30)), - SDLK_DECIMALSEPARATOR = (SDL_SCANCODE_DECIMALSEPARATOR | (1 << 30)), - SDLK_CURRENCYUNIT = (SDL_SCANCODE_CURRENCYUNIT | (1 << 30)), - SDLK_CURRENCYSUBUNIT = (SDL_SCANCODE_CURRENCYSUBUNIT | (1 << 30)), - SDLK_KP_LEFTPAREN = (SDL_SCANCODE_KP_LEFTPAREN | (1 << 30)), - SDLK_KP_RIGHTPAREN = (SDL_SCANCODE_KP_RIGHTPAREN | (1 << 30)), - SDLK_KP_LEFTBRACE = (SDL_SCANCODE_KP_LEFTBRACE | (1 << 30)), - SDLK_KP_RIGHTBRACE = (SDL_SCANCODE_KP_RIGHTBRACE | (1 << 30)), - SDLK_KP_TAB = (SDL_SCANCODE_KP_TAB | (1 << 30)), - SDLK_KP_BACKSPACE = (SDL_SCANCODE_KP_BACKSPACE | (1 << 30)), - SDLK_KP_A = (SDL_SCANCODE_KP_A | (1 << 30)), - SDLK_KP_B = (SDL_SCANCODE_KP_B | (1 << 30)), - SDLK_KP_C = (SDL_SCANCODE_KP_C | (1 << 30)), - SDLK_KP_D = (SDL_SCANCODE_KP_D | (1 << 30)), - SDLK_KP_E = (SDL_SCANCODE_KP_E | (1 << 30)), - SDLK_KP_F = (SDL_SCANCODE_KP_F | (1 << 30)), - SDLK_KP_XOR = (SDL_SCANCODE_KP_XOR | (1 << 30)), - SDLK_KP_POWER = (SDL_SCANCODE_KP_POWER | (1 << 30)), - SDLK_KP_PERCENT = (SDL_SCANCODE_KP_PERCENT | (1 << 30)), - SDLK_KP_LESS = (SDL_SCANCODE_KP_LESS | (1 << 30)), - SDLK_KP_GREATER = (SDL_SCANCODE_KP_GREATER | (1 << 30)), - SDLK_KP_AMPERSAND = (SDL_SCANCODE_KP_AMPERSAND | (1 << 30)), - SDLK_KP_DBLAMPERSAND = (SDL_SCANCODE_KP_DBLAMPERSAND | (1 << 30)), - SDLK_KP_VERTICALBAR = (SDL_SCANCODE_KP_VERTICALBAR | (1 << 30)), - SDLK_KP_DBLVERTICALBAR = (SDL_SCANCODE_KP_DBLVERTICALBAR | (1 << 30)), - SDLK_KP_COLON = (SDL_SCANCODE_KP_COLON | (1 << 30)), - SDLK_KP_HASH = (SDL_SCANCODE_KP_HASH | (1 << 30)), - SDLK_KP_SPACE = (SDL_SCANCODE_KP_SPACE | (1 << 30)), - SDLK_KP_AT = (SDL_SCANCODE_KP_AT | (1 << 30)), - SDLK_KP_EXCLAM = (SDL_SCANCODE_KP_EXCLAM | (1 << 30)), - SDLK_KP_MEMSTORE = (SDL_SCANCODE_KP_MEMSTORE | (1 << 30)), - SDLK_KP_MEMRECALL = (SDL_SCANCODE_KP_MEMRECALL | (1 << 30)), - SDLK_KP_MEMCLEAR = (SDL_SCANCODE_KP_MEMCLEAR | (1 << 30)), - SDLK_KP_MEMADD = (SDL_SCANCODE_KP_MEMADD | (1 << 30)), - SDLK_KP_MEMSUBTRACT = (SDL_SCANCODE_KP_MEMSUBTRACT | (1 << 30)), - SDLK_KP_MEMMULTIPLY = (SDL_SCANCODE_KP_MEMMULTIPLY | (1 << 30)), - SDLK_KP_MEMDIVIDE = (SDL_SCANCODE_KP_MEMDIVIDE | (1 << 30)), - SDLK_KP_PLUSMINUS = (SDL_SCANCODE_KP_PLUSMINUS | (1 << 30)), - SDLK_KP_CLEAR = (SDL_SCANCODE_KP_CLEAR | (1 << 30)), - SDLK_KP_CLEARENTRY = (SDL_SCANCODE_KP_CLEARENTRY | (1 << 30)), - SDLK_KP_BINARY = (SDL_SCANCODE_KP_BINARY | (1 << 30)), - SDLK_KP_OCTAL = (SDL_SCANCODE_KP_OCTAL | (1 << 30)), - SDLK_KP_DECIMAL = (SDL_SCANCODE_KP_DECIMAL | (1 << 30)), - SDLK_KP_HEXADECIMAL = (SDL_SCANCODE_KP_HEXADECIMAL | (1 << 30)), - SDLK_LCTRL = (SDL_SCANCODE_LCTRL | (1 << 30)), - SDLK_LSHIFT = (SDL_SCANCODE_LSHIFT | (1 << 30)), - SDLK_LALT = (SDL_SCANCODE_LALT | (1 << 30)), - SDLK_LGUI = (SDL_SCANCODE_LGUI | (1 << 30)), - SDLK_RCTRL = (SDL_SCANCODE_RCTRL | (1 << 30)), - SDLK_RSHIFT = (SDL_SCANCODE_RSHIFT | (1 << 30)), - SDLK_RALT = (SDL_SCANCODE_RALT | (1 << 30)), - SDLK_RGUI = (SDL_SCANCODE_RGUI | (1 << 30)), - SDLK_MODE = (SDL_SCANCODE_MODE | (1 << 30)), - SDLK_AUDIONEXT = (SDL_SCANCODE_AUDIONEXT | (1 << 30)), - SDLK_AUDIOPREV = (SDL_SCANCODE_AUDIOPREV | (1 << 30)), - SDLK_AUDIOSTOP = (SDL_SCANCODE_AUDIOSTOP | (1 << 30)), - SDLK_AUDIOPLAY = (SDL_SCANCODE_AUDIOPLAY | (1 << 30)), - SDLK_AUDIOMUTE = (SDL_SCANCODE_AUDIOMUTE | (1 << 30)), - SDLK_MEDIASELECT = (SDL_SCANCODE_MEDIASELECT | (1 << 30)), - SDLK_WWW = (SDL_SCANCODE_WWW | (1 << 30)), - SDLK_MAIL = (SDL_SCANCODE_MAIL | (1 << 30)), - SDLK_CALCULATOR = (SDL_SCANCODE_CALCULATOR | (1 << 30)), - SDLK_COMPUTER = (SDL_SCANCODE_COMPUTER | (1 << 30)), - SDLK_AC_SEARCH = (SDL_SCANCODE_AC_SEARCH | (1 << 30)), - SDLK_AC_HOME = (SDL_SCANCODE_AC_HOME | (1 << 30)), - SDLK_AC_BACK = (SDL_SCANCODE_AC_BACK | (1 << 30)), - SDLK_AC_FORWARD = (SDL_SCANCODE_AC_FORWARD | (1 << 30)), - SDLK_AC_STOP = (SDL_SCANCODE_AC_STOP | (1 << 30)), - SDLK_AC_REFRESH = (SDL_SCANCODE_AC_REFRESH | (1 << 30)), - SDLK_AC_BOOKMARKS = (SDL_SCANCODE_AC_BOOKMARKS | (1 << 30)), - SDLK_BRIGHTNESSDOWN = (SDL_SCANCODE_BRIGHTNESSDOWN | (1 << 30)), - SDLK_BRIGHTNESSUP = (SDL_SCANCODE_BRIGHTNESSUP | (1 << 30)), - SDLK_DISPLAYSWITCH = (SDL_SCANCODE_DISPLAYSWITCH | (1 << 30)), - SDLK_KBDILLUMTOGGLE = (SDL_SCANCODE_KBDILLUMTOGGLE | (1 << 30)), - SDLK_KBDILLUMDOWN = (SDL_SCANCODE_KBDILLUMDOWN | (1 << 30)), - SDLK_KBDILLUMUP = (SDL_SCANCODE_KBDILLUMUP | (1 << 30)), - SDLK_EJECT = (SDL_SCANCODE_EJECT | (1 << 30)), - SDLK_SLEEP = (SDL_SCANCODE_SLEEP | (1 << 30)), - SDLK_APP1 = (SDL_SCANCODE_APP1 | (1 << 30)), - SDLK_APP2 = (SDL_SCANCODE_APP2 | (1 << 30)), - SDLK_AUDIOREWIND = (SDL_SCANCODE_AUDIOREWIND | (1 << 30)), - SDLK_AUDIOFASTFORWARD = (SDL_SCANCODE_AUDIOFASTFORWARD | (1 << 30)), - SDLK_SOFTLEFT = (SDL_SCANCODE_SOFTLEFT | (1 << 30)), - SDLK_SOFTRIGHT = (SDL_SCANCODE_SOFTRIGHT | (1 << 30)), - SDLK_CALL = (SDL_SCANCODE_CALL | (1 << 30)), - SDLK_ENDCALL = (SDL_SCANCODE_ENDCALL | (1 << 30)), - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs deleted file mode 100644 index 6ec8a2e3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_KeyboardEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_KeyboardEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte repeat; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - public SDL_Keysym keysym; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs deleted file mode 100644 index 2acca89e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keymod.cs +++ /dev/null @@ -1,44 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_Keymod - { - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_SCROLL = 0x8000, - KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, - KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, - KMOD_ALT = KMOD_LALT | KMOD_RALT, - KMOD_GUI = KMOD_LGUI | KMOD_RGUI, - KMOD_RESERVED = KMOD_SCROLL, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs deleted file mode 100644 index d23836a8..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Keysym.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Keysym - { - public SDL_Scancode scancode; - - [NativeTypeName("SDL_Keycode")] - public int sym; - - [NativeTypeName("Uint16")] - public ushort mod; - - [NativeTypeName("Uint32")] - public uint unused; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs deleted file mode 100644 index 11d2c76a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogCategory.cs +++ /dev/null @@ -1,46 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_LogCategory - { - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - SDL_LOG_CATEGORY_CUSTOM, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs deleted file mode 100644 index 08b8f567..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogOutputFunction.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_LogOutputFunction(void* userdata, int category, SDL_LogPriority priority, [NativeTypeName("const char *")] sbyte* message); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs deleted file mode 100644 index 6c754af1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_LogPriority.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_LogPriority - { - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs deleted file mode 100644 index 61c1b959..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseButtonEvent.cs +++ /dev/null @@ -1,55 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseButtonEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint8")] - public byte button; - - [NativeTypeName("Uint8")] - public byte state; - - [NativeTypeName("Uint8")] - public byte clicks; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs deleted file mode 100644 index df78952e..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseMotionEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseMotionEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Uint32")] - public uint state; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - - [NativeTypeName("Sint32")] - public int xrel; - - [NativeTypeName("Sint32")] - public int yrel; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs deleted file mode 100644 index 2bf9e69d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelDirection.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_MouseWheelDirection - { - SDL_MOUSEWHEEL_NORMAL, - SDL_MOUSEWHEEL_FLIPPED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs deleted file mode 100644 index eebc6fe2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MouseWheelEvent.cs +++ /dev/null @@ -1,56 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MouseWheelEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint32")] - public uint which; - - [NativeTypeName("Sint32")] - public int x; - - [NativeTypeName("Sint32")] - public int y; - - [NativeTypeName("Uint32")] - public uint direction; - - public float preciseX; - - public float preciseY; - - [NativeTypeName("Sint32")] - public int mouseX; - - [NativeTypeName("Sint32")] - public int mouseY; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs deleted file mode 100644 index 6048be59..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_MultiGestureEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_MultiGestureEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - public float dTheta; - - public float dDist; - - public float x; - - public float y; - - [NativeTypeName("Uint16")] - public ushort numFingers; - - [NativeTypeName("Uint16")] - public ushort padding; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs deleted file mode 100644 index 00176cd6..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_OSEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_OSEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs deleted file mode 100644 index 9e38cab3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedLayout.cs +++ /dev/null @@ -1,35 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PackedLayout - { - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs deleted file mode 100644 index abfa0753..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PackedOrder.cs +++ /dev/null @@ -1,35 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PackedOrder - { - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs deleted file mode 100644 index 59b59cbc..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Palette.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_Palette - { - public int ncolors; - - public SDL_Color* colors; - - [NativeTypeName("Uint32")] - public uint version; - - public int refcount; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs deleted file mode 100644 index 03f347b5..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelFormatEnum.cs +++ /dev/null @@ -1,83 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using static SDL2Sharp.Interop.SDL_ArrayOrder; -using static SDL2Sharp.Interop.SDL_BitmapOrder; -using static SDL2Sharp.Interop.SDL_PackedLayout; -using static SDL2Sharp.Interop.SDL_PackedOrder; -using static SDL2Sharp.Interop.SDL_PixelType; - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_PixelFormatEnum : uint - { - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX1MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX1) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((1) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX4LSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_4321) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), - SDL_PIXELFORMAT_INDEX4MSB = ((1 << 28) | ((SDL_PIXELTYPE_INDEX4) << 24) | ((SDL_BITMAPORDER_1234) << 20) | ((0) << 16) | ((4) << 8) | ((0) << 0)), - 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)), - SDL_PIXELFORMAT_BGRA4444 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_4444) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_ARGB1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGBA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_ABGR1555 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_1555) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_BGRA5551 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_5551) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGB565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_BGR565 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED16) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_565) << 16) | ((16) << 8) | ((2) << 0)), - SDL_PIXELFORMAT_RGB24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_RGB) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), - SDL_PIXELFORMAT_BGR24 = ((1 << 28) | ((SDL_PIXELTYPE_ARRAYU8) << 24) | ((SDL_ARRAYORDER_BGR) << 20) | ((0) << 16) | ((24) << 8) | ((3) << 0)), - SDL_PIXELFORMAT_XRGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XRGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_RGBX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_XBGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_XBGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_BGRX8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRX) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((24) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ARGB8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGBA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_RGBA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ABGR8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ABGR) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_BGRA8888 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_BGRA) << 20) | ((SDL_PACKEDLAYOUT_8888) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_ARGB2101010 = ((1 << 28) | ((SDL_PIXELTYPE_PACKED32) << 24) | ((SDL_PACKEDORDER_ARGB) << 20) | ((SDL_PACKEDLAYOUT_2101010) << 16) | ((32) << 8) | ((4) << 0)), - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_YV12 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_IYUV = (unchecked(((uint)((byte)('I')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('U')) << 16) | ((uint)((byte)('V')) << 24))), - SDL_PIXELFORMAT_YUY2 = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('U')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_UYVY = (unchecked(((uint)((byte)('U')) << 0) | ((uint)((byte)('Y')) << 8) | ((uint)((byte)('V')) << 16) | ((uint)((byte)('Y')) << 24))), - SDL_PIXELFORMAT_YVYU = (unchecked(((uint)((byte)('Y')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('Y')) << 16) | ((uint)((byte)('U')) << 24))), - SDL_PIXELFORMAT_NV12 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('1')) << 16) | ((uint)((byte)('2')) << 24))), - SDL_PIXELFORMAT_NV21 = (unchecked(((uint)((byte)('N')) << 0) | ((uint)((byte)('V')) << 8) | ((uint)((byte)('2')) << 16) | ((uint)((byte)('1')) << 24))), - SDL_PIXELFORMAT_EXTERNAL_OES = (unchecked(((uint)((byte)('O')) << 0) | ((uint)((byte)('E')) << 8) | ((uint)((byte)('S')) << 16) | ((uint)((byte)(' ')) << 24))), - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs deleted file mode 100644 index 9c1afa75..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_PixelType.cs +++ /dev/null @@ -1,38 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_PixelType - { - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs deleted file mode 100644 index 694e3da0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Point.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Point - { - public int x; - - public int y; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs deleted file mode 100644 index fe0f5025..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_QuitEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_QuitEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs deleted file mode 100644 index 945a6527..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RWops.cs +++ /dev/null @@ -1,104 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_RWops - { - [NativeTypeName("Sint64 (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] size; - - [NativeTypeName("Sint64 (*)(struct SDL_RWops *, Sint64, int) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] seek; - - [NativeTypeName("size_t (*)(struct SDL_RWops *, void *, size_t, size_t) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] read; - - [NativeTypeName("size_t (*)(struct SDL_RWops *, const void *, size_t, size_t) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] write; - - [NativeTypeName("int (*)(struct SDL_RWops *) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] close; - - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("__AnonymousRecord_SDL_rwops_L94_C5")] - public _hidden_e__Union hidden; - - [StructLayout(LayoutKind.Explicit)] - public partial struct _hidden_e__Union - { - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L102_C9")] - public _windowsio_e__Struct windowsio; - - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L122_C9")] - public _mem_e__Struct mem; - - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_SDL_rwops_L128_C9")] - public _unknown_e__Struct unknown; - - public unsafe partial struct _windowsio_e__Struct - { - public SDL_bool append; - - public void* h; - - [NativeTypeName("__AnonymousRecord_SDL_rwops_L106_C13")] - public _buffer_e__Struct buffer; - - public unsafe partial struct _buffer_e__Struct - { - public void* data; - - [NativeTypeName("size_t")] - public nuint size; - - [NativeTypeName("size_t")] - public nuint left; - } - } - - public unsafe partial struct _mem_e__Struct - { - [NativeTypeName("Uint8 *")] - public byte* @base; - - [NativeTypeName("Uint8 *")] - public byte* here; - - [NativeTypeName("Uint8 *")] - public byte* stop; - } - - public unsafe partial struct _unknown_e__Struct - { - public void* data1; - - public void* data2; - } - } - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs deleted file mode 100644 index d54b0ea0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Rect.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Rect - { - public int x; - - public int y; - - public int w; - - public int h; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs deleted file mode 100644 index f7b963ca..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Renderer.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Renderer - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs deleted file mode 100644 index 71b6202d..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlags.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - [NativeTypeName("int")] - public enum SDL_RendererFlags : uint - { - SDL_RENDERER_SOFTWARE = 0x00000001, - SDL_RENDERER_ACCELERATED = 0x00000002, - SDL_RENDERER_PRESENTVSYNC = 0x00000004, - SDL_RENDERER_TARGETTEXTURE = 0x00000008, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs deleted file mode 100644 index ca274bac..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_RendererFlip.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_RendererFlip - { - SDL_FLIP_NONE = 0x00000000, - SDL_FLIP_HORIZONTAL = 0x00000001, - SDL_FLIP_VERTICAL = 0x00000002, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs deleted file mode 100644 index 5f5313e0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_ScaleMode.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_ScaleMode - { - SDL_ScaleModeNearest, - SDL_ScaleModeLinear, - SDL_ScaleModeBest, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs deleted file mode 100644 index e2e09b33..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Scancode.cs +++ /dev/null @@ -1,274 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_Scancode - { - SDL_SCANCODE_UNKNOWN = 0, - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, - SDL_SCANCODE_NONUSHASH = 50, - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - SDL_SCANCODE_CAPSLOCK = 57, - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - SDL_SCANCODE_NUMLOCKCLEAR = 83, - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - SDL_SCANCODE_NONUSBACKSLASH = 100, - SDL_SCANCODE_APPLICATION = 101, - SDL_SCANCODE_POWER = 102, - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, - SDL_SCANCODE_MENU = 118, - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, - SDL_SCANCODE_UNDO = 122, - SDL_SCANCODE_CUT = 123, - SDL_SCANCODE_COPY = 124, - SDL_SCANCODE_PASTE = 125, - SDL_SCANCODE_FIND = 126, - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - SDL_SCANCODE_INTERNATIONAL1 = 135, - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, - SDL_SCANCODE_LANG2 = 145, - SDL_SCANCODE_LANG3 = 146, - SDL_SCANCODE_LANG4 = 147, - SDL_SCANCODE_LANG5 = 148, - SDL_SCANCODE_LANG6 = 149, - SDL_SCANCODE_LANG7 = 150, - SDL_SCANCODE_LANG8 = 151, - SDL_SCANCODE_LANG9 = 152, - SDL_SCANCODE_ALTERASE = 153, - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, - SDL_SCANCODE_LGUI = 227, - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - 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_SOFTLEFT = 287, - SDL_SCANCODE_SOFTRIGHT = 288, - SDL_SCANCODE_CALL = 289, - SDL_SCANCODE_ENDCALL = 290, - SDL_NUM_SCANCODES = 512, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs deleted file mode 100644 index af9d6e71..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Surface.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_Surface - { - [NativeTypeName("Uint32")] - public uint flags; - - public SDL_PixelFormat* format; - - public int w; - - public int h; - - public int pitch; - - public void* pixels; - - public void* userdata; - - public int locked; - - public void* list_blitmap; - - public SDL_Rect clip_rect; - - public SDL_BlitMap* map; - - public int refcount; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs deleted file mode 100644 index 1141d0ec..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMEvent.cs +++ /dev/null @@ -1,33 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_SysWMEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - public SDL_SysWMmsg* msg; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs deleted file mode 100644 index 0da87cae..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SysWMmsg.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_SysWMmsg - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs deleted file mode 100644 index 3578e6d2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_SystemCursor.cs +++ /dev/null @@ -1,39 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_SystemCursor - { - SDL_SYSTEM_CURSOR_ARROW, - SDL_SYSTEM_CURSOR_IBEAM, - 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_NUM_SYSTEM_CURSORS, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs deleted file mode 100644 index 13afc1f3..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextEditingExtEvent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_TextEditingExtEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("char *")] - public sbyte* text; - - [NativeTypeName("Sint32")] - public int start; - - [NativeTypeName("Sint32")] - public int length; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs deleted file mode 100644 index 4f76e639..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Texture.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Texture - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs deleted file mode 100644 index adadc839..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureAccess.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_TextureAccess - { - SDL_TEXTUREACCESS_STATIC, - SDL_TEXTUREACCESS_STREAMING, - SDL_TEXTUREACCESS_TARGET, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs deleted file mode 100644 index 7a092826..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TextureModulate.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_TextureModulate - { - SDL_TEXTUREMODULATE_NONE = 0x00000000, - SDL_TEXTUREMODULATE_COLOR = 0x00000001, - SDL_TEXTUREMODULATE_ALPHA = 0x00000002, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs deleted file mode 100644 index f0f603b1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_TouchFingerEvent.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_TouchFingerEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("SDL_TouchID")] - public long touchId; - - [NativeTypeName("SDL_FingerID")] - public long fingerId; - - public float x; - - public float y; - - public float dx; - - public float dy; - - public float pressure; - - [NativeTypeName("Uint32")] - public uint windowID; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs deleted file mode 100644 index 86342093..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_UserEvent.cs +++ /dev/null @@ -1,41 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_UserEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Sint32")] - public int code; - - public void* data1; - - public void* data2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs deleted file mode 100644 index bc2349d1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Vertex.cs +++ /dev/null @@ -1,31 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Vertex - { - public SDL_FPoint position; - - public SDL_Color color; - - public SDL_FPoint tex_coord; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs deleted file mode 100644 index 4a75f501..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_VirtualJoystickDesc.cs +++ /dev/null @@ -1,78 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public unsafe partial struct SDL_VirtualJoystickDesc - { - [NativeTypeName("Uint16")] - public ushort version; - - [NativeTypeName("Uint16")] - public ushort type; - - [NativeTypeName("Uint16")] - public ushort naxes; - - [NativeTypeName("Uint16")] - public ushort nbuttons; - - [NativeTypeName("Uint16")] - public ushort nhats; - - [NativeTypeName("Uint16")] - public ushort vendor_id; - - [NativeTypeName("Uint16")] - public ushort product_id; - - [NativeTypeName("Uint16")] - public ushort padding; - - [NativeTypeName("Uint32")] - public uint button_mask; - - [NativeTypeName("Uint32")] - public uint axis_mask; - - [NativeTypeName("const char *")] - public sbyte* name; - - public void* userdata; - - [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] Update; - - [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] SetPlayerIndex; - - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] Rumble; - - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] RumbleTriggers; - - [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] SetLED; - - [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] - public delegate* unmanaged[Cdecl] SendEffect; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs deleted file mode 100644 index 8a0ea826..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_Window.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_Window - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs deleted file mode 100644 index 34ae6ca4..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEvent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_WindowEvent - { - [NativeTypeName("Uint32")] - public uint type; - - [NativeTypeName("Uint32")] - public uint timestamp; - - [NativeTypeName("Uint32")] - public uint windowID; - - [NativeTypeName("Uint8")] - public byte @event; - - [NativeTypeName("Uint8")] - public byte padding1; - - [NativeTypeName("Uint8")] - public byte padding2; - - [NativeTypeName("Uint8")] - public byte padding3; - - [NativeTypeName("Sint32")] - public int data1; - - [NativeTypeName("Sint32")] - public int data2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs deleted file mode 100644 index 9ee1dd48..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowEventID.cs +++ /dev/null @@ -1,45 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_WindowEventID - { - SDL_WINDOWEVENT_NONE, - SDL_WINDOWEVENT_SHOWN, - SDL_WINDOWEVENT_HIDDEN, - SDL_WINDOWEVENT_EXPOSED, - SDL_WINDOWEVENT_MOVED, - SDL_WINDOWEVENT_RESIZED, - SDL_WINDOWEVENT_SIZE_CHANGED, - SDL_WINDOWEVENT_MINIMIZED, - SDL_WINDOWEVENT_MAXIMIZED, - SDL_WINDOWEVENT_RESTORED, - SDL_WINDOWEVENT_ENTER, - SDL_WINDOWEVENT_LEAVE, - SDL_WINDOWEVENT_FOCUS_GAINED, - SDL_WINDOWEVENT_FOCUS_LOST, - SDL_WINDOWEVENT_CLOSE, - SDL_WINDOWEVENT_TAKE_FOCUS, - SDL_WINDOWEVENT_HIT_TEST, - SDL_WINDOWEVENT_ICCPROF_CHANGED, - SDL_WINDOWEVENT_DISPLAY_CHANGED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs deleted file mode 100644 index 6b93c22f..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowFlags.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_WindowFlags - { - SDL_WINDOW_FULLSCREEN = 0x00000001, - SDL_WINDOW_OPENGL = 0x00000002, - SDL_WINDOW_SHOWN = 0x00000004, - SDL_WINDOW_HIDDEN = 0x00000008, - SDL_WINDOW_BORDERLESS = 0x00000010, - SDL_WINDOW_RESIZABLE = 0x00000020, - SDL_WINDOW_MINIMIZED = 0x00000040, - SDL_WINDOW_MAXIMIZED = 0x00000080, - SDL_WINDOW_MOUSE_GRABBED = 0x00000100, - SDL_WINDOW_INPUT_FOCUS = 0x00000200, - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, - SDL_WINDOW_FULLSCREEN_DESKTOP = (SDL_WINDOW_FULLSCREEN | 0x00001000), - SDL_WINDOW_FOREIGN = 0x00000800, - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, - SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, - SDL_WINDOW_SKIP_TASKBAR = 0x00010000, - SDL_WINDOW_UTILITY = 0x00020000, - SDL_WINDOW_TOOLTIP = 0x00040000, - SDL_WINDOW_POPUP_MENU = 0x00080000, - SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, - SDL_WINDOW_VULKAN = 0x10000000, - SDL_WINDOW_METAL = 0x20000000, - SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs deleted file mode 100644 index fda93f33..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_WindowsMessageHook.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_WindowsMessageHook(void* userdata, void* hWnd, [NativeTypeName("unsigned int")] uint message, [NativeTypeName("Uint64")] ulong wParam, [NativeTypeName("Sint64")] long lParam); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs deleted file mode 100644 index ed05fb6c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_YUV_CONVERSION_MODE.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_YUV_CONVERSION_MODE - { - SDL_YUV_CONVERSION_JPEG, - SDL_YUV_CONVERSION_BT601, - SDL_YUV_CONVERSION_BT709, - SDL_YUV_CONVERSION_AUTOMATIC, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs deleted file mode 100644 index 35ece88a..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_blit.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate int SDL_blit([NativeTypeName("struct SDL_Surface *")] SDL_Surface* src, SDL_Rect* srcrect, [NativeTypeName("struct SDL_Surface *")] SDL_Surface* dst, SDL_Rect* dstrect); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs deleted file mode 100644 index 40fb33e9..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_bool.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_bool - { - SDL_FALSE = 0, - SDL_TRUE = 1, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs deleted file mode 100644 index 968f9973..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_calloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_calloc_func([NativeTypeName("size_t")] UIntPtr nmemb, [NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs deleted file mode 100644 index 7f92c831..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_errorcode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_errorcode - { - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs deleted file mode 100644 index 4464a3e5..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_eventaction.cs +++ /dev/null @@ -1,29 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum SDL_eventaction - { - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs deleted file mode 100644 index e4cc9387..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_free_func.cs +++ /dev/null @@ -1,27 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void SDL_free_func(void* mem); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs deleted file mode 100644 index 8bbd3a31..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_malloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_malloc_func([NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs deleted file mode 100644 index 322a5eb0..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_realloc_func.cs +++ /dev/null @@ -1,28 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void* SDL_realloc_func(void* mem, [NativeTypeName("size_t")] UIntPtr size); -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs b/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs deleted file mode 100644 index 49d51362..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/SDL_version.cs +++ /dev/null @@ -1,34 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct SDL_version - { - [NativeTypeName("Uint8")] - public byte major; - - [NativeTypeName("Uint8")] - public byte minor; - - [NativeTypeName("Uint8")] - public byte patch; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs b/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs deleted file mode 100644 index 4f6a1fc1..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/TTF.cs +++ /dev/null @@ -1,366 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; - -namespace SDL2Sharp.Interop -{ - public static unsafe partial class TTF - { - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Linked_Version", ExactSpelling = true)] - [return: NativeTypeName("const SDL_version *")] - public static extern SDL_version* Linked_Version(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFreeTypeVersion", ExactSpelling = true)] - public static extern void GetFreeTypeVersion(int* major, int* minor, int* patch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetHarfBuzzVersion", ExactSpelling = true)] - public static extern void GetHarfBuzzVersion(int* major, int* minor, int* patch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_ByteSwappedUNICODE", ExactSpelling = true)] - public static extern void ByteSwappedUNICODE(SDL_bool swapped); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Init", ExactSpelling = true)] - public static extern int Init(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFont", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFont([NativeTypeName("const char *")] sbyte* file, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndex", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndex([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontRW(SDL_RWops* src, int freesrc, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPI", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPI", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontDPIRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_OpenFontIndexDPIRW", ExactSpelling = true)] - [return: NativeTypeName("TTF_Font *")] - public static extern _TTF_Font* OpenFontIndexDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] int index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSize", ExactSpelling = true)] - public static extern int SetFontSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSizeDPI", ExactSpelling = true)] - public static extern int SetFontSizeDPI([NativeTypeName("TTF_Font *")] _TTF_Font* font, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontStyle", ExactSpelling = true)] - public static extern int GetFontStyle([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontStyle", ExactSpelling = true)] - public static extern void SetFontStyle([NativeTypeName("TTF_Font *")] _TTF_Font* font, int style); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontOutline", ExactSpelling = true)] - public static extern int GetFontOutline([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontOutline", ExactSpelling = true)] - public static extern void SetFontOutline([NativeTypeName("TTF_Font *")] _TTF_Font* font, int outline); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontHinting", ExactSpelling = true)] - public static extern int GetFontHinting([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontHinting", ExactSpelling = true)] - public static extern void SetFontHinting([NativeTypeName("TTF_Font *")] _TTF_Font* font, int hinting); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontWrappedAlign", ExactSpelling = true)] - public static extern int GetFontWrappedAlign([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontWrappedAlign", ExactSpelling = true)] - public static extern void SetFontWrappedAlign([NativeTypeName("TTF_Font *")] _TTF_Font* font, int align); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontHeight", ExactSpelling = true)] - public static extern int FontHeight([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontAscent", ExactSpelling = true)] - public static extern int FontAscent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontDescent", ExactSpelling = true)] - public static extern int FontDescent([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontLineSkip", ExactSpelling = true)] - public static extern int FontLineSkip([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerning", ExactSpelling = true)] - public static extern int GetFontKerning([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontKerning", ExactSpelling = true)] - public static extern void SetFontKerning([NativeTypeName("TTF_Font *")] _TTF_Font* font, int allowed); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaces", ExactSpelling = true)] - [return: NativeTypeName("long")] - public static extern int FontFaces([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceIsFixedWidth", ExactSpelling = true)] - public static extern int FontFaceIsFixedWidth([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceFamilyName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* FontFaceFamilyName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_FontFaceStyleName", ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern sbyte* FontFaceStyleName([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided", ExactSpelling = true)] - public static extern int GlyphIsProvided([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphIsProvided32", ExactSpelling = true)] - public static extern int GlyphIsProvided32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics", ExactSpelling = true)] - public static extern int GlyphMetrics([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GlyphMetrics32", ExactSpelling = true)] - public static extern int GlyphMetrics32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, int* minx, int* maxx, int* miny, int* maxy, int* advance); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeText", ExactSpelling = true)] - public static extern int SizeText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUTF8", ExactSpelling = true)] - public static extern int SizeUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SizeUNICODE", ExactSpelling = true)] - public static extern int SizeUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int* w, int* h); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureText", ExactSpelling = true)] - public static extern int MeasureText([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUTF8", ExactSpelling = true)] - public static extern int MeasureUTF8([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_MeasureUNICODE", ExactSpelling = true)] - public static extern int MeasureUNICODE([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int measure_width, int* extent, int* count); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Solid_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Solid_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Solid", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Solid([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Shaded_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Shaded_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Shaded", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Shaded([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_Blended_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_Blended_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_Blended", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_Blended([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderText_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderText_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUTF8_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUTF8_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderUNICODE_LCD_Wrapped", ExactSpelling = true)] - public static extern SDL_Surface* RenderUNICODE_LCD_Wrapped([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_RenderGlyph32_LCD", ExactSpelling = true)] - public static extern SDL_Surface* RenderGlyph32_LCD([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_CloseFont", ExactSpelling = true)] - public static extern void CloseFont([NativeTypeName("TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_Quit", ExactSpelling = true)] - public static extern void Quit(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_WasInit", ExactSpelling = true)] - public static extern int WasInit(); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSize", ExactSpelling = true)] - public static extern int GetFontKerningSize([NativeTypeName("TTF_Font *")] _TTF_Font* font, int prev_index, int index); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs", ExactSpelling = true)] - public static extern int GetFontKerningSizeGlyphs([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint16")] ushort previous_ch, [NativeTypeName("Uint16")] ushort ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontKerningSizeGlyphs32", ExactSpelling = true)] - public static extern int GetFontKerningSizeGlyphs32([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("Uint32")] uint previous_ch, [NativeTypeName("Uint32")] uint ch); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontSDF", ExactSpelling = true)] - public static extern int SetFontSDF([NativeTypeName("TTF_Font *")] _TTF_Font* font, SDL_bool on_off); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontSDF", ExactSpelling = true)] - public static extern SDL_bool GetFontSDF([NativeTypeName("const TTF_Font *")] _TTF_Font* font); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetDirection", ExactSpelling = true)] - public static extern int SetDirection(int direction); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetScript", ExactSpelling = true)] - public static extern int SetScript(int script); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontDirection", ExactSpelling = true)] - public static extern int SetFontDirection([NativeTypeName("TTF_Font *")] _TTF_Font* font, TTF_Direction direction); - - [DllImport("SDL2_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_SetFontScriptName", ExactSpelling = true)] - public static extern int SetFontScriptName([NativeTypeName("TTF_Font *")] _TTF_Font* font, [NativeTypeName("const char *")] sbyte* script); - - [NativeTypeName("#define SDL_TTF_MAJOR_VERSION 2")] - public const int SDL_TTF_MAJOR_VERSION = 2; - - [NativeTypeName("#define SDL_TTF_MINOR_VERSION 20")] - public const int SDL_TTF_MINOR_VERSION = 20; - - [NativeTypeName("#define SDL_TTF_PATCHLEVEL 2")] - public const int SDL_TTF_PATCHLEVEL = 2; - - [NativeTypeName("#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION")] - public const int TTF_MAJOR_VERSION = 2; - - [NativeTypeName("#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION")] - public const int TTF_MINOR_VERSION = 20; - - [NativeTypeName("#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL")] - public const int TTF_PATCHLEVEL = 2; - - [NativeTypeName("#define SDL_TTF_COMPILEDVERSION SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL)")] - public const int SDL_TTF_COMPILEDVERSION = ((2) * 1000 + (20) * 100 + (2)); - - [NativeTypeName("#define UNICODE_BOM_NATIVE 0xFEFF")] - public const int UNICODE_BOM_NATIVE = 0xFEFF; - - [NativeTypeName("#define UNICODE_BOM_SWAPPED 0xFFFE")] - public const int UNICODE_BOM_SWAPPED = 0xFFFE; - - [NativeTypeName("#define TTF_STYLE_NORMAL 0x00")] - public const int TTF_STYLE_NORMAL = 0x00; - - [NativeTypeName("#define TTF_STYLE_BOLD 0x01")] - public const int TTF_STYLE_BOLD = 0x01; - - [NativeTypeName("#define TTF_STYLE_ITALIC 0x02")] - public const int TTF_STYLE_ITALIC = 0x02; - - [NativeTypeName("#define TTF_STYLE_UNDERLINE 0x04")] - public const int TTF_STYLE_UNDERLINE = 0x04; - - [NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")] - public const int TTF_STYLE_STRIKETHROUGH = 0x08; - - [NativeTypeName("#define TTF_HINTING_NORMAL 0")] - public const int TTF_HINTING_NORMAL = 0; - - [NativeTypeName("#define TTF_HINTING_LIGHT 1")] - public const int TTF_HINTING_LIGHT = 1; - - [NativeTypeName("#define TTF_HINTING_MONO 2")] - public const int TTF_HINTING_MONO = 2; - - [NativeTypeName("#define TTF_HINTING_NONE 3")] - public const int TTF_HINTING_NONE = 3; - - [NativeTypeName("#define TTF_HINTING_LIGHT_SUBPIXEL 4")] - public const int TTF_HINTING_LIGHT_SUBPIXEL = 4; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_LEFT 0")] - public const int TTF_WRAPPED_ALIGN_LEFT = 0; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_CENTER 1")] - public const int TTF_WRAPPED_ALIGN_CENTER = 1; - - [NativeTypeName("#define TTF_WRAPPED_ALIGN_RIGHT 2")] - public const int TTF_WRAPPED_ALIGN_RIGHT = 2; - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs b/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs deleted file mode 100644 index 2d791c45..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/TTF_Direction.cs +++ /dev/null @@ -1,30 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public enum TTF_Direction - { - TTF_DIRECTION_LTR = 0, - TTF_DIRECTION_RTL, - TTF_DIRECTION_TTB, - TTF_DIRECTION_BTT, - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs deleted file mode 100644 index ad322b94..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_AudioStream.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_AudioStream - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs deleted file mode 100644 index d1280ec2..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_Joystick.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_Joystick - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs b/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs deleted file mode 100644 index 35f63f7c..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/_SDL_iconv_t.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _SDL_iconv_t - { - } -} diff --git a/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs b/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs deleted file mode 100644 index e62766cf..00000000 --- a/sources/SDL2Sharp.Interop/codegen/latest/_TTF_Font.cs +++ /dev/null @@ -1,26 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp.Interop -{ - public partial struct _TTF_Font - { - } -} diff --git a/sources/SDL2Sharp/SDL2Sharp.csproj b/sources/SDL2Sharp/SDL2Sharp.csproj index 52b1d4dd..6d9d1c93 100644 --- a/sources/SDL2Sharp/SDL2Sharp.csproj +++ b/sources/SDL2Sharp/SDL2Sharp.csproj @@ -1,14 +1,5 @@  - - - - - - - - - net8.0 AnyCPU @@ -16,4 +7,13 @@ SDL2 + + + + + + + + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 9f45b65b..8ef07da0 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -24,14 +24,14 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj index 9dd54568..b5d00b6d 100644 --- a/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj +++ b/tests/SDL2Sharp.Interop.Tests/SDL2Sharp.Interop.Tests.csproj @@ -1,40 +1,12 @@  - net8.0;net7.0;net6.0;net481;net48;net472;net471;net47;net462 + net8.0 false AnyCPU false - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/ID3D11DeviceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D11DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/ID3D11DeviceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/ID3D12DeviceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/ID3D12DeviceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/ID3D12DeviceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/IDirect3DDevice9Tests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/IDirect3DDevice9Tests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/IDirect3DDevice9Tests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/IMG_AnimationTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/IMG_AnimationTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/IMG_AnimationTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioCVTTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioCVTTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioCVTTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioSpecTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_AudioSpecTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_AudioSpecTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_BlitMapTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_BlitMapTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_BlitMapTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ColorTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ColorTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ColorTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_CommonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CommonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_CommonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerAxisEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerAxisEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerSensorEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerSensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerSensorEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerTouchpadEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_ControllerTouchpadEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_ControllerTouchpadEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_CursorTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_CursorTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_CursorTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_DisplayEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_DisplayEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_DisplayModeTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DisplayModeTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_DisplayModeTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_DollarGestureEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DollarGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_DollarGestureEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_DropEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_DropEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_DropEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_EventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_EventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_EventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_FPointTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FPointTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_FPointTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_FRectTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_FRectTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_FRectTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_GUIDTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_GUIDTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_GUIDTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyAxisEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyAxisEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyAxisEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyBallEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBallEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyBallEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyBatteryEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyBatteryEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyBatteryEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyDeviceEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyDeviceEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyDeviceEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyHatEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_JoyHatEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_JoyHatEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_KeyboardEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeyboardEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_KeyboardEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_KeysymTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_KeysymTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_KeysymTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseButtonEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseButtonEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseButtonEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseMotionEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseMotionEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseMotionEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseWheelEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MouseWheelEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_MouseWheelEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_MultiGestureEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_MultiGestureEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_MultiGestureEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_OSEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_OSEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_OSEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_PaletteTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PaletteTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_PaletteTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_PixelFormatTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PixelFormatTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_PixelFormatTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_PointTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_PointTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_PointTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_QuitEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_QuitEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_QuitEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_RWopsTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RWopsTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_RWopsTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_RectTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RectTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_RectTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_RendererInfoTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererInfoTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_RendererInfoTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_RendererTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_RendererTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_RendererTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_SensorEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SensorEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_SensorEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_SurfaceTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SurfaceTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_SurfaceTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_SysWMEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_SysWMEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_SysWMmsgTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_SysWMmsgTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_SysWMmsgTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextEditingEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextEditingEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextEditingExtEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextEditingExtEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextEditingExtEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextInputEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextInputEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextInputEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextureTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TextureTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_TextureTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_TouchFingerEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_TouchFingerEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_TouchFingerEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_UserEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_UserEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_UserEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_VertexTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VertexTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_VertexTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_VirtualJoystickDescTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_VirtualJoystickDescTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_VirtualJoystickDescTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_WindowEventTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowEventTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_WindowEventTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_WindowTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_WindowTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_WindowTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/SDL_versionTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/SDL_versionTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/SDL_versionTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/_SDL_AudioStreamTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_AudioStreamTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/_SDL_AudioStreamTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/_SDL_JoystickTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_JoystickTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/_SDL_JoystickTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/_SDL_iconv_tTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/_SDL_iconv_tTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/_SDL_iconv_tTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/_TTF_FontTests.cs similarity index 100% rename from tests/SDL2Sharp.Interop.Tests/codegen/compatible/_TTF_FontTests.cs rename to tests/SDL2Sharp.Interop.Tests/codegen/_TTF_FontTests.cs diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs deleted file mode 100644 index b09ed038..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D11DeviceTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class ID3D11DeviceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(ID3D11Device), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(ID3D11Device).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(ID3D11Device)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs deleted file mode 100644 index 1b556ba4..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/ID3D12DeviceTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class ID3D12DeviceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(ID3D12Device), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(ID3D12Device).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(ID3D12Device)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs deleted file mode 100644 index a26be6ac..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/IDirect3DDevice9Tests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class IDirect3DDevice9Tests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(IDirect3DDevice9), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(IDirect3DDevice9).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(IDirect3DDevice9)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs deleted file mode 100644 index 59c1f784..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/IMG_AnimationTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class IMG_AnimationTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(IMG_Animation), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(IMG_Animation).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(IMG_Animation)); - } - else - { - Assert.Equal(20, sizeof(IMG_Animation)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs deleted file mode 100644 index 1b531da1..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioCVTTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioCVTTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioCVT), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioCVT).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(136, sizeof(SDL_AudioCVT)); - } - else - { - Assert.Equal(88, sizeof(SDL_AudioCVT)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs deleted file mode 100644 index 65e37b33..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_AudioDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs deleted file mode 100644 index 70c0419b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_AudioSpecTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioSpecTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioSpec), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioSpec).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_AudioSpec)); - } - else - { - Assert.Equal(24, sizeof(SDL_AudioSpec)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs deleted file mode 100644 index 65b9912d..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_BlitMapTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_BlitMapTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_BlitMap), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_BlitMap).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_BlitMap)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs deleted file mode 100644 index fe3aa3a9..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ColorTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ColorTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Color), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Color).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(4, sizeof(SDL_Color)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs deleted file mode 100644 index 12a4bebe..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CommonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_CommonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_CommonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_CommonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_CommonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs deleted file mode 100644 index d212730f..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerAxisEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerAxisEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerAxisEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerAxisEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_ControllerAxisEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs deleted file mode 100644 index ff457408..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_ControllerButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs deleted file mode 100644 index 1815dae9..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(12, sizeof(SDL_ControllerDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs deleted file mode 100644 index 2ebab759..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerSensorEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerSensorEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerSensorEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerSensorEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_ControllerSensorEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs deleted file mode 100644 index ef0e793c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_ControllerTouchpadEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerTouchpadEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerTouchpadEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerTouchpadEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(32, sizeof(SDL_ControllerTouchpadEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs deleted file mode 100644 index f34ab0cc..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_CursorTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_CursorTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Cursor), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Cursor).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Cursor)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs deleted file mode 100644 index dcddfb63..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DisplayEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DisplayEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DisplayEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_DisplayEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs deleted file mode 100644 index b0af4e4c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DisplayModeTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DisplayModeTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DisplayMode), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DisplayMode).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_DisplayMode)); - } - else - { - Assert.Equal(20, sizeof(SDL_DisplayMode)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs deleted file mode 100644 index 35a91ba7..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DollarGestureEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DollarGestureEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DollarGestureEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DollarGestureEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_DollarGestureEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs deleted file mode 100644 index 87bf5ceb..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_DropEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DropEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DropEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DropEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_DropEvent)); - } - else - { - Assert.Equal(16, sizeof(SDL_DropEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs deleted file mode 100644 index f9f2e6ab..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_EventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_EventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Event), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutExplicitTest() - { - Assert.True(typeof(SDL_Event).IsExplicitLayout); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(56, sizeof(SDL_Event)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs deleted file mode 100644 index bbb20815..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FPointTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_FPointTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_FPoint), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_FPoint).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_FPoint)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs deleted file mode 100644 index 5756f915..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_FRectTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_FRectTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_FRect), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_FRect).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_FRect)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs deleted file mode 100644 index 7760fccf..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_GUIDTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_GUIDTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_GUID), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_GUID).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_GUID)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs deleted file mode 100644 index 48785e1a..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyAxisEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyAxisEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyAxisEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyAxisEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_JoyAxisEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs deleted file mode 100644 index 6ec2d277..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBallEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyBallEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyBallEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyBallEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_JoyBallEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs deleted file mode 100644 index 2a78c742..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyBatteryEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyBatteryEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyBatteryEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyBatteryEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyBatteryEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs deleted file mode 100644 index b6b95d1d..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs deleted file mode 100644 index 4f9d2cc5..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(12, sizeof(SDL_JoyDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs deleted file mode 100644 index a9cca4ca..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_JoyHatEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyHatEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyHatEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyHatEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyHatEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs deleted file mode 100644 index af353cbb..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeyboardEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_KeyboardEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_KeyboardEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_KeyboardEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(32, sizeof(SDL_KeyboardEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs deleted file mode 100644 index 7f411b4c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_KeysymTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_KeysymTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Keysym), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Keysym).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_Keysym)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs deleted file mode 100644 index 929d5374..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(28, sizeof(SDL_MouseButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs deleted file mode 100644 index ae086b9d..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseMotionEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseMotionEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseMotionEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseMotionEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(36, sizeof(SDL_MouseMotionEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs deleted file mode 100644 index 4130b6c6..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MouseWheelEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseWheelEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseWheelEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseWheelEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(44, sizeof(SDL_MouseWheelEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs deleted file mode 100644 index a29b6e21..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_MultiGestureEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MultiGestureEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MultiGestureEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MultiGestureEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_MultiGestureEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs deleted file mode 100644 index af26566b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_OSEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_OSEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_OSEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_OSEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_OSEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs deleted file mode 100644 index 14eaf236..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PaletteTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PaletteTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Palette), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Palette).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_Palette)); - } - else - { - Assert.Equal(16, sizeof(SDL_Palette)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs deleted file mode 100644 index 54d58a49..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PixelFormatTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PixelFormatTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_PixelFormat), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_PixelFormat).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(56, sizeof(SDL_PixelFormat)); - } - else - { - Assert.Equal(44, sizeof(SDL_PixelFormat)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs deleted file mode 100644 index 8350c2c1..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_PointTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PointTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Point), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Point).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_Point)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs deleted file mode 100644 index 61667e01..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_QuitEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_QuitEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_QuitEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_QuitEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_QuitEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs deleted file mode 100644 index 668aa727..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RWopsTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RWopsTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_RWops), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_RWops).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_RWops)); - } - else - { - Assert.Equal(44, sizeof(SDL_RWops)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs deleted file mode 100644 index 78b861a0..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RectTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RectTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Rect), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Rect).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_Rect)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs deleted file mode 100644 index 653f1156..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererInfoTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RendererInfoTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_RendererInfo), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_RendererInfo).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_RendererInfo)); - } - else - { - Assert.Equal(84, sizeof(SDL_RendererInfo)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs deleted file mode 100644 index dc309548..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_RendererTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RendererTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Renderer), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Renderer).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Renderer)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs deleted file mode 100644 index faa132ff..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SensorEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SensorEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SensorEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SensorEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(48, sizeof(SDL_SensorEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs deleted file mode 100644 index 64c0e525..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SurfaceTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SurfaceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Surface), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Surface).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(96, sizeof(SDL_Surface)); - } - else - { - Assert.Equal(60, sizeof(SDL_Surface)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs deleted file mode 100644 index fad39a04..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SysWMEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SysWMEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SysWMEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(16, sizeof(SDL_SysWMEvent)); - } - else - { - Assert.Equal(12, sizeof(SDL_SysWMEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs deleted file mode 100644 index ee8e49b2..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_SysWMmsgTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SysWMmsgTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SysWMmsg), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SysWMmsg).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_SysWMmsg)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs deleted file mode 100644 index 2d8ebb60..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextEditingEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextEditingEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextEditingEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(52, sizeof(SDL_TextEditingEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs deleted file mode 100644 index b19b7643..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextEditingExtEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextEditingExtEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextEditingExtEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextEditingExtEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_TextEditingExtEvent)); - } - else - { - Assert.Equal(24, sizeof(SDL_TextEditingExtEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs deleted file mode 100644 index beb5bfb0..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextInputEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextInputEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextInputEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextInputEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(44, sizeof(SDL_TextInputEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs deleted file mode 100644 index 18f5a908..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TextureTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextureTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Texture), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Texture).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Texture)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs deleted file mode 100644 index 78dec80d..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_TouchFingerEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TouchFingerEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TouchFingerEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TouchFingerEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(48, sizeof(SDL_TouchFingerEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs deleted file mode 100644 index 31998d00..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_UserEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_UserEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_UserEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_UserEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_UserEvent)); - } - else - { - Assert.Equal(24, sizeof(SDL_UserEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs deleted file mode 100644 index 2617b17b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VertexTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_VertexTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Vertex), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Vertex).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_Vertex)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs deleted file mode 100644 index 4f4c2c9c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_VirtualJoystickDescTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_VirtualJoystickDescTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_VirtualJoystickDesc), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_VirtualJoystickDesc).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_VirtualJoystickDesc)); - } - else - { - Assert.Equal(56, sizeof(SDL_VirtualJoystickDesc)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs deleted file mode 100644 index 8f1b1dfd..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_WindowEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_WindowEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_WindowEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(24, sizeof(SDL_WindowEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs deleted file mode 100644 index ee124144..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_WindowTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_WindowTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Window), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Window).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Window)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs deleted file mode 100644 index 788f36bd..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/SDL_versionTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_versionTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_version), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_version).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(3, sizeof(SDL_version)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs deleted file mode 100644 index 4d7861f3..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_AudioStreamTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_AudioStreamTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_AudioStream), Marshal.SizeOf<_SDL_AudioStream>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_AudioStream).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_AudioStream)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs deleted file mode 100644 index 1627d0c3..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_JoystickTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_JoystickTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_Joystick), Marshal.SizeOf<_SDL_Joystick>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_Joystick).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_Joystick)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs deleted file mode 100644 index 9d323452..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/_SDL_iconv_tTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_iconv_tTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_iconv_t), Marshal.SizeOf<_SDL_iconv_t>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_iconv_t).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_iconv_t)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs deleted file mode 100644 index 96c515c3..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/default/_TTF_FontTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.UnitTests -{ - /// Provides validation of the struct. - public static unsafe partial class _TTF_FontTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_TTF_Font), Marshal.SizeOf<_TTF_Font>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_TTF_Font).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_TTF_Font)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs deleted file mode 100644 index 902ee933..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D11DeviceTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class ID3D11DeviceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(ID3D11Device), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(ID3D11Device).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(ID3D11Device)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs deleted file mode 100644 index f448df0c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/ID3D12DeviceTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class ID3D12DeviceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(ID3D12Device), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(ID3D12Device).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(ID3D12Device)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs deleted file mode 100644 index 992608aa..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/IDirect3DDevice9Tests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class IDirect3DDevice9Tests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(IDirect3DDevice9), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(IDirect3DDevice9).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(IDirect3DDevice9)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs deleted file mode 100644 index c81a240f..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/IMG_AnimationTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class IMG_AnimationTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(IMG_Animation), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(IMG_Animation).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(IMG_Animation)); - } - else - { - Assert.Equal(20, sizeof(IMG_Animation)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs deleted file mode 100644 index 62687097..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioCVTTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioCVTTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioCVT), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioCVT).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(136, sizeof(SDL_AudioCVT)); - } - else - { - Assert.Equal(88, sizeof(SDL_AudioCVT)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs deleted file mode 100644 index aa9e76b5..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_AudioDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs deleted file mode 100644 index ced0ef42..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_AudioSpecTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_AudioSpecTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_AudioSpec), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_AudioSpec).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_AudioSpec)); - } - else - { - Assert.Equal(24, sizeof(SDL_AudioSpec)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs deleted file mode 100644 index d3cd923f..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_BlitMapTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_BlitMapTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_BlitMap), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_BlitMap).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_BlitMap)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs deleted file mode 100644 index 45d6d0fa..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ColorTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ColorTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Color), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Color).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(4, sizeof(SDL_Color)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs deleted file mode 100644 index 34d3a8a8..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CommonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_CommonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_CommonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_CommonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_CommonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs deleted file mode 100644 index 2b1f7950..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerAxisEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerAxisEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerAxisEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerAxisEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_ControllerAxisEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs deleted file mode 100644 index 8f2d5876..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_ControllerButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs deleted file mode 100644 index 99ba365d..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(12, sizeof(SDL_ControllerDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs deleted file mode 100644 index 1b77f29c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerSensorEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerSensorEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerSensorEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerSensorEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_ControllerSensorEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs deleted file mode 100644 index 306a0df9..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_ControllerTouchpadEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_ControllerTouchpadEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_ControllerTouchpadEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_ControllerTouchpadEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(32, sizeof(SDL_ControllerTouchpadEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs deleted file mode 100644 index 5c354b2c..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_CursorTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_CursorTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Cursor), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Cursor).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Cursor)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs deleted file mode 100644 index 1c22bb9b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DisplayEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DisplayEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DisplayEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_DisplayEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs deleted file mode 100644 index 0362d9c3..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DisplayModeTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DisplayModeTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DisplayMode), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DisplayMode).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_DisplayMode)); - } - else - { - Assert.Equal(20, sizeof(SDL_DisplayMode)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs deleted file mode 100644 index e39269e4..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DollarGestureEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DollarGestureEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DollarGestureEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DollarGestureEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_DollarGestureEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs deleted file mode 100644 index 113aef6b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_DropEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_DropEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_DropEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_DropEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_DropEvent)); - } - else - { - Assert.Equal(16, sizeof(SDL_DropEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs deleted file mode 100644 index 0c10bd35..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_EventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_EventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Event), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutExplicitTest() - { - Assert.True(typeof(SDL_Event).IsExplicitLayout); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(56, sizeof(SDL_Event)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs deleted file mode 100644 index 248145ee..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FPointTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_FPointTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_FPoint), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_FPoint).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_FPoint)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs deleted file mode 100644 index d2b27926..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_FRectTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_FRectTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_FRect), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_FRect).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_FRect)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs deleted file mode 100644 index 0c1206c3..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_GUIDTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_GUIDTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_GUID), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_GUID).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_GUID)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs deleted file mode 100644 index 61815df1..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyAxisEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyAxisEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyAxisEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyAxisEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_JoyAxisEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs deleted file mode 100644 index 32fbe2db..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBallEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyBallEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyBallEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyBallEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_JoyBallEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs deleted file mode 100644 index e7767356..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyBatteryEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyBatteryEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyBatteryEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyBatteryEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyBatteryEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs deleted file mode 100644 index 80a08286..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs deleted file mode 100644 index d4006a86..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyDeviceEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyDeviceEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyDeviceEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyDeviceEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(12, sizeof(SDL_JoyDeviceEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs deleted file mode 100644 index 17801a2a..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_JoyHatEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_JoyHatEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_JoyHatEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_JoyHatEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_JoyHatEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs deleted file mode 100644 index 00f466a7..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeyboardEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_KeyboardEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_KeyboardEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_KeyboardEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(32, sizeof(SDL_KeyboardEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs deleted file mode 100644 index 1bd03489..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_KeysymTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_KeysymTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Keysym), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Keysym).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_Keysym)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs deleted file mode 100644 index 6109eb33..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseButtonEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseButtonEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseButtonEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseButtonEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(28, sizeof(SDL_MouseButtonEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs deleted file mode 100644 index 687c7ddd..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseMotionEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseMotionEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseMotionEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseMotionEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(36, sizeof(SDL_MouseMotionEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs deleted file mode 100644 index 97d5d0bf..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MouseWheelEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MouseWheelEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MouseWheelEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MouseWheelEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(44, sizeof(SDL_MouseWheelEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs deleted file mode 100644 index 394c37e0..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_MultiGestureEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_MultiGestureEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_MultiGestureEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_MultiGestureEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(40, sizeof(SDL_MultiGestureEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs deleted file mode 100644 index 5522a976..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_OSEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_OSEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_OSEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_OSEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_OSEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs deleted file mode 100644 index 6c7592aa..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PaletteTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PaletteTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Palette), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Palette).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(24, sizeof(SDL_Palette)); - } - else - { - Assert.Equal(16, sizeof(SDL_Palette)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs deleted file mode 100644 index 8341e951..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PixelFormatTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PixelFormatTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_PixelFormat), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_PixelFormat).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(56, sizeof(SDL_PixelFormat)); - } - else - { - Assert.Equal(44, sizeof(SDL_PixelFormat)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs deleted file mode 100644 index 8bda4439..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_PointTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_PointTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Point), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Point).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_Point)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs deleted file mode 100644 index 85cfe3f4..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_QuitEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_QuitEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_QuitEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_QuitEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(8, sizeof(SDL_QuitEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs deleted file mode 100644 index 947afb58..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RWopsTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RWopsTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_RWops), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_RWops).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_RWops)); - } - else - { - Assert.Equal(44, sizeof(SDL_RWops)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs deleted file mode 100644 index f6585ac2..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RectTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RectTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Rect), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Rect).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(16, sizeof(SDL_Rect)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs deleted file mode 100644 index b770b631..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererInfoTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RendererInfoTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_RendererInfo), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_RendererInfo).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_RendererInfo)); - } - else - { - Assert.Equal(84, sizeof(SDL_RendererInfo)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs deleted file mode 100644 index 8f11ffe5..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_RendererTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_RendererTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Renderer), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Renderer).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Renderer)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs deleted file mode 100644 index e3e1d9ee..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SensorEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SensorEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SensorEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SensorEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(48, sizeof(SDL_SensorEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs deleted file mode 100644 index 42417b72..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SurfaceTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SurfaceTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Surface), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Surface).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(96, sizeof(SDL_Surface)); - } - else - { - Assert.Equal(60, sizeof(SDL_Surface)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs deleted file mode 100644 index 25302a8b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SysWMEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SysWMEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SysWMEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(16, sizeof(SDL_SysWMEvent)); - } - else - { - Assert.Equal(12, sizeof(SDL_SysWMEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs deleted file mode 100644 index 67d9f79e..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_SysWMmsgTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_SysWMmsgTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_SysWMmsg), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_SysWMmsg).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_SysWMmsg)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs deleted file mode 100644 index 44e086b8..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextEditingEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextEditingEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextEditingEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(52, sizeof(SDL_TextEditingEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs deleted file mode 100644 index 22589af6..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextEditingExtEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextEditingExtEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextEditingExtEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextEditingExtEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_TextEditingExtEvent)); - } - else - { - Assert.Equal(24, sizeof(SDL_TextEditingExtEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs deleted file mode 100644 index 79c68c7e..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextInputEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextInputEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TextInputEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TextInputEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(44, sizeof(SDL_TextInputEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs deleted file mode 100644 index 56f97725..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TextureTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TextureTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Texture), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Texture).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Texture)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs deleted file mode 100644 index 633fbb9b..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_TouchFingerEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_TouchFingerEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_TouchFingerEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_TouchFingerEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(48, sizeof(SDL_TouchFingerEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs deleted file mode 100644 index 1be2e6ca..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_UserEventTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_UserEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_UserEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_UserEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(32, sizeof(SDL_UserEvent)); - } - else - { - Assert.Equal(24, sizeof(SDL_UserEvent)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs deleted file mode 100644 index 127103bb..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VertexTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_VertexTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Vertex), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Vertex).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(20, sizeof(SDL_Vertex)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs deleted file mode 100644 index f51bf206..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_VirtualJoystickDescTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_VirtualJoystickDescTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_VirtualJoystickDesc), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_VirtualJoystickDesc).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - if (Environment.Is64BitProcess) - { - Assert.Equal(88, sizeof(SDL_VirtualJoystickDesc)); - } - else - { - Assert.Equal(56, sizeof(SDL_VirtualJoystickDesc)); - } - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs deleted file mode 100644 index 1a2d68b2..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowEventTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_WindowEventTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_WindowEvent), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_WindowEvent).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(24, sizeof(SDL_WindowEvent)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs deleted file mode 100644 index e7ee2a5a..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_WindowTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_WindowTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_Window), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_Window).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(SDL_Window)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs deleted file mode 100644 index 13bda700..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/SDL_versionTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class SDL_versionTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(SDL_version), Marshal.SizeOf()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(SDL_version).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(3, sizeof(SDL_version)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs deleted file mode 100644 index 56f6b8eb..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_AudioStreamTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_AudioStreamTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_AudioStream), Marshal.SizeOf<_SDL_AudioStream>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_AudioStream).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_AudioStream)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs deleted file mode 100644 index 44a03429..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_JoystickTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_JoystickTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_Joystick), Marshal.SizeOf<_SDL_Joystick>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_Joystick).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_Joystick)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs deleted file mode 100644 index 2771dc57..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_SDL_iconv_tTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class _SDL_iconv_tTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_SDL_iconv_t), Marshal.SizeOf<_SDL_iconv_t>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_SDL_iconv_t).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_SDL_iconv_t)); - } - } -} diff --git a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs b/tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs deleted file mode 100644 index 1b15952a..00000000 --- a/tests/SDL2Sharp.Interop.Tests/codegen/latest/_TTF_FontTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SDL2Sharp.Interop.Tests -{ - /// Provides validation of the struct. - public static unsafe partial class _TTF_FontTests - { - /// Validates that the struct is blittable. - [Fact] - public static void IsBlittableTest() - { - Assert.Equal(sizeof(_TTF_Font), Marshal.SizeOf<_TTF_Font>()); - } - - /// Validates that the struct has the right . - [Fact] - public static void IsLayoutSequentialTest() - { - Assert.True(typeof(_TTF_Font).IsLayoutSequential); - } - - /// Validates that the struct has the correct size. - [Fact] - public static void SizeOfTest() - { - Assert.Equal(1, sizeof(_TTF_Font)); - } - } -} From a71785a87e7e89435cc2ce8a4e5f960400bfbe1d Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Fri, 7 Feb 2025 13:22:01 +0100 Subject: [PATCH 54/62] Move code used by samples to the specific sample projects. --- samples/PlasmaFractal/Palette.cs | 106 ++++++++++++++++++++++++++++ samples/PlasmaFractal/Program.cs | 13 +++- samples/TunnelEffect/Program.cs | 13 +++- sources/SDL2Sharp/Math.cs | 47 ------------- sources/SDL2Sharp/Video/Palette.cs | 108 ----------------------------- 5 files changed, 130 insertions(+), 157 deletions(-) create mode 100644 samples/PlasmaFractal/Palette.cs delete mode 100644 sources/SDL2Sharp/Math.cs delete mode 100644 sources/SDL2Sharp/Video/Palette.cs diff --git a/samples/PlasmaFractal/Palette.cs b/samples/PlasmaFractal/Palette.cs new file mode 100644 index 00000000..9f3b5c9d --- /dev/null +++ b/samples/PlasmaFractal/Palette.cs @@ -0,0 +1,106 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +internal sealed class Palette where TColor : struct +{ + private readonly TColor[] _colors; + + private int _offset; + + public int Count => _colors.Length; + + public TColor this[int index] + { + get + { + if (index < 0) + { + throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be less than zero."); + } + + if (index >= _colors.Length) + { + throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be greater than or equal to the number of colors in the palette."); + } + + var shiftedIndex = _offset + index; + if (shiftedIndex >= _colors.Length) + { + shiftedIndex -= _colors.Length; + } + + return _colors[shiftedIndex]; + } + set + { + if (index < 0) + { + throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be less than zero."); + } + + if (index >= _colors.Length) + { + throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be greater than or equal to the number of colors in the palette."); + } + + var shiftedIndex = _offset + index; + if (shiftedIndex >= _colors.Length) + { + shiftedIndex -= _colors.Length; + } + + _colors[shiftedIndex] = value; + } + } + + public Palette(int size) + { + if (size < 0) + { + throw new ArgumentOutOfRangeException(nameof(size), size, "The size of a palette cannot be less than zero"); + } + + _colors = new TColor[size]; + _offset = 0; + } + + public void RotateLeft() + { + --_offset; + + if (_offset < 0) + { + _offset += _colors.Length; + } + } + + public void RotateRight() + { + ++_offset; + + if (_offset >= _colors.Length) + { + _offset -= _colors.Length; + } + } +} + diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs index a70012f4..bd8b362b 100644 --- a/samples/PlasmaFractal/Program.cs +++ b/samples/PlasmaFractal/Program.cs @@ -26,7 +26,6 @@ using SDL2Sharp.Video; using SDL2Sharp.Video.PixelFormats; using static System.Math; -using static SDL2Sharp.Math; internal static class Program { @@ -284,4 +283,16 @@ private static void Square(PackedMemoryImage map, int centerX, int centerY map[centerX, centerY] = (byte)value; } + + private static int NextPowerOfTwo(int value) + { + --value; + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + ++value; + return value; + } } diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index 38405f61..f6223257 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -26,7 +26,6 @@ using SDL2Sharp.Video; using SDL2Sharp.Video.PixelFormats; using static System.Math; -using static SDL2Sharp.Math; internal static class Program { @@ -181,4 +180,16 @@ private static PackedMemoryImage GenerateTransformTable(int width, in } return transformTable; } + + private static int NextPowerOfTwo(int value) + { + --value; + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + ++value; + return value; + } } diff --git a/sources/SDL2Sharp/Math.cs b/sources/SDL2Sharp/Math.cs deleted file mode 100644 index c2ac7e3c..00000000 --- a/sources/SDL2Sharp/Math.cs +++ /dev/null @@ -1,47 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -namespace SDL2Sharp -{ - public static class Math - { - public static int Mod(int a, int b) - { - var result = a % b; - if (result < 0) - { - result += b; - } - return result; - } - - public static int NextPowerOfTwo(int value) - { - --value; - value |= value >> 1; - value |= value >> 2; - value |= value >> 4; - value |= value >> 8; - value |= value >> 16; - ++value; - return value; - } - } -} diff --git a/sources/SDL2Sharp/Video/Palette.cs b/sources/SDL2Sharp/Video/Palette.cs deleted file mode 100644 index c67844d0..00000000 --- a/sources/SDL2Sharp/Video/Palette.cs +++ /dev/null @@ -1,108 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; - -namespace SDL2Sharp.Video -{ - public sealed class Palette where TColor : struct - { - private readonly TColor[] _colors; - - private int _offset; - - public int Count => _colors.Length; - - public TColor this[int index] - { - get - { - if (index < 0) - { - throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be less than zero."); - } - - if (index >= _colors.Length) - { - throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be greater than or equal to the number of colors in the palette."); - } - - var shiftedIndex = _offset + index; - if (shiftedIndex >= _colors.Length) - { - shiftedIndex -= _colors.Length; - } - - return _colors[shiftedIndex]; - } - set - { - if (index < 0) - { - throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be less than zero."); - } - - if (index >= _colors.Length) - { - throw new ArgumentOutOfRangeException(nameof(index), index, "The specified index cannot be greater than or equal to the number of colors in the palette."); - } - - var shiftedIndex = _offset + index; - if (shiftedIndex >= _colors.Length) - { - shiftedIndex -= _colors.Length; - } - - _colors[shiftedIndex] = value; - } - } - - public Palette(int size) - { - if (size < 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size, "The size of a palette cannot be less than zero"); - } - - _colors = new TColor[size]; - _offset = 0; - } - - public void RotateLeft() - { - --_offset; - - if (_offset < 0) - { - _offset += _colors.Length; - } - } - - public void RotateRight() - { - ++_offset; - - if (_offset >= _colors.Length) - { - _offset -= _colors.Length; - } - } - } -} From cbead0dfd297e558147123ba9037c79beca4d949 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Feb 2025 11:32:44 +0100 Subject: [PATCH 55/62] Make constructor internal. --- sources/SDL2Sharp/Video/Display.cs | 3 +-- sources/SDL2Sharp/Video/DisplayMode.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/Video/Display.cs index 9da6c1a2..012dba0d 100644 --- a/sources/SDL2Sharp/Video/Display.cs +++ b/sources/SDL2Sharp/Video/Display.cs @@ -113,10 +113,9 @@ public DisplayOrientation Orientation } } - public Display(int displayIndex) + internal Display(int displayIndex) { _displayIndex = displayIndex; } - } } diff --git a/sources/SDL2Sharp/Video/DisplayMode.cs b/sources/SDL2Sharp/Video/DisplayMode.cs index 96572ac6..0bde4d1f 100644 --- a/sources/SDL2Sharp/Video/DisplayMode.cs +++ b/sources/SDL2Sharp/Video/DisplayMode.cs @@ -30,7 +30,7 @@ public sealed class DisplayMode public int RefreshRate { get; } - public DisplayMode(PixelFormat format, int width, int height, int refreshRate) + internal DisplayMode(PixelFormat format, int width, int height, int refreshRate) { Format = format; Width = width; From 2b568f2e8d69006056c385cfa19c52e5683f9d40 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Feb 2025 11:32:56 +0100 Subject: [PATCH 56/62] Remove unused code. --- sources/SDL2Sharp/ThreadExtensions.cs | 38 --------------------------- 1 file changed, 38 deletions(-) delete mode 100644 sources/SDL2Sharp/ThreadExtensions.cs diff --git a/sources/SDL2Sharp/ThreadExtensions.cs b/sources/SDL2Sharp/ThreadExtensions.cs deleted file mode 100644 index 642e59e9..00000000 --- a/sources/SDL2Sharp/ThreadExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using System.Threading; - -namespace SDL2Sharp -{ - public static class ThreadExtensions - { - public static void SafeJoin(this Thread thread) - { - ArgumentNullException.ThrowIfNull(thread); - - if (thread.ThreadState != ThreadState.Unstarted) - { - thread.Join(); - } - } - } -} From 6452d0a9a77ab9a7a93b74f205161e4e169d3bfc Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Tue, 11 Feb 2025 17:20:50 +0100 Subject: [PATCH 57/62] Yet another major overhaul. --- .editorconfig | 2 + build/Build/IGenerate.cs | 1 - build/Build/IRestore.cs | 1 - samples/AverageFrameRate/Program.cs | 16 +- samples/BitmapViewer/Program.cs | 16 +- samples/ParticleSystem/Particle.cs | 2 +- samples/ParticleSystem/ParticleEmitter.cs | 2 +- samples/ParticleSystem/Program.cs | 16 +- samples/PlasmaFractal/Program.cs | 17 +- samples/RayTracer/Camera.cs | 3 +- samples/RayTracer/IObject.cs | 2 +- samples/RayTracer/Plane.cs | 2 +- samples/RayTracer/PointLight.cs | 2 +- samples/RayTracer/Program.cs | 19 +- samples/RayTracer/Sphere.cs | 2 +- samples/RayTracer/World.cs | 2 +- samples/SwirlStars/Program.cs | 17 +- samples/SwirlStars/Star.cs | 2 +- samples/TunnelEffect/Program.cs | 17 +- samples/WavePlayer/Program.cs | 49 ++-- .../{Extensions => extensions}/IMG.Error.cs | 0 .../{Extensions => extensions}/SDL.Blit.cs | 0 .../SDL.BlitScaled.cs | 0 .../SDL.BlitSurface.cs | 0 .../{Extensions => extensions}/TTF.Error.cs | 0 .../NativeTypeNameAttribute.cs | 0 sources/SDL2Sharp/Hints.cs | 275 ------------------ sources/SDL2Sharp/Hosting/App.cs | 56 ---- sources/SDL2Sharp/Hosting/AppBuilder.cs | 36 --- .../SDL2Sharp/Hosting/AppBuilderExtensions.cs | 66 ----- sources/SDL2Sharp/Video/Cursor.cs | 45 --- .../{Audio => audio}/AudioChannelLayout.cs | 2 +- .../AudioConstants.cs} | 5 +- .../SDL2Sharp/{Audio => audio}/AudioDevice.cs | 18 +- .../AudioDeviceAllowedChanges.cs | 13 +- .../{Audio => audio}/AudioDeviceCallback.cs | 2 +- .../SDL2Sharp/{Audio => audio}/AudioFormat.cs | 40 ++- .../{Audio => audio}/AudioFormatExtensions.cs | 12 +- .../SDL2Sharp/{Audio => audio}/AudioStatus.cs | 2 +- .../{Audio => audio}/AudioSubsystem.cs | 13 +- .../{Audio => audio}/IAudioSubsystem.cs | 2 +- .../ReadOnlySpanExtensions.cs | 2 +- .../StaticMethods.cs} | 13 +- .../SDL2Sharp/{Audio => audio}/WaveFile.cs | 9 +- sources/SDL2Sharp/{ => basics}/Error.cs | 3 +- sources/SDL2Sharp/basics/Hint.cs | 59 ++++ .../SDL2Sharp/{ => basics}/HintPriority.cs | 0 sources/SDL2Sharp/basics/Hints.cs | 274 +++++++++++++++++ sources/SDL2Sharp/basics/SDL.cs | 92 ++++++ .../AppDidEnterBackgroundEvent.cs | 2 +- .../AppDidEnterForegroundEvent.cs | 2 +- .../{Input => events}/AppLowMemoryEvent.cs | 2 +- .../{Input => events}/AppTerminatingEvent.cs | 2 +- .../AppWillEnterBackgroundEvent.cs | 2 +- .../AppWillEnterForegroundEvent.cs | 2 +- .../AudioDeviceAddedEvent.cs | 2 +- .../AudioDeviceRemovedEvent.cs | 2 +- .../{Input => events}/ClipboardUpdateEvent.cs | 2 +- .../ControllerAxisMotionEvent.cs | 2 +- .../ControllerButtonDownEvent.cs | 2 +- .../ControllerButtonUpEvent.cs | 2 +- .../ControllerDeviceAddedEvent.cs | 2 +- .../ControllerDeviceRemappedEvent.cs | 2 +- .../ControllerDeviceRemovedEvent.cs | 2 +- .../ControllerSensorUpdateEvent.cs | 2 +- .../ControllerTouchpadDownEvent.cs | 2 +- .../ControllerTouchpadMotionEvent.cs | 2 +- .../ControllerTouchpadUpEvent.cs | 2 +- .../{Input => events}/DisplayEvent.cs | 2 +- .../{Input => events}/DollarGestureEvent.cs | 2 +- .../{Input => events}/DollarRecordEvent.cs | 2 +- .../{Input => events}/DropBeginEvent.cs | 2 +- .../{Input => events}/DropCompleteEvent.cs | 2 +- .../{Input => events}/DropFileEvent.cs | 2 +- .../{Input => events}/DropTextEvent.cs | 2 +- sources/SDL2Sharp/{Input => events}/Event.cs | 2 +- .../EventsSubsystem.cs} | 23 +- .../{Input => events}/FingerDownEvent.cs | 2 +- .../{Input => events}/FingerMotionEvent.cs | 2 +- .../{Input => events}/FingerUpEvent.cs | 2 +- .../IEventsSubsystem.cs} | 9 +- .../JoystickAxisMotionEvent.cs | 2 +- .../JoystickBallMotionEvent.cs | 2 +- .../JoystickBatteryUpdatedEvent.cs | 2 +- .../JoystickButtonDownEvent.cs | 2 +- .../JoystickButtonUpEvent.cs | 2 +- .../JoystickDeviceAddedEvent.cs | 2 +- .../JoystickDeviceRemovedEvent.cs | 2 +- .../JoystickHatMotionEvent.cs | 2 +- .../{Input => events}/KeyDownEvent.cs | 2 +- .../{Input => events}/KeyMapChangedEvent.cs | 2 +- .../{Input => events}/KeyModifiers.cs | 2 +- .../SDL2Sharp/{Input => events}/KeyUpEvent.cs | 2 +- .../{Input => events}/KeyboardEvent.cs | 2 +- .../{Input => events}/LocaleChangedEvent.cs | 2 +- .../{Input => events}/MouseButtonDownEvent.cs | 2 +- .../{Input => events}/MouseButtonUpEvent.cs | 2 +- .../{Input => events}/MouseMotionEvent.cs | 2 +- .../{Input => events}/MouseWheelDirection.cs | 2 +- .../{Input => events}/MouseWheelEvent.cs | 2 +- .../{Input => events}/MultiGestureEvent.cs | 2 +- .../{Input => events}/PollSentinelEvent.cs | 2 +- .../SDL2Sharp/{Input => events}/QuitEvent.cs | 2 +- .../RenderDeviceResetEvent.cs | 2 +- .../RenderTargetsResetEvent.cs | 2 +- .../{Input => events}/SensorUpdateEvent.cs | 2 +- .../SystemWindowManagerEvent.cs | 2 +- .../{Input => events}/TextEditingEvent.cs | 2 +- .../{Input => events}/TextEditingExtEvent.cs | 2 +- .../{Input => events}/TextInputEvent.cs | 2 +- .../SDL2Sharp/{Input => events}/UserEvent.cs | 2 +- .../{Input => events}/WindowCloseEvent.cs | 2 +- .../WindowDisplayChangedEvent.cs | 2 +- .../{Input => events}/WindowEnterEvent.cs | 2 +- .../{Input => events}/WindowEvent.cs | 2 +- .../{Input => events}/WindowExposedEvent.cs | 2 +- .../WindowFocusGainedEvent.cs | 2 +- .../{Input => events}/WindowFocusLostEvent.cs | 2 +- .../{Input => events}/WindowHiddenEvent.cs | 2 +- .../{Input => events}/WindowHitTestEvent.cs | 2 +- .../WindowIccProfileChangedEvent.cs | 2 +- .../{Input => events}/WindowLeaveEvent.cs | 2 +- .../{Input => events}/WindowMaximizedEvent.cs | 2 +- .../{Input => events}/WindowMinimizedEvent.cs | 2 +- .../{Input => events}/WindowMovedEvent.cs | 2 +- .../{Input => events}/WindowResizedEvent.cs | 2 +- .../{Input => events}/WindowRestoredEvent.cs | 2 +- .../{Input => events}/WindowShownEvent.cs | 2 +- .../WindowSizeChangedEvent.cs | 2 +- .../{Input => events}/WindowTakeFocusEvent.cs | 2 +- sources/SDL2Sharp/{Fonts => fonts}/Font.cs | 5 +- .../SDL2Sharp/{Fonts => fonts}/FontError.cs | 2 +- .../{Fonts => fonts}/FontSubsystem.cs | 4 +- .../{Fonts => fonts}/IFontSubsystem.cs | 4 +- .../MarshaledString.cs | 2 +- .../SpanExtensions.cs | 2 +- .../SDL2Sharp/{Input => keyboard}/KeyCode.cs | 2 +- .../{Input => keyboard}/KeyboardState.cs | 4 +- .../{Input/Keyboard.cs => keyboard/SDL.cs} | 11 +- .../SDL2Sharp/{Input => keyboard}/Scancode.cs | 2 +- .../SDL2Sharp/{MainSystem.cs => mouse/SDL.cs} | 25 +- .../SDL2Sharp/{Video => video}/ArrayOrder.cs | 2 +- .../SDL2Sharp/{Video => video}/BitmapOrder.cs | 2 +- .../SDL2Sharp/{Video => video}/BlendMode.cs | 2 +- sources/SDL2Sharp/{Video => video}/Color.cs | 2 +- sources/SDL2Sharp/{Video => video}/Display.cs | 16 +- .../SDL2Sharp/{Video => video}/DisplayMode.cs | 2 +- .../{Video => video}/DisplayOrientation.cs | 2 +- .../{Video => video}/IVideoSubsystem.cs | 2 +- .../{Video => video}/ImageMemoryPlane.cs | 2 +- .../SDL2Sharp/{Video => video}/ImagePlane.cs | 2 +- .../SDL2Sharp/{Video => video}/NV12Image.cs | 3 +- .../{Video => video}/NV12MemoryImage.cs | 3 +- .../SDL2Sharp/{Video => video}/NV12Texture.cs | 21 +- .../SDL2Sharp/{Video => video}/NV21Image.cs | 3 +- .../{Video => video}/NV21MemoryImage.cs | 3 +- .../SDL2Sharp/{Video => video}/NV21Texture.cs | 21 +- .../SDL2Sharp/{Video => video}/PackedImage.cs | 2 +- .../{Video => video}/PackedLayout.cs | 2 +- .../{Video => video}/PackedMemoryImage.cs | 2 +- .../SDL2Sharp/{Video => video}/PackedOrder.cs | 2 +- .../{Video => video}/PackedTexture.cs | 24 +- .../SDL2Sharp/{Video => video}/PixelFormat.cs | 2 +- .../{Video => video}/PixelFormatDescriptor.cs | 14 +- .../{Video => video}/PixelFormatExtensions.cs | 2 +- .../SDL2Sharp/{Video => video}/PixelOrder.cs | 0 .../SDL2Sharp/{Video => video}/PixelType.cs | 2 +- sources/SDL2Sharp/{Video => video}/Point.cs | 2 +- .../SDL2Sharp/{Video => video}/Rectangle.cs | 2 +- .../SDL2Sharp/{Video => video}/Renderer.cs | 67 +++-- .../{Video => video}/RendererExtensions.cs | 4 +- .../{Video => video}/RendererFlags.cs | 2 +- .../{Video => video}/RendererInfo.cs | 2 +- sources/SDL2Sharp/{Video => video}/Scale.cs | 2 +- sources/SDL2Sharp/{Video => video}/Size.cs | 2 +- sources/SDL2Sharp/{Video => video}/Surface.cs | 29 +- .../{Video => video}/SurfaceLockCallback.cs | 2 +- .../SDL2Sharp/{Video => video}/Surface{T}.cs | 3 +- sources/SDL2Sharp/{Video => video}/Texture.cs | 30 +- .../{Video => video}/TextureAccess.cs | 2 +- .../{Video => video}/TextureExtensions.cs | 4 +- .../{Video => video}/VideoSubsystem.cs | 13 +- sources/SDL2Sharp/{Video => video}/Window.cs | 80 ++--- .../SDL2Sharp/{Video => video}/WindowFlags.cs | 2 +- .../{Video => video}/YUVConversionMode.cs | 2 +- .../SDL2Sharp/{Video => video}/YUVImage.cs | 3 +- .../{Video => video}/YUVMemoryImage.cs | 3 +- .../SDL2Sharp/{Video => video}/YUVTexture.cs | 22 +- .../PixelFormats => video/pixels}/ABGR1555.cs | 2 +- .../PixelFormats => video/pixels}/ABGR4444.cs | 2 +- .../PixelFormats => video/pixels}/ABGR8888.cs | 2 +- .../PixelFormats => video/pixels}/ARGB1555.cs | 2 +- .../pixels}/ARGB2101010.cs | 2 +- .../PixelFormats => video/pixels}/ARGB4444.cs | 2 +- .../PixelFormats => video/pixels}/ARGB8888.cs | 2 +- .../PixelFormats => video/pixels}/BGR24.cs | 2 +- .../PixelFormats => video/pixels}/BGR565.cs | 2 +- .../PixelFormats => video/pixels}/BGRA4444.cs | 2 +- .../PixelFormats => video/pixels}/BGRA5551.cs | 2 +- .../PixelFormats => video/pixels}/BGRA8888.cs | 5 +- .../PixelFormats => video/pixels}/BGRX8888.cs | 2 +- .../pixels}/IPackedPixel.cs | 2 +- .../PixelFormats => video/pixels}/IYUV.cs | 2 +- .../pixels}/IYUVFormat.cs | 2 +- .../PixelFormats => video/pixels}/RGB24.cs | 2 +- .../PixelFormats => video/pixels}/RGB332.cs | 2 +- .../PixelFormats => video/pixels}/RGB565.cs | 2 +- .../PixelFormats => video/pixels}/RGB96f.cs | 2 +- .../pixels}/RGB96fExtensions.cs | 2 +- .../PixelFormats => video/pixels}/RGBA4444.cs | 2 +- .../PixelFormats => video/pixels}/RGBA5551.cs | 2 +- .../PixelFormats => video/pixels}/RGBA8888.cs | 2 +- .../PixelFormats => video/pixels}/RGBX8888.cs | 2 +- .../PixelFormats => video/pixels}/U8.cs | 2 +- .../PixelFormats => video/pixels}/UV88.cs | 2 +- .../PixelFormats => video/pixels}/UYVY.cs | 2 +- .../PixelFormats => video/pixels}/V8.cs | 2 +- .../PixelFormats => video/pixels}/VU88.cs | 2 +- .../PixelFormats => video/pixels}/XBGR1555.cs | 2 +- .../PixelFormats => video/pixels}/XBGR4444.cs | 2 +- .../PixelFormats => video/pixels}/XBGR8888.cs | 2 +- .../PixelFormats => video/pixels}/XRGB1555.cs | 2 +- .../PixelFormats => video/pixels}/XRGB4444.cs | 2 +- .../PixelFormats => video/pixels}/XRGB8888.cs | 2 +- .../PixelFormats => video/pixels}/Y8.cs | 2 +- .../PixelFormats => video/pixels}/YUY2.cs | 2 +- .../PixelFormats => video/pixels}/YV12.cs | 2 +- .../PixelFormats => video/pixels}/YVYU.cs | 2 +- .../{ => audio}/AudioFormatExtensionTests.cs | 1 - .../{ => video}/PackedTextureTests.cs | 10 +- .../{ => video}/PlanarTextureTests.cs | 10 +- .../{ => video}/SurfaceTests.cs | 2 - .../{ => video}/TextureTests.cs | 10 +- .../pixels}/Argb2101010Tests.cs | 3 +- 234 files changed, 930 insertions(+), 1089 deletions(-) rename sources/SDL2Sharp.Interop/{Extensions => extensions}/IMG.Error.cs (100%) rename sources/SDL2Sharp.Interop/{Extensions => extensions}/SDL.Blit.cs (100%) rename sources/SDL2Sharp.Interop/{Extensions => extensions}/SDL.BlitScaled.cs (100%) rename sources/SDL2Sharp.Interop/{Extensions => extensions}/SDL.BlitSurface.cs (100%) rename sources/SDL2Sharp.Interop/{Extensions => extensions}/TTF.Error.cs (100%) rename sources/SDL2Sharp.Interop/{Internals => internals}/NativeTypeNameAttribute.cs (100%) delete mode 100644 sources/SDL2Sharp/Hints.cs delete mode 100644 sources/SDL2Sharp/Hosting/App.cs delete mode 100644 sources/SDL2Sharp/Hosting/AppBuilder.cs delete mode 100644 sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs delete mode 100644 sources/SDL2Sharp/Video/Cursor.cs rename sources/SDL2Sharp/{Audio => audio}/AudioChannelLayout.cs (97%) rename sources/SDL2Sharp/{IMainSystem.cs => audio/AudioConstants.cs} (88%) rename sources/SDL2Sharp/{Audio => audio}/AudioDevice.cs (93%) rename sources/SDL2Sharp/{Audio => audio}/AudioDeviceAllowedChanges.cs (76%) rename sources/SDL2Sharp/{Audio => audio}/AudioDeviceCallback.cs (97%) rename sources/SDL2Sharp/{Audio => audio}/AudioFormat.cs (60%) rename sources/SDL2Sharp/{Audio => audio}/AudioFormatExtensions.cs (83%) rename sources/SDL2Sharp/{Audio => audio}/AudioStatus.cs (97%) rename sources/SDL2Sharp/{Audio => audio}/AudioSubsystem.cs (85%) rename sources/SDL2Sharp/{Audio => audio}/IAudioSubsystem.cs (98%) rename sources/SDL2Sharp/{Audio => audio}/ReadOnlySpanExtensions.cs (99%) rename sources/SDL2Sharp/{Audio/SpanExtensions.cs => audio/StaticMethods.cs} (70%) rename sources/SDL2Sharp/{Audio => audio}/WaveFile.cs (91%) rename sources/SDL2Sharp/{ => basics}/Error.cs (96%) create mode 100644 sources/SDL2Sharp/basics/Hint.cs rename sources/SDL2Sharp/{ => basics}/HintPriority.cs (100%) create mode 100644 sources/SDL2Sharp/basics/Hints.cs create mode 100644 sources/SDL2Sharp/basics/SDL.cs rename sources/SDL2Sharp/{Input => events}/AppDidEnterBackgroundEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AppDidEnterForegroundEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AppLowMemoryEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AppTerminatingEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AppWillEnterBackgroundEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AppWillEnterForegroundEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AudioDeviceAddedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/AudioDeviceRemovedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ClipboardUpdateEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerAxisMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerButtonDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerButtonUpEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerDeviceAddedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerDeviceRemappedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerDeviceRemovedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerSensorUpdateEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerTouchpadDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerTouchpadMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/ControllerTouchpadUpEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DisplayEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DollarGestureEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DollarRecordEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DropBeginEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DropCompleteEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DropFileEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/DropTextEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/Event.cs (97%) rename sources/SDL2Sharp/{Input/EventSubsystem.cs => events/EventsSubsystem.cs} (94%) rename sources/SDL2Sharp/{Input => events}/FingerDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/FingerMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/FingerUpEvent.cs (97%) rename sources/SDL2Sharp/{Input/IEventSubsystem.cs => events/IEventsSubsystem.cs} (94%) rename sources/SDL2Sharp/{Input => events}/JoystickAxisMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickBallMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickBatteryUpdatedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickButtonDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickButtonUpEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickDeviceAddedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickDeviceRemovedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/JoystickHatMotionEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/KeyDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/KeyMapChangedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/KeyModifiers.cs (98%) rename sources/SDL2Sharp/{Input => events}/KeyUpEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/KeyboardEvent.cs (98%) rename sources/SDL2Sharp/{Input => events}/LocaleChangedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/MouseButtonDownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/MouseButtonUpEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/MouseMotionEvent.cs (98%) rename sources/SDL2Sharp/{Input => events}/MouseWheelDirection.cs (97%) rename sources/SDL2Sharp/{Input => events}/MouseWheelEvent.cs (98%) rename sources/SDL2Sharp/{Input => events}/MultiGestureEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/PollSentinelEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/QuitEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/RenderDeviceResetEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/RenderTargetsResetEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/SensorUpdateEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/SystemWindowManagerEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/TextEditingEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/TextEditingExtEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/TextInputEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/UserEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowCloseEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowDisplayChangedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowEnterEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowExposedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowFocusGainedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowFocusLostEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowHiddenEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowHitTestEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowIccProfileChangedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowLeaveEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowMaximizedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowMinimizedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowMovedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowResizedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowRestoredEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowShownEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowSizeChangedEvent.cs (97%) rename sources/SDL2Sharp/{Input => events}/WindowTakeFocusEvent.cs (97%) rename sources/SDL2Sharp/{Fonts => fonts}/Font.cs (95%) rename sources/SDL2Sharp/{Fonts => fonts}/FontError.cs (98%) rename sources/SDL2Sharp/{Fonts => fonts}/FontSubsystem.cs (93%) rename sources/SDL2Sharp/{Fonts => fonts}/IFontSubsystem.cs (97%) rename sources/SDL2Sharp/{Internals => internals}/MarshaledString.cs (98%) rename sources/SDL2Sharp/{Internals => internals}/SpanExtensions.cs (98%) rename sources/SDL2Sharp/{Input => keyboard}/KeyCode.cs (99%) rename sources/SDL2Sharp/{Input => keyboard}/KeyboardState.cs (94%) rename sources/SDL2Sharp/{Input/Keyboard.cs => keyboard/SDL.cs} (84%) rename sources/SDL2Sharp/{Input => keyboard}/Scancode.cs (99%) rename sources/SDL2Sharp/{MainSystem.cs => mouse/SDL.cs} (69%) rename sources/SDL2Sharp/{Video => video}/ArrayOrder.cs (98%) rename sources/SDL2Sharp/{Video => video}/BitmapOrder.cs (97%) rename sources/SDL2Sharp/{Video => video}/BlendMode.cs (97%) rename sources/SDL2Sharp/{Video => video}/Color.cs (98%) rename sources/SDL2Sharp/{Video => video}/Display.cs (85%) rename sources/SDL2Sharp/{Video => video}/DisplayMode.cs (98%) rename sources/SDL2Sharp/{Video => video}/DisplayOrientation.cs (98%) rename sources/SDL2Sharp/{Video => video}/IVideoSubsystem.cs (98%) rename sources/SDL2Sharp/{Video => video}/ImageMemoryPlane.cs (99%) rename sources/SDL2Sharp/{Video => video}/ImagePlane.cs (99%) rename sources/SDL2Sharp/{Video => video}/NV12Image.cs (97%) rename sources/SDL2Sharp/{Video => video}/NV12MemoryImage.cs (97%) rename sources/SDL2Sharp/{Video => video}/NV12Texture.cs (88%) rename sources/SDL2Sharp/{Video => video}/NV21Image.cs (97%) rename sources/SDL2Sharp/{Video => video}/NV21MemoryImage.cs (97%) rename sources/SDL2Sharp/{Video => video}/NV21Texture.cs (88%) rename sources/SDL2Sharp/{Video => video}/PackedImage.cs (99%) rename sources/SDL2Sharp/{Video => video}/PackedLayout.cs (98%) rename sources/SDL2Sharp/{Video => video}/PackedMemoryImage.cs (99%) rename sources/SDL2Sharp/{Video => video}/PackedOrder.cs (98%) rename sources/SDL2Sharp/{Video => video}/PackedTexture.cs (89%) rename sources/SDL2Sharp/{Video => video}/PixelFormat.cs (99%) rename sources/SDL2Sharp/{Video => video}/PixelFormatDescriptor.cs (88%) rename sources/SDL2Sharp/{Video => video}/PixelFormatExtensions.cs (99%) rename sources/SDL2Sharp/{Video => video}/PixelOrder.cs (100%) rename sources/SDL2Sharp/{Video => video}/PixelType.cs (98%) rename sources/SDL2Sharp/{Video => video}/Point.cs (97%) rename sources/SDL2Sharp/{Video => video}/Rectangle.cs (98%) rename sources/SDL2Sharp/{Video => video}/Renderer.cs (81%) rename sources/SDL2Sharp/{Video => video}/RendererExtensions.cs (99%) rename sources/SDL2Sharp/{Video => video}/RendererFlags.cs (98%) rename sources/SDL2Sharp/{Video => video}/RendererInfo.cs (98%) rename sources/SDL2Sharp/{Video => video}/Scale.cs (97%) rename sources/SDL2Sharp/{Video => video}/Size.cs (97%) rename sources/SDL2Sharp/{Video => video}/Surface.cs (78%) rename sources/SDL2Sharp/{Video => video}/SurfaceLockCallback.cs (97%) rename sources/SDL2Sharp/{Video => video}/Surface{T}.cs (98%) rename sources/SDL2Sharp/{Video => video}/Texture.cs (76%) rename sources/SDL2Sharp/{Video => video}/TextureAccess.cs (97%) rename sources/SDL2Sharp/{Video => video}/TextureExtensions.cs (96%) rename sources/SDL2Sharp/{Video => video}/VideoSubsystem.cs (86%) rename sources/SDL2Sharp/{Video => video}/Window.cs (80%) rename sources/SDL2Sharp/{Video => video}/WindowFlags.cs (98%) rename sources/SDL2Sharp/{Video => video}/YUVConversionMode.cs (98%) rename sources/SDL2Sharp/{Video => video}/YUVImage.cs (97%) rename sources/SDL2Sharp/{Video => video}/YUVMemoryImage.cs (97%) rename sources/SDL2Sharp/{Video => video}/YUVTexture.cs (88%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ABGR1555.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ABGR4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ABGR8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ARGB1555.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ARGB2101010.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ARGB4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/ARGB8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGR24.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGR565.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGRA4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGRA5551.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGRA8888.cs (95%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/BGRX8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/IPackedPixel.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/IYUV.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/IYUVFormat.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGB24.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGB332.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGB565.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGB96f.cs (99%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGB96fExtensions.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGBA4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGBA5551.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGBA8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/RGBX8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/U8.cs (96%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/UV88.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/UYVY.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/V8.cs (96%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/VU88.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XBGR1555.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XBGR4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XBGR8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XRGB1555.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XRGB4444.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/XRGB8888.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/Y8.cs (96%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/YUY2.cs (97%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/YV12.cs (98%) rename sources/SDL2Sharp/{Video/PixelFormats => video/pixels}/YVYU.cs (97%) rename tests/SDL2Sharp.Tests/{ => audio}/AudioFormatExtensionTests.cs (98%) rename tests/SDL2Sharp.Tests/{ => video}/PackedTextureTests.cs (96%) rename tests/SDL2Sharp.Tests/{ => video}/PlanarTextureTests.cs (86%) rename tests/SDL2Sharp.Tests/{ => video}/SurfaceTests.cs (96%) rename tests/SDL2Sharp.Tests/{ => video}/TextureTests.cs (94%) rename tests/SDL2Sharp.Tests/{Colors => video/pixels}/Argb2101010Tests.cs (96%) diff --git a/.editorconfig b/.editorconfig index dc2e6dc9..fba98153 100644 --- a/.editorconfig +++ b/.editorconfig @@ -332,3 +332,5 @@ dotnet_diagnostic.CA1401.severity = silent dotnet_diagnostic.SYSLIB1054.severity = silent csharp_style_prefer_top_level_statements = true:silent csharp_style_prefer_primary_constructors = true:suggestion + +dotnet_diagnostic.IDE0130.severity = silent diff --git a/build/Build/IGenerate.cs b/build/Build/IGenerate.cs index 5b7a7da5..35d3cf40 100644 --- a/build/Build/IGenerate.cs +++ b/build/Build/IGenerate.cs @@ -27,7 +27,6 @@ using static Nuke.Common.Tools.ClangSharpPInvokeGenerator.ClangSharpPInvokeGeneratorTasks; using static Nuke.Common.Tools.ClangSharpPInvokeGenerator.ClangSharpPInvokeGeneratorConfigOption; using Nuke.Common.IO; -using System; interface IGenerate : IBuild { diff --git a/build/Build/IRestore.cs b/build/Build/IRestore.cs index 6a3cc889..fc7d90e8 100644 --- a/build/Build/IRestore.cs +++ b/build/Build/IRestore.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using Nuke.Common; -using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; using static Nuke.Common.Tools.DotNet.DotNetTasks; diff --git a/samples/AverageFrameRate/Program.cs b/samples/AverageFrameRate/Program.cs index 90153c1a..76d19598 100644 --- a/samples/AverageFrameRate/Program.cs +++ b/samples/AverageFrameRate/Program.cs @@ -21,22 +21,18 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubsystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubsystem.CreateWindow("Average Frame Rate", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Average Frame Rate", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var lastFrameTime = TimeSpan.Zero; var accumulatedFrameTime = TimeSpan.Zero; @@ -47,7 +43,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/BitmapViewer/Program.cs b/samples/BitmapViewer/Program.cs index f118ee66..ac0e9182 100644 --- a/samples/BitmapViewer/Program.cs +++ b/samples/BitmapViewer/Program.cs @@ -21,23 +21,19 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubsystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubsystem.CreateWindow("Bitmap Viewer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Bitmap Viewer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); using var bitmapTexture = renderer.CreateTextureFromBitmap(Environment.GetCommandLineArgs()[1]); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var lastFrameTime = TimeSpan.Zero; var accumulatedFrameTime = TimeSpan.Zero; @@ -48,7 +44,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/ParticleSystem/Particle.cs b/samples/ParticleSystem/Particle.cs index 5afcbfad..32aa2e14 100644 --- a/samples/ParticleSystem/Particle.cs +++ b/samples/ParticleSystem/Particle.cs @@ -19,8 +19,8 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Video; using static System.Math; +using SDL2Sharp; internal sealed class Particle { diff --git a/samples/ParticleSystem/ParticleEmitter.cs b/samples/ParticleSystem/ParticleEmitter.cs index 54afd9fd..bc0666f4 100644 --- a/samples/ParticleSystem/ParticleEmitter.cs +++ b/samples/ParticleSystem/ParticleEmitter.cs @@ -20,7 +20,7 @@ using System; using System.Collections.Generic; -using SDL2Sharp.Video; +using SDL2Sharp; using static System.Math; internal sealed class ParticleEmitter diff --git a/samples/ParticleSystem/Program.cs b/samples/ParticleSystem/Program.cs index 5bab2066..8a5fc704 100644 --- a/samples/ParticleSystem/Program.cs +++ b/samples/ParticleSystem/Program.cs @@ -21,22 +21,18 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubsystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubsystem.CreateWindow("Particle System", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Particle System", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var particleEmitterColor = new Color(255, 0, 0, 255); var particleEmmiterPosition = new Point(window.Width / 2, window.Height / 2); @@ -51,7 +47,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/PlasmaFractal/Program.cs b/samples/PlasmaFractal/Program.cs index bd8b362b..2acd7eb6 100644 --- a/samples/PlasmaFractal/Program.cs +++ b/samples/PlasmaFractal/Program.cs @@ -21,25 +21,20 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using static System.Math; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubystem.CreateWindow("Plasma Fractal", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Plasma Fractal", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImage = GenerateDiamondSquareImage(renderer.OutputSize); @@ -55,7 +50,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/RayTracer/Camera.cs b/samples/RayTracer/Camera.cs index 7b907f95..0fd2cd30 100644 --- a/samples/RayTracer/Camera.cs +++ b/samples/RayTracer/Camera.cs @@ -21,8 +21,7 @@ using System; using System.Numerics; using System.Threading.Tasks; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class Camera { diff --git a/samples/RayTracer/IObject.cs b/samples/RayTracer/IObject.cs index e2d31ccf..6087a6be 100644 --- a/samples/RayTracer/IObject.cs +++ b/samples/RayTracer/IObject.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal interface IObject { diff --git a/samples/RayTracer/Plane.cs b/samples/RayTracer/Plane.cs index 9ebec646..d63d36bc 100644 --- a/samples/RayTracer/Plane.cs +++ b/samples/RayTracer/Plane.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class Plane : IObject { diff --git a/samples/RayTracer/PointLight.cs b/samples/RayTracer/PointLight.cs index c92e6209..c4e594b5 100644 --- a/samples/RayTracer/PointLight.cs +++ b/samples/RayTracer/PointLight.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class PointLight { diff --git a/samples/RayTracer/Program.cs b/samples/RayTracer/Program.cs index 05b5d764..ebd7c428 100644 --- a/samples/RayTracer/Program.cs +++ b/samples/RayTracer/Program.cs @@ -22,24 +22,19 @@ using System.Diagnostics; using System.Numerics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubystem.CreateWindow("Ray Tracer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Ray Tracer", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var world = new World { @@ -135,7 +130,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) @@ -160,7 +155,7 @@ public static void Main() var elapsedFrameTime = currentFrameTime - lastFrameTime; accumulatedFrameTime += elapsedFrameTime; - var keyboardState = Keyboard.State; + var keyboardState = SDL.KeyboardState; if (keyboardState.IsPressed(Scancode.Up) || keyboardState.IsPressed(Scancode.Keypad8)) { camera.Pitch(1f * MathF.PI / 180f); diff --git a/samples/RayTracer/Sphere.cs b/samples/RayTracer/Sphere.cs index 1b0b4922..b7d3961c 100644 --- a/samples/RayTracer/Sphere.cs +++ b/samples/RayTracer/Sphere.cs @@ -20,7 +20,7 @@ using System; using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class Sphere : IObject { diff --git a/samples/RayTracer/World.cs b/samples/RayTracer/World.cs index 3fe2a60a..d4090819 100644 --- a/samples/RayTracer/World.cs +++ b/samples/RayTracer/World.cs @@ -21,7 +21,7 @@ using System; using System.Collections.Generic; using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class World { diff --git a/samples/SwirlStars/Program.cs b/samples/SwirlStars/Program.cs index aa0bf271..97c053bc 100644 --- a/samples/SwirlStars/Program.cs +++ b/samples/SwirlStars/Program.cs @@ -23,23 +23,18 @@ using System.Numerics; using System.Collections.Generic; using SDL2Sharp; -using SDL2Sharp.Video; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video.PixelFormats; -using SDL2Sharp.Input; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubsystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubsystem.CreateWindow("Swirl Stars", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Swirl Stars", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var stars = new List(GenerateStars(256)); @@ -52,7 +47,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/SwirlStars/Star.cs b/samples/SwirlStars/Star.cs index cfbaa3ec..fa725f90 100644 --- a/samples/SwirlStars/Star.cs +++ b/samples/SwirlStars/Star.cs @@ -19,7 +19,7 @@ // 3. This notice may not be removed or altered from any source distribution. using System.Numerics; -using SDL2Sharp.Video.PixelFormats; +using SDL2Sharp; internal sealed class Star { diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index f6223257..daecff85 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -21,25 +21,20 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using static System.Math; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubystem = new VideoSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubystem.CreateWindow("Tunnel Effect", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Tunnel Effect", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); var screenSize = renderer.OutputSize; var screenImage = new PackedMemoryImage(renderer.OutputSize); @@ -56,7 +51,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) diff --git a/samples/WavePlayer/Program.cs b/samples/WavePlayer/Program.cs index 938272e3..f46ba56a 100644 --- a/samples/WavePlayer/Program.cs +++ b/samples/WavePlayer/Program.cs @@ -21,36 +21,31 @@ using System; using System.Diagnostics; using SDL2Sharp; -using SDL2Sharp.Audio; -using SDL2Sharp.Input; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video; using static System.Math; +using static SDL2Sharp.StaticMethods; internal static class Program { public static void Main() { - using var mainSystem = new MainSystem(); - using var videoSubsystem = new VideoSubsystem(); - using var audioSubsystem = new AudioSubsystem(); - using var eventSubsystem = new EventSubsystem(); - using var fontSubsystem = new FontSubsystem(); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles - using var window = videoSubsystem.CreateWindow("Wave Player", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); + using var window = SDL.Video.CreateWindow("Wave Player", 640, 480, WindowFlags.Shown | WindowFlags.Resizable); using var renderer = window.CreateRenderer(RendererFlags.Accelerated | RendererFlags.PresentVSync); - using var lazyFont = fontSubsystem.OpenFont("lazy.ttf", 28); - using var audioFile = audioSubsystem.OpenWaveFile(Environment.GetCommandLineArgs()[1]); + using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); + using var waveFile = SDL.Audio.OpenWaveFile(Environment.GetCommandLineArgs()[1]); var audioPlaybackPosition = 0; - var audioChannelCount = (int)audioFile.Channels; - var audioSampleSize = audioFile.Format.BitSize() / 8; - - using var audioDevice = audioSubsystem.OpenDevice( - audioFile.Frequency, - audioFile.Format, - audioFile.Channels, - audioFile.Samples, + var audioChannelCount = (int)waveFile.Channels; + var audioSampleSize = waveFile.Format.BitSize() / 8; + + using var audioDevice = SDL.Audio.OpenDevice( + waveFile.Frequency, + waveFile.Format, + waveFile.Channels, + waveFile.Samples, OnAudioDeviceCallback, AudioDeviceAllowedChanges.None); @@ -65,7 +60,7 @@ public static void Main() while (true) { - var @event = eventSubsystem.PollEvent(); + var @event = SDL.Events.PollEvent(); if (@event is not null) { switch (@event) @@ -116,9 +111,9 @@ public static void Main() { var y = renderCenterLine; - if (audioSampleOffset < audioFile.Buffer.Length) + if (audioSampleOffset < waveFile.Buffer.Length) { - var normalizedSample = audioFile.Buffer.ToNormalizedSingle(audioSampleOffset, audioFile.Format); + var normalizedSample = waveFile.Buffer.ToNormalizedSingle(audioSampleOffset, waveFile.Format); y = (int)(renderCenterLine + normalizedSample * renderHalfGraphHeight); } @@ -159,14 +154,14 @@ public static void Main() void OnAudioDeviceCallback(Span stream) { - stream.Fill(audioFile.Silence); - var sliceLength = (int)Min(audioFile.Length - audioPlaybackPosition, stream.Length); + stream.Fill(waveFile.Silence); + var sliceLength = (int)Min(waveFile.Length - audioPlaybackPosition, stream.Length); if (sliceLength <= 0) { return; } - var slice = audioFile.Buffer.Slice(audioPlaybackPosition, sliceLength); - stream.MixAudioFormat(slice, audioFile.Format, AudioSubsystem.MixMaxVolume); + var slice = waveFile.Buffer.Slice(audioPlaybackPosition, sliceLength); + MixAudioFormat(stream, slice, waveFile.Format, AudioConstants.MixMaxVolume); audioPlaybackPosition += sliceLength; } } diff --git a/sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs b/sources/SDL2Sharp.Interop/extensions/IMG.Error.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Extensions/IMG.Error.cs rename to sources/SDL2Sharp.Interop/extensions/IMG.Error.cs diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs b/sources/SDL2Sharp.Interop/extensions/SDL.Blit.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Extensions/SDL.Blit.cs rename to sources/SDL2Sharp.Interop/extensions/SDL.Blit.cs diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs b/sources/SDL2Sharp.Interop/extensions/SDL.BlitScaled.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Extensions/SDL.BlitScaled.cs rename to sources/SDL2Sharp.Interop/extensions/SDL.BlitScaled.cs diff --git a/sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs b/sources/SDL2Sharp.Interop/extensions/SDL.BlitSurface.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Extensions/SDL.BlitSurface.cs rename to sources/SDL2Sharp.Interop/extensions/SDL.BlitSurface.cs diff --git a/sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs b/sources/SDL2Sharp.Interop/extensions/TTF.Error.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Extensions/TTF.Error.cs rename to sources/SDL2Sharp.Interop/extensions/TTF.Error.cs diff --git a/sources/SDL2Sharp.Interop/Internals/NativeTypeNameAttribute.cs b/sources/SDL2Sharp.Interop/internals/NativeTypeNameAttribute.cs similarity index 100% rename from sources/SDL2Sharp.Interop/Internals/NativeTypeNameAttribute.cs rename to sources/SDL2Sharp.Interop/internals/NativeTypeNameAttribute.cs diff --git a/sources/SDL2Sharp/Hints.cs b/sources/SDL2Sharp/Hints.cs deleted file mode 100644 index 9f78e8f5..00000000 --- a/sources/SDL2Sharp/Hints.cs +++ /dev/null @@ -1,275 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using SDL2Sharp.Internals; -using SDL2Sharp.Interop; - -namespace SDL2Sharp -{ - public static class Hints - { - public static readonly string FramebufferAcceleration = SDL.SDL_HINT_FRAMEBUFFER_ACCELERATION.AsString(); - - public static readonly string RenderDriver = SDL.SDL_HINT_RENDER_DRIVER.AsString(); - - public static readonly string OpenGlShaders = SDL.SDL_HINT_RENDER_OPENGL_SHADERS.AsString(); - - public static readonly string Direct3DThreadSafe = SDL.SDL_HINT_RENDER_DIRECT3D_THREADSAFE.AsString(); - - public static readonly string Direct3D11Debug = SDL.SDL_HINT_RENDER_DIRECT3D11_DEBUG.AsString(); - - public static readonly string LogicalSizeMode = SDL.SDL_HINT_RENDER_LOGICAL_SIZE_MODE.AsString(); - - public static readonly string RenderScaleQuality = SDL.SDL_HINT_RENDER_SCALE_QUALITY.AsString(); - - public static readonly string RenderVSync = SDL.SDL_HINT_RENDER_VSYNC.AsString(); - - public static readonly string VideoAllowScreensaver = SDL.SDL_HINT_VIDEO_ALLOW_SCREENSAVER.AsString(); - - public static readonly string VideoExternalContext = SDL.SDL_HINT_VIDEO_EXTERNAL_CONTEXT.AsString(); - - public static readonly string VideoX11XVidMode = SDL.SDL_HINT_VIDEO_X11_XVIDMODE.AsString(); - - public static readonly string VideoX11Xinerama = SDL.SDL_HINT_VIDEO_X11_XINERAMA.AsString(); - - public static readonly string VideoX11XRandr = SDL.SDL_HINT_VIDEO_X11_XRANDR.AsString(); - - public static readonly string VideoX11WindowVisualId = SDL.SDL_HINT_VIDEO_X11_WINDOW_VISUALID.AsString(); - - public static readonly string VideoX11NetWmPing = SDL.SDL_HINT_VIDEO_X11_NET_WM_PING.AsString(); - - public static readonly string VideoX11NetWmBypassCompositor = SDL.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR.AsString(); - - public static readonly string VideoX11ForceEgl = SDL.SDL_HINT_VIDEO_X11_FORCE_EGL.AsString(); - - public static readonly string WindowFrameUsableWhileCursorHidden = SDL.SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN.AsString(); - - public static readonly string WindowsIntResourceIcon = SDL.SDL_HINT_WINDOWS_INTRESOURCE_ICON.AsString(); - - public static readonly string WindowsIntResourceIconSmall = SDL.SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL.AsString(); - - public static readonly string WindowsEnableMessageLoop = SDL.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP.AsString(); - - public static readonly string GrabKeyboard = SDL.SDL_HINT_GRAB_KEYBOARD.AsString(); - - public static readonly string MouseDoubleClickTime = SDL.SDL_HINT_MOUSE_DOUBLE_CLICK_TIME.AsString(); - - public static readonly string MouseDoubleClickRadius = SDL.SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS.AsString(); - - public static readonly string MouseNormalSpeedScale = SDL.SDL_HINT_MOUSE_NORMAL_SPEED_SCALE.AsString(); - - public static readonly string MouseRelativeSpeedScale = SDL.SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE.AsString(); - - public static readonly string MouseRelativeScaling = SDL.SDL_HINT_MOUSE_RELATIVE_SCALING.AsString(); - - public static readonly string MouseRelativeModeWarp = SDL.SDL_HINT_MOUSE_RELATIVE_MODE_WARP.AsString(); - - public static readonly string MouseFocusClickThrough = SDL.SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.AsString(); - - public static readonly string TouchMouseEvents = SDL.SDL_HINT_TOUCH_MOUSE_EVENTS.AsString(); - - public static readonly string MouseTouchEvents = SDL.SDL_HINT_MOUSE_TOUCH_EVENTS.AsString(); - - public static readonly string VideoMinimizeOnFocusLoss = SDL.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS.AsString(); - - public static readonly string IdleTimerDisabled = SDL.SDL_HINT_IDLE_TIMER_DISABLED.AsString(); - - public static readonly string Orientations = SDL.SDL_HINT_ORIENTATIONS.AsString(); - - public static readonly string AppleTvControllerUiEvents = SDL.SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.AsString(); - - public static readonly string AppleTvRemoteAllowRotation = SDL.SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.AsString(); - - public static readonly string IosHideHomeIndicator = SDL.SDL_HINT_IOS_HIDE_HOME_INDICATOR.AsString(); - - public static readonly string AccelerometerAsJoystick = SDL.SDL_HINT_ACCELEROMETER_AS_JOYSTICK.AsString(); - - public static readonly string TvRemoveAsJoystick = SDL.SDL_HINT_TV_REMOTE_AS_JOYSTICK.AsString(); - - public static readonly string XInputEnabled = SDL.SDL_HINT_XINPUT_ENABLED.AsString(); - - public static readonly string XInputUseOldJoystickMapping = SDL.SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING.AsString(); - - public static readonly string GameControllerType = SDL.SDL_HINT_GAMECONTROLLERTYPE.AsString(); - - public static readonly string GameControllerConfig = SDL.SDL_HINT_GAMECONTROLLERCONFIG.AsString(); - - public static readonly string GameControllerConfigFile = SDL.SDL_HINT_GAMECONTROLLERCONFIG_FILE.AsString(); - - public static readonly string GameControllerIgnoreDevices = SDL.SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES.AsString(); - - public static readonly string GameControllerIgnoreDevicesExcept = SDL.SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT.AsString(); - - public static readonly string GameControllerUseButtonLabels = SDL.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS.AsString(); - - public static readonly string JoystickAllowBackgroundEvents = SDL.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS.AsString(); - - public static readonly string JoystickHidApi = SDL.SDL_HINT_JOYSTICK_HIDAPI.AsString(); - - public static readonly string JoystickHidApiGameCube = SDL.SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE.AsString(); - - public static readonly string JoystickHidApiJoyCons = SDL.SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS.AsString(); - - public static readonly string JoystickHidApiLuna = SDL.SDL_HINT_JOYSTICK_HIDAPI_LUNA.AsString(); - - public static readonly string JoystickHidApiPS4 = SDL.SDL_HINT_JOYSTICK_HIDAPI_PS4.AsString(); - - public static readonly string JoystickHidApiPS4Rumble = SDL.SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.AsString(); - - public static readonly string JoystickHidApiPS5 = SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5.AsString(); - - public static readonly string JoystickHidApiPS5PlayerLed = SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED.AsString(); - - public static readonly string JoystickHidApiPS5Rumble = SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE.AsString(); - - public static readonly string JoystickHidApiStadia = SDL.SDL_HINT_JOYSTICK_HIDAPI_STADIA.AsString(); - - public static readonly string JoystickHidApiSteam = SDL.SDL_HINT_JOYSTICK_HIDAPI_STEAM.AsString(); - - public static readonly string JoystickHidApiSwitch = SDL.SDL_HINT_JOYSTICK_HIDAPI_SWITCH.AsString(); - - public static readonly string JoystickHidApiSwitchHomeLed = SDL.SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED.AsString(); - - public static readonly string JoystickHidApiXbox = SDL.SDL_HINT_JOYSTICK_HIDAPI_XBOX.AsString(); - - public static readonly string EnableSteamControllers = SDL.SDL_HINT_ENABLE_STEAM_CONTROLLERS.AsString(); - - public static readonly string JoystickRawInput = SDL.SDL_HINT_JOYSTICK_RAWINPUT.AsString(); - - public static readonly string JoystickThread = SDL.SDL_HINT_JOYSTICK_THREAD.AsString(); - - public static readonly string LinuxJoystickDeadzones = SDL.SDL_HINT_LINUX_JOYSTICK_DEADZONES.AsString(); - - public static readonly string AllowTopMost = SDL.SDL_HINT_ALLOW_TOPMOST.AsString(); - - public static readonly string TimerResolution = SDL.SDL_HINT_TIMER_RESOLUTION.AsString(); - - public static readonly string QtWaylandContentOrientation = SDL.SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION.AsString(); - - public static readonly string QtWaylandWindowFlags = SDL.SDL_HINT_QTWAYLAND_WINDOW_FLAGS.AsString(); - - public static readonly string ThreadStackSize = SDL.SDL_HINT_THREAD_STACK_SIZE.AsString(); - - public static readonly string ThreadPriorityPolicy = SDL.SDL_HINT_THREAD_PRIORITY_POLICY.AsString(); - - public static readonly string ThreadForceRealtimeTimeCritical = SDL.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL.AsString(); - - public static readonly string VideoHighDpiDisabled = SDL.SDL_HINT_VIDEO_HIGHDPI_DISABLED.AsString(); - - public static readonly string MacCtrlClickEmulateRightClick = SDL.SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK.AsString(); - - public static readonly string VideoWinD3DCompiler = SDL.SDL_HINT_VIDEO_WIN_D3DCOMPILER.AsString(); - - public static readonly string VideoWindowSharePixelFormat = SDL.SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT.AsString(); - - public static readonly string WinrtPrivacyPolicyUrl = SDL.SDL_HINT_WINRT_PRIVACY_POLICY_URL.AsString(); - - public static readonly string WinrtPrivacyPolicyLabel = SDL.SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.AsString(); - - public static readonly string WinrtHandleBackButton = SDL.SDL_HINT_WINRT_HANDLE_BACK_BUTTON.AsString(); - - public static readonly string VideoMacFullScreenSpaces = SDL.SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES.AsString(); - - public static readonly string MacBackgroundApp = SDL.SDL_HINT_MAC_BACKGROUND_APP.AsString(); - - public static readonly string AndroidApkExpansionMainFileVersion = SDL.SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.AsString(); - - public static readonly string AndroidApkExpansionPatchFileVersion = SDL.SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.AsString(); - - public static readonly string ImeInternalEditing = SDL.SDL_HINT_IME_INTERNAL_EDITING.AsString(); - - public static readonly string AndroidTrapBackButton = SDL.SDL_HINT_ANDROID_TRAP_BACK_BUTTON.AsString(); - - public static readonly string AndroidBlockOnPause = SDL.SDL_HINT_ANDROID_BLOCK_ON_PAUSE.AsString(); - - public static readonly string AndroidBlockOnPausePauseAudio = SDL.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO.AsString(); - - public static readonly string ReturnKeyHidesIme = SDL.SDL_HINT_RETURN_KEY_HIDES_IME.AsString(); - - public static readonly string EmscriptenKeyboardElement = SDL.SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT.AsString(); - - public static readonly string EmscriptenAsyncify = SDL.SDL_HINT_EMSCRIPTEN_ASYNCIFY.AsString(); - - public static readonly string NoSignalHandlers = SDL.SDL_HINT_NO_SIGNAL_HANDLERS.AsString(); - - public static readonly string WindowsNoCloseOnAltF4 = SDL.SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4.AsString(); - - public static readonly string BmpSaveLegacyFormat = SDL.SDL_HINT_BMP_SAVE_LEGACY_FORMAT.AsString(); - - public static readonly string WindowsDisableThreadNaming = SDL.SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING.AsString(); - - public static readonly string RpiVideoLayer = SDL.SDL_HINT_RPI_VIDEO_LAYER.AsString(); - - public static readonly string VideoDoubleBuffer = SDL.SDL_HINT_VIDEO_DOUBLE_BUFFER.AsString(); - - public static readonly string OpenGlEsDriver = SDL.SDL_HINT_OPENGL_ES_DRIVER.AsString(); - - public static readonly string AudioResamplingMode = SDL.SDL_HINT_AUDIO_RESAMPLING_MODE.AsString(); - - public static readonly string AudioCategory = SDL.SDL_HINT_AUDIO_CATEGORY.AsString(); - - public static readonly string RenderBatching = SDL.SDL_HINT_RENDER_BATCHING.AsString(); - - public static readonly string AutoUpdateJoysticks = SDL.SDL_HINT_AUTO_UPDATE_JOYSTICKS.AsString(); - - public static readonly string AutoUpdateSensors = SDL.SDL_HINT_AUTO_UPDATE_SENSORS.AsString(); - - public static readonly string EventLogging = SDL.SDL_HINT_EVENT_LOGGING.AsString(); - - public static readonly string WaveRiffChunkSize = SDL.SDL_HINT_WAVE_RIFF_CHUNK_SIZE.AsString(); - - public static readonly string WaveTruncation = SDL.SDL_HINT_WAVE_TRUNCATION.AsString(); - - public static readonly string WaveFactChunk = SDL.SDL_HINT_WAVE_FACT_CHUNK.AsString(); - - public static readonly string DisplayUsableBounds = SDL.SDL_HINT_DISPLAY_USABLE_BOUNDS.AsString(); - - public static readonly string AudioDeviceAppName = SDL.SDL_HINT_AUDIO_DEVICE_APP_NAME.AsString(); - - public static readonly string AudioDeviceStreamName = SDL.SDL_HINT_AUDIO_DEVICE_STREAM_NAME.AsString(); - - public static readonly string PreferredLocales = SDL.SDL_HINT_PREFERRED_LOCALES.AsString(); - - public static unsafe bool SetValue(string name, string value) - { - using var marshaledName = new MarshaledString(name); - using var marshaledValue = new MarshaledString(value); - return 0 != SDL.SetHint(marshaledName, marshaledValue); - } - - public static unsafe bool SetValue(string name, string value, HintPriority priority) - { - using var marshaledName = new MarshaledString(name); - using var marshaledValue = new MarshaledString(value); - return 0 != SDL.SetHintWithPriority(marshaledName, marshaledValue, (SDL_HintPriority)priority); - } - - public static unsafe string GetValue(string name) - { - using var marshaledName = new MarshaledString(name); - var value = SDL.GetHint(marshaledName); - if (value is null) - { - return null!; - } - return new string(value); - } - } -} diff --git a/sources/SDL2Sharp/Hosting/App.cs b/sources/SDL2Sharp/Hosting/App.cs deleted file mode 100644 index 38c39234..00000000 --- a/sources/SDL2Sharp/Hosting/App.cs +++ /dev/null @@ -1,56 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace SDL2Sharp.Hosting -{ - public sealed class App : IDisposable - { - private readonly ServiceProvider _services; - - private bool _disposed; - - public IServiceProvider Services => _services; - - internal App(ServiceProvider services) - { - _services = services ?? throw new ArgumentNullException(nameof(services)); - } - - public void Dispose() - { - if (_disposed) - { - return; - } - - try - { - _services.Dispose(); - } - finally - { - _disposed = true; - } - } - } -} diff --git a/sources/SDL2Sharp/Hosting/AppBuilder.cs b/sources/SDL2Sharp/Hosting/AppBuilder.cs deleted file mode 100644 index cbb7a7bc..00000000 --- a/sources/SDL2Sharp/Hosting/AppBuilder.cs +++ /dev/null @@ -1,36 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using Microsoft.Extensions.DependencyInjection; - -namespace SDL2Sharp.Hosting -{ - public sealed class AppBuilder - { - private readonly ServiceCollection _services = new(); - - public IServiceCollection Services => _services; - - public App Build() - { - return new App(_services.BuildServiceProvider()); - } - } -} diff --git a/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs b/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs deleted file mode 100644 index 53a66fff..00000000 --- a/sources/SDL2Sharp/Hosting/AppBuilderExtensions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using Microsoft.Extensions.DependencyInjection.Extensions; -using SDL2Sharp.Audio; -using SDL2Sharp.Fonts; -using SDL2Sharp.Input; -using SDL2Sharp.Video; - -namespace SDL2Sharp.Hosting -{ - public static class AppBuilderExtensions - { - public static AppBuilder UseMainSystem(this AppBuilder appBuilder) - { - appBuilder.Services.TryAddSingleton(); - return appBuilder; - } - - public static AppBuilder UseAudioSubsystem(this AppBuilder appBuilder) - { - appBuilder.Services.TryAddSingleton(); - appBuilder.Services.TryAddSingleton(); - return appBuilder; - } - - public static AppBuilder UseVideoSubsystem(this AppBuilder appBuilder) - { - appBuilder.Services.TryAddSingleton(); - appBuilder.Services.TryAddSingleton(); - appBuilder.Services.TryAddSingleton(); - return appBuilder; - } - - public static AppBuilder UseEventSubsystem(this AppBuilder appBuilder) - { - appBuilder.Services.TryAddSingleton(); - appBuilder.Services.TryAddSingleton(); - return appBuilder; - } - - public static AppBuilder UseFontSubsystem(this AppBuilder appBuilder) - { - appBuilder.Services.TryAddSingleton(); - appBuilder.Services.TryAddSingleton(); - return appBuilder; - } - } -} diff --git a/sources/SDL2Sharp/Video/Cursor.cs b/sources/SDL2Sharp/Video/Cursor.cs deleted file mode 100644 index 6899c388..00000000 --- a/sources/SDL2Sharp/Video/Cursor.cs +++ /dev/null @@ -1,45 +0,0 @@ -// SDL2Sharp -// -// Copyright (C) 2021-2024 Ronald van Manen -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -using SDL2Sharp.Interop; - -namespace SDL2Sharp.Video -{ - public static class Cursor - { - public static bool Shown => SDL.SDL_ENABLE == SDL.ShowCursor(SDL.SDL_QUERY); - - public static bool Hidden => SDL.SDL_DISABLE == SDL.ShowCursor(SDL.SDL_QUERY); - - public static bool Show() - { - var result = SDL.ShowCursor(SDL.SDL_ENABLE); - Error.ThrowLastErrorIfNegative(result); - return result == SDL.SDL_ENABLE; - } - - public static bool Hide() - { - var result = SDL.ShowCursor(SDL.SDL_DISABLE); - Error.ThrowLastErrorIfNegative(result); - return result == SDL.SDL_DISABLE; - } - } -} diff --git a/sources/SDL2Sharp/Audio/AudioChannelLayout.cs b/sources/SDL2Sharp/audio/AudioChannelLayout.cs similarity index 97% rename from sources/SDL2Sharp/Audio/AudioChannelLayout.cs rename to sources/SDL2Sharp/audio/AudioChannelLayout.cs index 6242c977..5165d7fd 100644 --- a/sources/SDL2Sharp/Audio/AudioChannelLayout.cs +++ b/sources/SDL2Sharp/audio/AudioChannelLayout.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public enum AudioChannelLayout { diff --git a/sources/SDL2Sharp/IMainSystem.cs b/sources/SDL2Sharp/audio/AudioConstants.cs similarity index 88% rename from sources/SDL2Sharp/IMainSystem.cs rename to sources/SDL2Sharp/audio/AudioConstants.cs index 85c2d70c..be2e731d 100644 --- a/sources/SDL2Sharp/IMainSystem.cs +++ b/sources/SDL2Sharp/audio/AudioConstants.cs @@ -1,4 +1,4 @@ -// SDL2Sharp +// SDL2Sharp // // Copyright (C) 2021-2024 Ronald van Manen // @@ -20,7 +20,8 @@ namespace SDL2Sharp { - public interface IMainSystem + public static class AudioConstants { + public const int MixMaxVolume = Interop.SDL.SDL_MIX_MAXVOLUME; } } diff --git a/sources/SDL2Sharp/Audio/AudioDevice.cs b/sources/SDL2Sharp/audio/AudioDevice.cs similarity index 93% rename from sources/SDL2Sharp/Audio/AudioDevice.cs rename to sources/SDL2Sharp/audio/AudioDevice.cs index 3d5bd964..fe803064 100644 --- a/sources/SDL2Sharp/Audio/AudioDevice.cs +++ b/sources/SDL2Sharp/audio/AudioDevice.cs @@ -23,7 +23,7 @@ using System.Runtime.InteropServices; using SDL2Sharp.Interop; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public sealed unsafe class AudioDevice : IDisposable { @@ -51,7 +51,7 @@ public sealed unsafe class AudioDevice : IDisposable public uint Size { get; private set; } - public AudioStatus Status => (AudioStatus)SDL.GetAudioDeviceStatus(_deviceID); + public AudioStatus Status => (AudioStatus)Interop.SDL.GetAudioDeviceStatus(_deviceID); internal AudioDevice() { } @@ -148,7 +148,7 @@ public bool TryOpen(int frequency, AudioFormat format, AudioChannelLayout channe } var obtainedSpec = new SDL_AudioSpec(); - _deviceID = SDL.OpenAudioDevice(null, 0, &desiredSpec, &obtainedSpec, (int)allowedChanges); + _deviceID = Interop.SDL.OpenAudioDevice(null, 0, &desiredSpec, &obtainedSpec, (int)allowedChanges); if (_deviceID == 0) { error = Error.GetLastError(); @@ -173,7 +173,7 @@ public void Close() if (_deviceID != 0) { - SDL.CloseAudioDevice(_deviceID); + Interop.SDL.CloseAudioDevice(_deviceID); _deviceID = 0; _callback = null!; if (_callbackUserData.IsAllocated) @@ -187,28 +187,28 @@ public void Pause() { ThrowIfDisposed(); ThrowIfClosed(); - SDL.PauseAudioDevice(_deviceID, 1); + Interop.SDL.PauseAudioDevice(_deviceID, 1); } public void Unpause() { ThrowIfDisposed(); ThrowIfClosed(); - SDL.PauseAudioDevice(_deviceID, 0); + Interop.SDL.PauseAudioDevice(_deviceID, 0); } public void Lock() { ThrowIfDisposed(); ThrowIfClosed(); - SDL.LockAudioDevice(_deviceID); + Interop.SDL.LockAudioDevice(_deviceID); } public void Unlock() { ThrowIfDisposed(); ThrowIfClosed(); - SDL.UnlockAudioDevice(_deviceID); + Interop.SDL.UnlockAudioDevice(_deviceID); } public void Queue(Span buffer) @@ -218,7 +218,7 @@ public void Queue(Span buffer) fixed (void* data = &buffer[0]) { Error.ThrowLastErrorIfNegative( - SDL.QueueAudio(_deviceID, data, (uint)buffer.Length) + Interop.SDL.QueueAudio(_deviceID, data, (uint)buffer.Length) ); } } diff --git a/sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs b/sources/SDL2Sharp/audio/AudioDeviceAllowedChanges.cs similarity index 76% rename from sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs rename to sources/SDL2Sharp/audio/AudioDeviceAllowedChanges.cs index 7854d497..51236744 100644 --- a/sources/SDL2Sharp/Audio/AudioDeviceAllowedChanges.cs +++ b/sources/SDL2Sharp/audio/AudioDeviceAllowedChanges.cs @@ -18,19 +18,18 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Interop; using System; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { [Flags] public enum AudioDeviceAllowedChanges { None = 0, - Frequency = SDL.SDL_AUDIO_ALLOW_FREQUENCY_CHANGE, - Format = SDL.SDL_AUDIO_ALLOW_FORMAT_CHANGE, - Channels = SDL.SDL_AUDIO_ALLOW_CHANNELS_CHANGE, - Samples = SDL.SDL_AUDIO_ALLOW_SAMPLES_CHANGE, - Any = SDL.SDL_AUDIO_ALLOW_ANY_CHANGE, + Frequency = Interop.SDL.SDL_AUDIO_ALLOW_FREQUENCY_CHANGE, + Format = Interop.SDL.SDL_AUDIO_ALLOW_FORMAT_CHANGE, + Channels = Interop.SDL.SDL_AUDIO_ALLOW_CHANNELS_CHANGE, + Samples = Interop.SDL.SDL_AUDIO_ALLOW_SAMPLES_CHANGE, + Any = Interop.SDL.SDL_AUDIO_ALLOW_ANY_CHANGE, } } diff --git a/sources/SDL2Sharp/Audio/AudioDeviceCallback.cs b/sources/SDL2Sharp/audio/AudioDeviceCallback.cs similarity index 97% rename from sources/SDL2Sharp/Audio/AudioDeviceCallback.cs rename to sources/SDL2Sharp/audio/AudioDeviceCallback.cs index 41830c9d..0846902e 100644 --- a/sources/SDL2Sharp/Audio/AudioDeviceCallback.cs +++ b/sources/SDL2Sharp/audio/AudioDeviceCallback.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public delegate void AudioDeviceCallback(Span stream); } diff --git a/sources/SDL2Sharp/Audio/AudioFormat.cs b/sources/SDL2Sharp/audio/AudioFormat.cs similarity index 60% rename from sources/SDL2Sharp/Audio/AudioFormat.cs rename to sources/SDL2Sharp/audio/AudioFormat.cs index cfc2d3fc..ec9e9c3a 100644 --- a/sources/SDL2Sharp/Audio/AudioFormat.cs +++ b/sources/SDL2Sharp/audio/AudioFormat.cs @@ -18,31 +18,29 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Interop; - -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public enum AudioFormat : ushort { #pragma warning disable CA1069 // Enums values should not be duplicated - U8 = SDL.AUDIO_U8, - S8 = SDL.AUDIO_S8, - U16LSB = SDL.AUDIO_U16LSB, - S16LSB = SDL.AUDIO_S16LSB, - U16MSB = SDL.AUDIO_U16MSB, - S16MSB = SDL.AUDIO_S16MSB, - U16 = SDL.AUDIO_U16, - S16 = SDL.AUDIO_S16, - S32LSB = SDL.AUDIO_S32LSB, - S32MSB = SDL.AUDIO_S32MSB, - S32 = SDL.AUDIO_S32, - F32LSB = SDL.AUDIO_F32LSB, - F32MSB = SDL.AUDIO_F32MSB, - F32 = SDL.AUDIO_F32, - U16SYS = SDL.AUDIO_U16SYS, - S16SYS = SDL.AUDIO_S16SYS, - S32SYS = SDL.AUDIO_S32SYS, - F32SYS = SDL.AUDIO_F32SYS + U8 = Interop.SDL.AUDIO_U8, + S8 = Interop.SDL.AUDIO_S8, + U16LSB = Interop.SDL.AUDIO_U16LSB, + S16LSB = Interop.SDL.AUDIO_S16LSB, + U16MSB = Interop.SDL.AUDIO_U16MSB, + S16MSB = Interop.SDL.AUDIO_S16MSB, + U16 = Interop.SDL.AUDIO_U16, + S16 = Interop.SDL.AUDIO_S16, + S32LSB = Interop.SDL.AUDIO_S32LSB, + S32MSB = Interop.SDL.AUDIO_S32MSB, + S32 = Interop.SDL.AUDIO_S32, + F32LSB = Interop.SDL.AUDIO_F32LSB, + F32MSB = Interop.SDL.AUDIO_F32MSB, + F32 = Interop.SDL.AUDIO_F32, + U16SYS = Interop.SDL.AUDIO_U16SYS, + S16SYS = Interop.SDL.AUDIO_S16SYS, + S32SYS = Interop.SDL.AUDIO_S32SYS, + F32SYS = Interop.SDL.AUDIO_F32SYS #pragma warning restore CA1069 // Enums values should not be duplicated } } diff --git a/sources/SDL2Sharp/Audio/AudioFormatExtensions.cs b/sources/SDL2Sharp/audio/AudioFormatExtensions.cs similarity index 83% rename from sources/SDL2Sharp/Audio/AudioFormatExtensions.cs rename to sources/SDL2Sharp/audio/AudioFormatExtensions.cs index 8515b08d..7181ca5a 100644 --- a/sources/SDL2Sharp/Audio/AudioFormatExtensions.cs +++ b/sources/SDL2Sharp/audio/AudioFormatExtensions.cs @@ -18,30 +18,28 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Interop; - -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public static class AudioFormatExtensions { public static int BitSize(this AudioFormat format) { - return (ushort)format & SDL.SDL_AUDIO_MASK_BITSIZE; + return (ushort)format & Interop.SDL.SDL_AUDIO_MASK_BITSIZE; } public static bool IsFloat(this AudioFormat format) { - return ((ushort)format & SDL.SDL_AUDIO_MASK_DATATYPE) != 0; + return ((ushort)format & Interop.SDL.SDL_AUDIO_MASK_DATATYPE) != 0; } public static bool IsBigEndian(this AudioFormat format) { - return ((ushort)format & SDL.SDL_AUDIO_MASK_ENDIAN) != 0; + return ((ushort)format & Interop.SDL.SDL_AUDIO_MASK_ENDIAN) != 0; } public static bool IsSigned(this AudioFormat format) { - return ((ushort)format & SDL.SDL_AUDIO_MASK_SIGNED) != 0; + return ((ushort)format & Interop.SDL.SDL_AUDIO_MASK_SIGNED) != 0; } public static bool IsInt(this AudioFormat format) diff --git a/sources/SDL2Sharp/Audio/AudioStatus.cs b/sources/SDL2Sharp/audio/AudioStatus.cs similarity index 97% rename from sources/SDL2Sharp/Audio/AudioStatus.cs rename to sources/SDL2Sharp/audio/AudioStatus.cs index c131ec4e..695d33ae 100644 --- a/sources/SDL2Sharp/Audio/AudioStatus.cs +++ b/sources/SDL2Sharp/audio/AudioStatus.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_AudioStatus; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public enum AudioStatus : ushort { diff --git a/sources/SDL2Sharp/Audio/AudioSubsystem.cs b/sources/SDL2Sharp/audio/AudioSubsystem.cs similarity index 85% rename from sources/SDL2Sharp/Audio/AudioSubsystem.cs rename to sources/SDL2Sharp/audio/AudioSubsystem.cs index 308ae00f..776960f4 100644 --- a/sources/SDL2Sharp/Audio/AudioSubsystem.cs +++ b/sources/SDL2Sharp/audio/AudioSubsystem.cs @@ -19,26 +19,23 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Interop; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { - public sealed class AudioSubsystem : IAudioSubsystem, IDisposable + internal sealed class AudioSubsystem : IAudioSubsystem, IDisposable { - private const uint InitSubsystemFlags = SDL.SDL_INIT_AUDIO; - - public const int MixMaxVolume = SDL.SDL_MIX_MAXVOLUME; + private const uint InitSubsystemFlags = Interop.SDL.SDL_INIT_AUDIO; public AudioSubsystem() { Error.ThrowLastErrorIfNegative( - SDL.InitSubSystem(InitSubsystemFlags) + Interop.SDL.InitSubSystem(InitSubsystemFlags) ); } public void Dispose() { - SDL.QuitSubSystem(InitSubsystemFlags); + Interop.SDL.QuitSubSystem(InitSubsystemFlags); } public AudioDevice CreateDevice() diff --git a/sources/SDL2Sharp/Audio/IAudioSubsystem.cs b/sources/SDL2Sharp/audio/IAudioSubsystem.cs similarity index 98% rename from sources/SDL2Sharp/Audio/IAudioSubsystem.cs rename to sources/SDL2Sharp/audio/IAudioSubsystem.cs index 2182da1d..52ffec67 100644 --- a/sources/SDL2Sharp/Audio/IAudioSubsystem.cs +++ b/sources/SDL2Sharp/audio/IAudioSubsystem.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public interface IAudioSubsystem { diff --git a/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs b/sources/SDL2Sharp/audio/ReadOnlySpanExtensions.cs similarity index 99% rename from sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs rename to sources/SDL2Sharp/audio/ReadOnlySpanExtensions.cs index 8830b1fe..e81de883 100644 --- a/sources/SDL2Sharp/Audio/ReadOnlySpanExtensions.cs +++ b/sources/SDL2Sharp/audio/ReadOnlySpanExtensions.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public static class ReadOnlySpanExtensions { diff --git a/sources/SDL2Sharp/Audio/SpanExtensions.cs b/sources/SDL2Sharp/audio/StaticMethods.cs similarity index 70% rename from sources/SDL2Sharp/Audio/SpanExtensions.cs rename to sources/SDL2Sharp/audio/StaticMethods.cs index 0bc140b4..72f2e116 100644 --- a/sources/SDL2Sharp/Audio/SpanExtensions.cs +++ b/sources/SDL2Sharp/audio/StaticMethods.cs @@ -19,30 +19,29 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Interop; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { - public static class SpanExtensions + public static partial class StaticMethods { - public static unsafe void MixAudioFormat(this Span destination, Span source, AudioFormat format, int volume) + public static unsafe void MixAudioFormat(Span destination, Span source, AudioFormat format, int volume) { fixed (byte* dst = destination) { fixed (byte* src = source) { - SDL.MixAudioFormat(dst, src, (ushort)format, (uint)source.Length, volume); + Interop.SDL.MixAudioFormat(dst, src, (ushort)format, (uint)source.Length, volume); } } } - public static unsafe void MixAudioFormat(this Span destination, ReadOnlySpan source, AudioFormat format, int volume) + public static unsafe void MixAudioFormat(Span destination, ReadOnlySpan source, AudioFormat format, int volume) { fixed (byte* dst = destination) { fixed (byte* src = source) { - SDL.MixAudioFormat(dst, src, (ushort)format, (uint)source.Length, volume); + Interop.SDL.MixAudioFormat(dst, src, (ushort)format, (uint)source.Length, volume); } } } diff --git a/sources/SDL2Sharp/Audio/WaveFile.cs b/sources/SDL2Sharp/audio/WaveFile.cs similarity index 91% rename from sources/SDL2Sharp/Audio/WaveFile.cs rename to sources/SDL2Sharp/audio/WaveFile.cs index cd594afd..3c08da0a 100644 --- a/sources/SDL2Sharp/Audio/WaveFile.cs +++ b/sources/SDL2Sharp/audio/WaveFile.cs @@ -19,10 +19,9 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp.Audio +namespace SDL2Sharp { public sealed unsafe class WaveFile : IDisposable { @@ -53,7 +52,7 @@ internal WaveFile(string filename) using var unmanagedFilename = new MarshaledString(filename); using var unmanagedMode = new MarshaledString("rb"); var fileStream = Error.ThrowLastErrorIfNull( - SDL.RWFromFile(unmanagedFilename, unmanagedMode) + Interop.SDL.RWFromFile(unmanagedFilename, unmanagedMode) ); fixed (SDL_AudioSpec* waveSpec = &_waveSpec) @@ -61,7 +60,7 @@ internal WaveFile(string filename) fixed (uint* waveLength = &_waveLength) { Error.ThrowLastErrorIfNull( - SDL.LoadWAV_RW(fileStream, 1, waveSpec, waveBuffer, waveLength) + Interop.SDL.LoadWAV_RW(fileStream, 1, waveSpec, waveBuffer, waveLength) ); } } @@ -81,7 +80,7 @@ private void Dispose(bool _) { if (_waveBuffer != null) { - SDL.FreeWAV(_waveBuffer); + Interop.SDL.FreeWAV(_waveBuffer); _waveSpec = default; _waveBuffer = null; _waveLength = 0; diff --git a/sources/SDL2Sharp/Error.cs b/sources/SDL2Sharp/basics/Error.cs similarity index 96% rename from sources/SDL2Sharp/Error.cs rename to sources/SDL2Sharp/basics/Error.cs index 58414b3f..16b852c8 100644 --- a/sources/SDL2Sharp/Error.cs +++ b/sources/SDL2Sharp/basics/Error.cs @@ -19,7 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Interop; namespace SDL2Sharp { @@ -37,7 +36,7 @@ public Error(string message, Exception innerException) public static unsafe Error GetLastError() { - return new Error(new string(SDL.GetError())); + return new Error(new string(Interop.SDL.GetError())); } public static void ThrowLastError() diff --git a/sources/SDL2Sharp/basics/Hint.cs b/sources/SDL2Sharp/basics/Hint.cs new file mode 100644 index 00000000..f764604d --- /dev/null +++ b/sources/SDL2Sharp/basics/Hint.cs @@ -0,0 +1,59 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp +{ + public sealed unsafe class Hint + { + private readonly string _name; + + public Hint(string name) + { + _name = name; + } + + public bool SetValue(string value) + { + using var marshaledName = new MarshaledString(_name); + using var marshaledValue = new MarshaledString(value); + return 0 != Interop.SDL.SetHint(marshaledName, marshaledValue); + } + + public bool SetValue(string value, HintPriority priority) + { + using var marshaledName = new MarshaledString(_name); + using var marshaledValue = new MarshaledString(value); + return 0 != Interop.SDL.SetHintWithPriority(marshaledName, marshaledValue, (SDL_HintPriority)priority); + } + + public string GetValue() + { + using var marshaledName = new MarshaledString(_name); + var value = Interop.SDL.GetHint(marshaledName); + if (value is null) + { + return null!; + } + return new string(value); + } + } +} diff --git a/sources/SDL2Sharp/HintPriority.cs b/sources/SDL2Sharp/basics/HintPriority.cs similarity index 100% rename from sources/SDL2Sharp/HintPriority.cs rename to sources/SDL2Sharp/basics/HintPriority.cs diff --git a/sources/SDL2Sharp/basics/Hints.cs b/sources/SDL2Sharp/basics/Hints.cs new file mode 100644 index 00000000..578df610 --- /dev/null +++ b/sources/SDL2Sharp/basics/Hints.cs @@ -0,0 +1,274 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using SDL2Sharp.Interop; + +namespace SDL2Sharp +{ + public static class Hints + { + public static readonly Hint FramebufferAcceleration = new(Interop.SDL.SDL_HINT_FRAMEBUFFER_ACCELERATION.AsString()); + + public static readonly string RenderDriver = Interop.SDL.SDL_HINT_RENDER_DRIVER.AsString(); + + public static readonly string OpenGlShaders = Interop.SDL.SDL_HINT_RENDER_OPENGL_SHADERS.AsString(); + + public static readonly string Direct3DThreadSafe = Interop.SDL.SDL_HINT_RENDER_DIRECT3D_THREADSAFE.AsString(); + + public static readonly string Direct3D11Debug = Interop.SDL.SDL_HINT_RENDER_DIRECT3D11_DEBUG.AsString(); + + public static readonly string LogicalSizeMode = Interop.SDL.SDL_HINT_RENDER_LOGICAL_SIZE_MODE.AsString(); + + public static readonly string RenderScaleQuality = Interop.SDL.SDL_HINT_RENDER_SCALE_QUALITY.AsString(); + + public static readonly string RenderVSync = Interop.SDL.SDL_HINT_RENDER_VSYNC.AsString(); + + public static readonly string VideoAllowScreensaver = Interop.SDL.SDL_HINT_VIDEO_ALLOW_SCREENSAVER.AsString(); + + public static readonly string VideoExternalContext = Interop.SDL.SDL_HINT_VIDEO_EXTERNAL_CONTEXT.AsString(); + + public static readonly string VideoX11XVidMode = Interop.SDL.SDL_HINT_VIDEO_X11_XVIDMODE.AsString(); + + public static readonly string VideoX11Xinerama = Interop.SDL.SDL_HINT_VIDEO_X11_XINERAMA.AsString(); + + public static readonly string VideoX11XRandr = Interop.SDL.SDL_HINT_VIDEO_X11_XRANDR.AsString(); + + public static readonly string VideoX11WindowVisualId = Interop.SDL.SDL_HINT_VIDEO_X11_WINDOW_VISUALID.AsString(); + + public static readonly string VideoX11NetWmPing = Interop.SDL.SDL_HINT_VIDEO_X11_NET_WM_PING.AsString(); + + public static readonly string VideoX11NetWmBypassCompositor = Interop.SDL.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR.AsString(); + + public static readonly string VideoX11ForceEgl = Interop.SDL.SDL_HINT_VIDEO_X11_FORCE_EGL.AsString(); + + public static readonly string WindowFrameUsableWhileCursorHidden = Interop.SDL.SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN.AsString(); + + public static readonly string WindowsIntResourceIcon = Interop.SDL.SDL_HINT_WINDOWS_INTRESOURCE_ICON.AsString(); + + public static readonly string WindowsIntResourceIconSmall = Interop.SDL.SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL.AsString(); + + public static readonly string WindowsEnableMessageLoop = Interop.SDL.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP.AsString(); + + public static readonly string GrabKeyboard = Interop.SDL.SDL_HINT_GRAB_KEYBOARD.AsString(); + + public static readonly string MouseDoubleClickTime = Interop.SDL.SDL_HINT_MOUSE_DOUBLE_CLICK_TIME.AsString(); + + public static readonly string MouseDoubleClickRadius = Interop.SDL.SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS.AsString(); + + public static readonly string MouseNormalSpeedScale = Interop.SDL.SDL_HINT_MOUSE_NORMAL_SPEED_SCALE.AsString(); + + public static readonly string MouseRelativeSpeedScale = Interop.SDL.SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE.AsString(); + + public static readonly string MouseRelativeScaling = Interop.SDL.SDL_HINT_MOUSE_RELATIVE_SCALING.AsString(); + + public static readonly string MouseRelativeModeWarp = Interop.SDL.SDL_HINT_MOUSE_RELATIVE_MODE_WARP.AsString(); + + public static readonly string MouseFocusClickThrough = Interop.SDL.SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.AsString(); + + public static readonly string TouchMouseEvents = Interop.SDL.SDL_HINT_TOUCH_MOUSE_EVENTS.AsString(); + + public static readonly string MouseTouchEvents = Interop.SDL.SDL_HINT_MOUSE_TOUCH_EVENTS.AsString(); + + public static readonly string VideoMinimizeOnFocusLoss = Interop.SDL.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS.AsString(); + + public static readonly string IdleTimerDisabled = Interop.SDL.SDL_HINT_IDLE_TIMER_DISABLED.AsString(); + + public static readonly string Orientations = Interop.SDL.SDL_HINT_ORIENTATIONS.AsString(); + + public static readonly string AppleTvControllerUiEvents = Interop.SDL.SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.AsString(); + + public static readonly string AppleTvRemoteAllowRotation = Interop.SDL.SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.AsString(); + + public static readonly string IosHideHomeIndicator = Interop.SDL.SDL_HINT_IOS_HIDE_HOME_INDICATOR.AsString(); + + public static readonly string AccelerometerAsJoystick = Interop.SDL.SDL_HINT_ACCELEROMETER_AS_JOYSTICK.AsString(); + + public static readonly string TvRemoveAsJoystick = Interop.SDL.SDL_HINT_TV_REMOTE_AS_JOYSTICK.AsString(); + + public static readonly string XInputEnabled = Interop.SDL.SDL_HINT_XINPUT_ENABLED.AsString(); + + public static readonly string XInputUseOldJoystickMapping = Interop.SDL.SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING.AsString(); + + public static readonly string GameControllerType = Interop.SDL.SDL_HINT_GAMECONTROLLERTYPE.AsString(); + + public static readonly string GameControllerConfig = Interop.SDL.SDL_HINT_GAMECONTROLLERCONFIG.AsString(); + + public static readonly string GameControllerConfigFile = Interop.SDL.SDL_HINT_GAMECONTROLLERCONFIG_FILE.AsString(); + + public static readonly string GameControllerIgnoreDevices = Interop.SDL.SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES.AsString(); + + public static readonly string GameControllerIgnoreDevicesExcept = Interop.SDL.SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT.AsString(); + + public static readonly string GameControllerUseButtonLabels = Interop.SDL.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS.AsString(); + + public static readonly string JoystickAllowBackgroundEvents = Interop.SDL.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS.AsString(); + + public static readonly string JoystickHidApi = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI.AsString(); + + public static readonly string JoystickHidApiGameCube = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE.AsString(); + + public static readonly string JoystickHidApiJoyCons = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS.AsString(); + + public static readonly string JoystickHidApiLuna = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_LUNA.AsString(); + + public static readonly string JoystickHidApiPS4 = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_PS4.AsString(); + + public static readonly string JoystickHidApiPS4Rumble = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.AsString(); + + public static readonly string JoystickHidApiPS5 = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5.AsString(); + + public static readonly string JoystickHidApiPS5PlayerLed = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED.AsString(); + + public static readonly string JoystickHidApiPS5Rumble = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE.AsString(); + + public static readonly string JoystickHidApiStadia = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_STADIA.AsString(); + + public static readonly string JoystickHidApiSteam = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_STEAM.AsString(); + + public static readonly string JoystickHidApiSwitch = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_SWITCH.AsString(); + + public static readonly string JoystickHidApiSwitchHomeLed = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED.AsString(); + + public static readonly string JoystickHidApiXbox = Interop.SDL.SDL_HINT_JOYSTICK_HIDAPI_XBOX.AsString(); + + public static readonly string EnableSteamControllers = Interop.SDL.SDL_HINT_ENABLE_STEAM_CONTROLLERS.AsString(); + + public static readonly string JoystickRawInput = Interop.SDL.SDL_HINT_JOYSTICK_RAWINPUT.AsString(); + + public static readonly string JoystickThread = Interop.SDL.SDL_HINT_JOYSTICK_THREAD.AsString(); + + public static readonly string LinuxJoystickDeadzones = Interop.SDL.SDL_HINT_LINUX_JOYSTICK_DEADZONES.AsString(); + + public static readonly string AllowTopMost = Interop.SDL.SDL_HINT_ALLOW_TOPMOST.AsString(); + + public static readonly string TimerResolution = Interop.SDL.SDL_HINT_TIMER_RESOLUTION.AsString(); + + public static readonly string QtWaylandContentOrientation = Interop.SDL.SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION.AsString(); + + public static readonly string QtWaylandWindowFlags = Interop.SDL.SDL_HINT_QTWAYLAND_WINDOW_FLAGS.AsString(); + + public static readonly string ThreadStackSize = Interop.SDL.SDL_HINT_THREAD_STACK_SIZE.AsString(); + + public static readonly string ThreadPriorityPolicy = Interop.SDL.SDL_HINT_THREAD_PRIORITY_POLICY.AsString(); + + public static readonly string ThreadForceRealtimeTimeCritical = Interop.SDL.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL.AsString(); + + public static readonly string VideoHighDpiDisabled = Interop.SDL.SDL_HINT_VIDEO_HIGHDPI_DISABLED.AsString(); + + public static readonly string MacCtrlClickEmulateRightClick = Interop.SDL.SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK.AsString(); + + public static readonly string VideoWinD3DCompiler = Interop.SDL.SDL_HINT_VIDEO_WIN_D3DCOMPILER.AsString(); + + public static readonly string VideoWindowSharePixelFormat = Interop.SDL.SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT.AsString(); + + public static readonly string WinrtPrivacyPolicyUrl = Interop.SDL.SDL_HINT_WINRT_PRIVACY_POLICY_URL.AsString(); + + public static readonly string WinrtPrivacyPolicyLabel = Interop.SDL.SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.AsString(); + + public static readonly string WinrtHandleBackButton = Interop.SDL.SDL_HINT_WINRT_HANDLE_BACK_BUTTON.AsString(); + + public static readonly string VideoMacFullScreenSpaces = Interop.SDL.SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES.AsString(); + + public static readonly string MacBackgroundApp = Interop.SDL.SDL_HINT_MAC_BACKGROUND_APP.AsString(); + + public static readonly string AndroidApkExpansionMainFileVersion = Interop.SDL.SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.AsString(); + + public static readonly string AndroidApkExpansionPatchFileVersion = Interop.SDL.SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.AsString(); + + public static readonly string ImeInternalEditing = Interop.SDL.SDL_HINT_IME_INTERNAL_EDITING.AsString(); + + public static readonly string AndroidTrapBackButton = Interop.SDL.SDL_HINT_ANDROID_TRAP_BACK_BUTTON.AsString(); + + public static readonly string AndroidBlockOnPause = Interop.SDL.SDL_HINT_ANDROID_BLOCK_ON_PAUSE.AsString(); + + public static readonly string AndroidBlockOnPausePauseAudio = Interop.SDL.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO.AsString(); + + public static readonly string ReturnKeyHidesIme = Interop.SDL.SDL_HINT_RETURN_KEY_HIDES_IME.AsString(); + + public static readonly string EmscriptenKeyboardElement = Interop.SDL.SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT.AsString(); + + public static readonly string EmscriptenAsyncify = Interop.SDL.SDL_HINT_EMSCRIPTEN_ASYNCIFY.AsString(); + + public static readonly string NoSignalHandlers = Interop.SDL.SDL_HINT_NO_SIGNAL_HANDLERS.AsString(); + + public static readonly string WindowsNoCloseOnAltF4 = Interop.SDL.SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4.AsString(); + + public static readonly string BmpSaveLegacyFormat = Interop.SDL.SDL_HINT_BMP_SAVE_LEGACY_FORMAT.AsString(); + + public static readonly string WindowsDisableThreadNaming = Interop.SDL.SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING.AsString(); + + public static readonly string RpiVideoLayer = Interop.SDL.SDL_HINT_RPI_VIDEO_LAYER.AsString(); + + public static readonly string VideoDoubleBuffer = Interop.SDL.SDL_HINT_VIDEO_DOUBLE_BUFFER.AsString(); + + public static readonly string OpenGlEsDriver = Interop.SDL.SDL_HINT_OPENGL_ES_DRIVER.AsString(); + + public static readonly string AudioResamplingMode = Interop.SDL.SDL_HINT_AUDIO_RESAMPLING_MODE.AsString(); + + public static readonly string AudioCategory = Interop.SDL.SDL_HINT_AUDIO_CATEGORY.AsString(); + + public static readonly string RenderBatching = Interop.SDL.SDL_HINT_RENDER_BATCHING.AsString(); + + public static readonly string AutoUpdateJoysticks = Interop.SDL.SDL_HINT_AUTO_UPDATE_JOYSTICKS.AsString(); + + public static readonly string AutoUpdateSensors = Interop.SDL.SDL_HINT_AUTO_UPDATE_SENSORS.AsString(); + + public static readonly string EventLogging = Interop.SDL.SDL_HINT_EVENT_LOGGING.AsString(); + + public static readonly string WaveRiffChunkSize = Interop.SDL.SDL_HINT_WAVE_RIFF_CHUNK_SIZE.AsString(); + + public static readonly string WaveTruncation = Interop.SDL.SDL_HINT_WAVE_TRUNCATION.AsString(); + + public static readonly string WaveFactChunk = Interop.SDL.SDL_HINT_WAVE_FACT_CHUNK.AsString(); + + public static readonly string DisplayUsableBounds = Interop.SDL.SDL_HINT_DISPLAY_USABLE_BOUNDS.AsString(); + + public static readonly string AudioDeviceAppName = Interop.SDL.SDL_HINT_AUDIO_DEVICE_APP_NAME.AsString(); + + public static readonly string AudioDeviceStreamName = Interop.SDL.SDL_HINT_AUDIO_DEVICE_STREAM_NAME.AsString(); + + public static readonly string PreferredLocales = Interop.SDL.SDL_HINT_PREFERRED_LOCALES.AsString(); + + public static unsafe bool SetValue(string name, string value) + { + using var marshaledName = new MarshaledString(name); + using var marshaledValue = new MarshaledString(value); + return 0 != Interop.SDL.SetHint(marshaledName, marshaledValue); + } + + public static unsafe bool SetValue(string name, string value, HintPriority priority) + { + using var marshaledName = new MarshaledString(name); + using var marshaledValue = new MarshaledString(value); + return 0 != Interop.SDL.SetHintWithPriority(marshaledName, marshaledValue, (SDL_HintPriority)priority); + } + + public static unsafe string GetValue(string name) + { + using var marshaledName = new MarshaledString(name); + var value = Interop.SDL.GetHint(marshaledName); + if (value is null) + { + return null!; + } + return new string(value); + } + } +} diff --git a/sources/SDL2Sharp/basics/SDL.cs b/sources/SDL2Sharp/basics/SDL.cs new file mode 100644 index 00000000..df0c1b91 --- /dev/null +++ b/sources/SDL2Sharp/basics/SDL.cs @@ -0,0 +1,92 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp +{ + public sealed class SDL : IDisposable + { + private VideoSubsystem? _videoSubsystem; + + private AudioSubsystem? _audioSubsystem; + + private EventsSubsystem? _eventsSubsystem; + + private FontSubsystem? _fontSubsystem; + + private bool _disposed = false; + + public IVideoSubsystem Video => _videoSubsystem ??= new VideoSubsystem(); + + public IAudioSubsystem Audio => _audioSubsystem ??= new AudioSubsystem(); + + public IEventsSubsystem Events => _eventsSubsystem ??= new EventsSubsystem(); + + public IFontSubsystem Fonts => _fontSubsystem ??= new FontSubsystem(); + + public bool IsDisposed => _disposed; + + public SDL() + { + Error.ThrowLastErrorIfNegative( + Interop.SDL.Init(0) + ); + } + + ~SDL() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (_disposed) + { + return; + } + + if (disposing) + { + SafeDispose(ref _videoSubsystem); + SafeDispose(ref _audioSubsystem); + SafeDispose(ref _eventsSubsystem); + SafeDispose(ref _fontSubsystem); + } + + Interop.SDL.Quit(); + + _disposed = true; + } + + private static void SafeDispose(ref TDisposable? disposable) where TDisposable : IDisposable + { + var temp = disposable; + disposable = default; + temp?.Dispose(); + } + } +} diff --git a/sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs b/sources/SDL2Sharp/events/AppDidEnterBackgroundEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs rename to sources/SDL2Sharp/events/AppDidEnterBackgroundEvent.cs index 682c0242..d2eda2da 100644 --- a/sources/SDL2Sharp/Input/AppDidEnterBackgroundEvent.cs +++ b/sources/SDL2Sharp/events/AppDidEnterBackgroundEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppDidEnterBackgroundEvent : Event { diff --git a/sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs b/sources/SDL2Sharp/events/AppDidEnterForegroundEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs rename to sources/SDL2Sharp/events/AppDidEnterForegroundEvent.cs index 7d2bbd6c..20a0102e 100644 --- a/sources/SDL2Sharp/Input/AppDidEnterForegroundEvent.cs +++ b/sources/SDL2Sharp/events/AppDidEnterForegroundEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppDidEnterForegroundEvent : Event { diff --git a/sources/SDL2Sharp/Input/AppLowMemoryEvent.cs b/sources/SDL2Sharp/events/AppLowMemoryEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppLowMemoryEvent.cs rename to sources/SDL2Sharp/events/AppLowMemoryEvent.cs index 77d31435..abbc07fe 100644 --- a/sources/SDL2Sharp/Input/AppLowMemoryEvent.cs +++ b/sources/SDL2Sharp/events/AppLowMemoryEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppLowMemoryEvent : Event { diff --git a/sources/SDL2Sharp/Input/AppTerminatingEvent.cs b/sources/SDL2Sharp/events/AppTerminatingEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppTerminatingEvent.cs rename to sources/SDL2Sharp/events/AppTerminatingEvent.cs index d568876d..db939c74 100644 --- a/sources/SDL2Sharp/Input/AppTerminatingEvent.cs +++ b/sources/SDL2Sharp/events/AppTerminatingEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppTerminatingEvent : Event { diff --git a/sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs b/sources/SDL2Sharp/events/AppWillEnterBackgroundEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs rename to sources/SDL2Sharp/events/AppWillEnterBackgroundEvent.cs index d23f4f10..e86ab8c2 100644 --- a/sources/SDL2Sharp/Input/AppWillEnterBackgroundEvent.cs +++ b/sources/SDL2Sharp/events/AppWillEnterBackgroundEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppWillEnterBackgroundEvent : Event { diff --git a/sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs b/sources/SDL2Sharp/events/AppWillEnterForegroundEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs rename to sources/SDL2Sharp/events/AppWillEnterForegroundEvent.cs index c1ba7d69..77ea0e2b 100644 --- a/sources/SDL2Sharp/Input/AppWillEnterForegroundEvent.cs +++ b/sources/SDL2Sharp/events/AppWillEnterForegroundEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AppWillEnterForegroundEvent : Event { diff --git a/sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs b/sources/SDL2Sharp/events/AudioDeviceAddedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs rename to sources/SDL2Sharp/events/AudioDeviceAddedEvent.cs index 8da7ee75..88b1ecb7 100644 --- a/sources/SDL2Sharp/Input/AudioDeviceAddedEvent.cs +++ b/sources/SDL2Sharp/events/AudioDeviceAddedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AudioDeviceAddedEvent : Event { diff --git a/sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs b/sources/SDL2Sharp/events/AudioDeviceRemovedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs rename to sources/SDL2Sharp/events/AudioDeviceRemovedEvent.cs index 4408991a..c46876bf 100644 --- a/sources/SDL2Sharp/Input/AudioDeviceRemovedEvent.cs +++ b/sources/SDL2Sharp/events/AudioDeviceRemovedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class AudioDeviceRemovedEvent : Event { diff --git a/sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs b/sources/SDL2Sharp/events/ClipboardUpdateEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs rename to sources/SDL2Sharp/events/ClipboardUpdateEvent.cs index 5dd4f4d3..61f2b39c 100644 --- a/sources/SDL2Sharp/Input/ClipboardUpdateEvent.cs +++ b/sources/SDL2Sharp/events/ClipboardUpdateEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ClipboardUpdateEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs b/sources/SDL2Sharp/events/ControllerAxisMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs rename to sources/SDL2Sharp/events/ControllerAxisMotionEvent.cs index 0afe2c71..0f830035 100644 --- a/sources/SDL2Sharp/Input/ControllerAxisMotionEvent.cs +++ b/sources/SDL2Sharp/events/ControllerAxisMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerAxisMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs b/sources/SDL2Sharp/events/ControllerButtonDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs rename to sources/SDL2Sharp/events/ControllerButtonDownEvent.cs index 56309030..40b717bb 100644 --- a/sources/SDL2Sharp/Input/ControllerButtonDownEvent.cs +++ b/sources/SDL2Sharp/events/ControllerButtonDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerButtonDownEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs b/sources/SDL2Sharp/events/ControllerButtonUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs rename to sources/SDL2Sharp/events/ControllerButtonUpEvent.cs index 7c52b7e2..ef5a389a 100644 --- a/sources/SDL2Sharp/Input/ControllerButtonUpEvent.cs +++ b/sources/SDL2Sharp/events/ControllerButtonUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerButtonUpEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs b/sources/SDL2Sharp/events/ControllerDeviceAddedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs rename to sources/SDL2Sharp/events/ControllerDeviceAddedEvent.cs index 90235834..4043ded7 100644 --- a/sources/SDL2Sharp/Input/ControllerDeviceAddedEvent.cs +++ b/sources/SDL2Sharp/events/ControllerDeviceAddedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerDeviceAddedEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs b/sources/SDL2Sharp/events/ControllerDeviceRemappedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs rename to sources/SDL2Sharp/events/ControllerDeviceRemappedEvent.cs index f06099ed..9222af99 100644 --- a/sources/SDL2Sharp/Input/ControllerDeviceRemappedEvent.cs +++ b/sources/SDL2Sharp/events/ControllerDeviceRemappedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerDeviceRemappedEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs b/sources/SDL2Sharp/events/ControllerDeviceRemovedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs rename to sources/SDL2Sharp/events/ControllerDeviceRemovedEvent.cs index 421cc318..e69dd5fd 100644 --- a/sources/SDL2Sharp/Input/ControllerDeviceRemovedEvent.cs +++ b/sources/SDL2Sharp/events/ControllerDeviceRemovedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerDeviceRemovedEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs b/sources/SDL2Sharp/events/ControllerSensorUpdateEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs rename to sources/SDL2Sharp/events/ControllerSensorUpdateEvent.cs index d2b3c386..ec763f42 100644 --- a/sources/SDL2Sharp/Input/ControllerSensorUpdateEvent.cs +++ b/sources/SDL2Sharp/events/ControllerSensorUpdateEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerSensorUpdateEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs b/sources/SDL2Sharp/events/ControllerTouchpadDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs rename to sources/SDL2Sharp/events/ControllerTouchpadDownEvent.cs index fe3069cd..cdcc65ed 100644 --- a/sources/SDL2Sharp/Input/ControllerTouchpadDownEvent.cs +++ b/sources/SDL2Sharp/events/ControllerTouchpadDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerTouchpadDownEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs b/sources/SDL2Sharp/events/ControllerTouchpadMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs rename to sources/SDL2Sharp/events/ControllerTouchpadMotionEvent.cs index c06468c7..3e1470cb 100644 --- a/sources/SDL2Sharp/Input/ControllerTouchpadMotionEvent.cs +++ b/sources/SDL2Sharp/events/ControllerTouchpadMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerTouchpadMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs b/sources/SDL2Sharp/events/ControllerTouchpadUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs rename to sources/SDL2Sharp/events/ControllerTouchpadUpEvent.cs index d518f77e..a8eb4f24 100644 --- a/sources/SDL2Sharp/Input/ControllerTouchpadUpEvent.cs +++ b/sources/SDL2Sharp/events/ControllerTouchpadUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class ControllerTouchpadUpEvent : Event { diff --git a/sources/SDL2Sharp/Input/DisplayEvent.cs b/sources/SDL2Sharp/events/DisplayEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DisplayEvent.cs rename to sources/SDL2Sharp/events/DisplayEvent.cs index 8bc2fedc..f88d7af4 100644 --- a/sources/SDL2Sharp/Input/DisplayEvent.cs +++ b/sources/SDL2Sharp/events/DisplayEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DisplayEvent : Event { diff --git a/sources/SDL2Sharp/Input/DollarGestureEvent.cs b/sources/SDL2Sharp/events/DollarGestureEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DollarGestureEvent.cs rename to sources/SDL2Sharp/events/DollarGestureEvent.cs index 8fbdcc9e..1697f05e 100644 --- a/sources/SDL2Sharp/Input/DollarGestureEvent.cs +++ b/sources/SDL2Sharp/events/DollarGestureEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DollarGestureEvent : Event { diff --git a/sources/SDL2Sharp/Input/DollarRecordEvent.cs b/sources/SDL2Sharp/events/DollarRecordEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DollarRecordEvent.cs rename to sources/SDL2Sharp/events/DollarRecordEvent.cs index 424c93b9..afba41c3 100644 --- a/sources/SDL2Sharp/Input/DollarRecordEvent.cs +++ b/sources/SDL2Sharp/events/DollarRecordEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DollarRecordEvent : Event { diff --git a/sources/SDL2Sharp/Input/DropBeginEvent.cs b/sources/SDL2Sharp/events/DropBeginEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DropBeginEvent.cs rename to sources/SDL2Sharp/events/DropBeginEvent.cs index c71e8370..7da34d55 100644 --- a/sources/SDL2Sharp/Input/DropBeginEvent.cs +++ b/sources/SDL2Sharp/events/DropBeginEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DropBeginEvent : Event { diff --git a/sources/SDL2Sharp/Input/DropCompleteEvent.cs b/sources/SDL2Sharp/events/DropCompleteEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DropCompleteEvent.cs rename to sources/SDL2Sharp/events/DropCompleteEvent.cs index d1afc50d..5e7ff6fd 100644 --- a/sources/SDL2Sharp/Input/DropCompleteEvent.cs +++ b/sources/SDL2Sharp/events/DropCompleteEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DropCompleteEvent : Event { diff --git a/sources/SDL2Sharp/Input/DropFileEvent.cs b/sources/SDL2Sharp/events/DropFileEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DropFileEvent.cs rename to sources/SDL2Sharp/events/DropFileEvent.cs index a90c3d69..136cf628 100644 --- a/sources/SDL2Sharp/Input/DropFileEvent.cs +++ b/sources/SDL2Sharp/events/DropFileEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DropFileEvent : Event { diff --git a/sources/SDL2Sharp/Input/DropTextEvent.cs b/sources/SDL2Sharp/events/DropTextEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/DropTextEvent.cs rename to sources/SDL2Sharp/events/DropTextEvent.cs index bb61f8bd..aab2e4cc 100644 --- a/sources/SDL2Sharp/Input/DropTextEvent.cs +++ b/sources/SDL2Sharp/events/DropTextEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class DropTextEvent : Event { diff --git a/sources/SDL2Sharp/Input/Event.cs b/sources/SDL2Sharp/events/Event.cs similarity index 97% rename from sources/SDL2Sharp/Input/Event.cs rename to sources/SDL2Sharp/events/Event.cs index bde9a570..47195c02 100644 --- a/sources/SDL2Sharp/Input/Event.cs +++ b/sources/SDL2Sharp/events/Event.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public abstract class Event { diff --git a/sources/SDL2Sharp/Input/EventSubsystem.cs b/sources/SDL2Sharp/events/EventsSubsystem.cs similarity index 94% rename from sources/SDL2Sharp/Input/EventSubsystem.cs rename to sources/SDL2Sharp/events/EventsSubsystem.cs index c2fa0dff..787dd2d6 100644 --- a/sources/SDL2Sharp/Input/EventSubsystem.cs +++ b/sources/SDL2Sharp/events/EventsSubsystem.cs @@ -24,47 +24,47 @@ using System.Runtime.InteropServices; using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { - public sealed unsafe class EventSubsystem : IEventSubsystem, IDisposable + internal sealed unsafe class EventsSubsystem : IEventsSubsystem, IDisposable { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int EventWatchCallbackDelegate(void* userdata, SDL_Event* @event); - private const uint InitSubsystemFlags = SDL.SDL_INIT_EVENTS; + private const uint InitSubsystemFlags = Interop.SDL.SDL_INIT_EVENTS; private GCHandle _watchCallbackUserData = default; private readonly HashSet> _watchCallbacks = []; - public EventSubsystem() + public EventsSubsystem() { Error.ThrowLastErrorIfNegative( - SDL.InitSubSystem(InitSubsystemFlags) + Interop.SDL.InitSubSystem(InitSubsystemFlags) ); _watchCallbackUserData = GCHandle.Alloc(this, GCHandleType.Normal); var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; - SDL.AddEventWatch(&OnEventWatchCallback, watchUserDataPointer); + Interop.SDL.AddEventWatch(&OnEventWatchCallback, watchUserDataPointer); } public void Dispose() { var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; - SDL.DelEventWatch(&OnEventWatchCallback, watchUserDataPointer); + Interop.SDL.DelEventWatch(&OnEventWatchCallback, watchUserDataPointer); if (_watchCallbackUserData.IsAllocated) { _watchCallbackUserData.Free(); } - SDL.QuitSubSystem(InitSubsystemFlags); + Interop.SDL.QuitSubSystem(InitSubsystemFlags); } public Event? PollEvent() { var @event = new SDL_Event(); - if (SDL.PollEvent(&@event) == 0) + if (Interop.SDL.PollEvent(&@event) == 0) { return null; } @@ -74,11 +74,10 @@ public void Dispose() public void PushEvent(Event @event) { var eventHandle = @event.Handle; - var result = SDL.PushEvent(&@eventHandle); + var result = Interop.SDL.PushEvent(&eventHandle); Error.ThrowLastErrorIfNegative(result); } - public void AddWatch(Action callback) { _watchCallbacks.Add(callback); @@ -263,7 +262,7 @@ private void OnEventWatchCallback(Event @event) private static int OnEventWatchCallback(void* userdata, SDL_Event* @event) { var eventSubsystemHandle = GCHandle.FromIntPtr((IntPtr)userdata); - if (eventSubsystemHandle.Target is EventSubsystem eventSubsystem) + if (eventSubsystemHandle.Target is EventsSubsystem eventSubsystem) { eventSubsystem.OnEventWatchCallback(WrapEvent(*@event)); } diff --git a/sources/SDL2Sharp/Input/FingerDownEvent.cs b/sources/SDL2Sharp/events/FingerDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/FingerDownEvent.cs rename to sources/SDL2Sharp/events/FingerDownEvent.cs index c2a7bd22..3d928441 100644 --- a/sources/SDL2Sharp/Input/FingerDownEvent.cs +++ b/sources/SDL2Sharp/events/FingerDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class FingerDownEvent : Event { diff --git a/sources/SDL2Sharp/Input/FingerMotionEvent.cs b/sources/SDL2Sharp/events/FingerMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/FingerMotionEvent.cs rename to sources/SDL2Sharp/events/FingerMotionEvent.cs index b5c4ead6..8580e75f 100644 --- a/sources/SDL2Sharp/Input/FingerMotionEvent.cs +++ b/sources/SDL2Sharp/events/FingerMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class FingerMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/FingerUpEvent.cs b/sources/SDL2Sharp/events/FingerUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/FingerUpEvent.cs rename to sources/SDL2Sharp/events/FingerUpEvent.cs index 9cad90cc..5295359c 100644 --- a/sources/SDL2Sharp/Input/FingerUpEvent.cs +++ b/sources/SDL2Sharp/events/FingerUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class FingerUpEvent : Event { diff --git a/sources/SDL2Sharp/Input/IEventSubsystem.cs b/sources/SDL2Sharp/events/IEventsSubsystem.cs similarity index 94% rename from sources/SDL2Sharp/Input/IEventSubsystem.cs rename to sources/SDL2Sharp/events/IEventsSubsystem.cs index 28a4728e..e6084ae1 100644 --- a/sources/SDL2Sharp/Input/IEventSubsystem.cs +++ b/sources/SDL2Sharp/events/IEventsSubsystem.cs @@ -20,13 +20,16 @@ using System; -namespace SDL2Sharp.Input +namespace SDL2Sharp { - public interface IEventSubsystem + public interface IEventsSubsystem { void AddWatch(Action callback); + void DeleteWatch(Action callback); + Event? PollEvent(); + void PushEvent(Event @event); } -} \ No newline at end of file +} diff --git a/sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs b/sources/SDL2Sharp/events/JoystickAxisMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs rename to sources/SDL2Sharp/events/JoystickAxisMotionEvent.cs index 980fe582..24aa3e73 100644 --- a/sources/SDL2Sharp/Input/JoystickAxisMotionEvent.cs +++ b/sources/SDL2Sharp/events/JoystickAxisMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickAxisMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs b/sources/SDL2Sharp/events/JoystickBallMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs rename to sources/SDL2Sharp/events/JoystickBallMotionEvent.cs index 159f6c7b..6b400a47 100644 --- a/sources/SDL2Sharp/Input/JoystickBallMotionEvent.cs +++ b/sources/SDL2Sharp/events/JoystickBallMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickBallMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs b/sources/SDL2Sharp/events/JoystickBatteryUpdatedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs rename to sources/SDL2Sharp/events/JoystickBatteryUpdatedEvent.cs index 467704b7..dbeb09cb 100644 --- a/sources/SDL2Sharp/Input/JoystickBatteryUpdatedEvent.cs +++ b/sources/SDL2Sharp/events/JoystickBatteryUpdatedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickBatteryUpdatedEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs b/sources/SDL2Sharp/events/JoystickButtonDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs rename to sources/SDL2Sharp/events/JoystickButtonDownEvent.cs index 748fe569..5ee0d482 100644 --- a/sources/SDL2Sharp/Input/JoystickButtonDownEvent.cs +++ b/sources/SDL2Sharp/events/JoystickButtonDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickButtonDownEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs b/sources/SDL2Sharp/events/JoystickButtonUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs rename to sources/SDL2Sharp/events/JoystickButtonUpEvent.cs index 9901951b..955bc480 100644 --- a/sources/SDL2Sharp/Input/JoystickButtonUpEvent.cs +++ b/sources/SDL2Sharp/events/JoystickButtonUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickButtonUpEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs b/sources/SDL2Sharp/events/JoystickDeviceAddedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs rename to sources/SDL2Sharp/events/JoystickDeviceAddedEvent.cs index 716a258a..ce3c06c1 100644 --- a/sources/SDL2Sharp/Input/JoystickDeviceAddedEvent.cs +++ b/sources/SDL2Sharp/events/JoystickDeviceAddedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickDeviceAddedEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs b/sources/SDL2Sharp/events/JoystickDeviceRemovedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs rename to sources/SDL2Sharp/events/JoystickDeviceRemovedEvent.cs index 165c5773..5b715a30 100644 --- a/sources/SDL2Sharp/Input/JoystickDeviceRemovedEvent.cs +++ b/sources/SDL2Sharp/events/JoystickDeviceRemovedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickDeviceRemovedEvent : Event { diff --git a/sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs b/sources/SDL2Sharp/events/JoystickHatMotionEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs rename to sources/SDL2Sharp/events/JoystickHatMotionEvent.cs index 8c705ccf..2143eb00 100644 --- a/sources/SDL2Sharp/Input/JoystickHatMotionEvent.cs +++ b/sources/SDL2Sharp/events/JoystickHatMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class JoystickHatMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/KeyDownEvent.cs b/sources/SDL2Sharp/events/KeyDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/KeyDownEvent.cs rename to sources/SDL2Sharp/events/KeyDownEvent.cs index 995822da..7ab167cc 100644 --- a/sources/SDL2Sharp/Input/KeyDownEvent.cs +++ b/sources/SDL2Sharp/events/KeyDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class KeyDownEvent : KeyboardEvent { diff --git a/sources/SDL2Sharp/Input/KeyMapChangedEvent.cs b/sources/SDL2Sharp/events/KeyMapChangedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/KeyMapChangedEvent.cs rename to sources/SDL2Sharp/events/KeyMapChangedEvent.cs index 3887ed8c..844f2019 100644 --- a/sources/SDL2Sharp/Input/KeyMapChangedEvent.cs +++ b/sources/SDL2Sharp/events/KeyMapChangedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class KeyMapChangedEvent : Event { diff --git a/sources/SDL2Sharp/Input/KeyModifiers.cs b/sources/SDL2Sharp/events/KeyModifiers.cs similarity index 98% rename from sources/SDL2Sharp/Input/KeyModifiers.cs rename to sources/SDL2Sharp/events/KeyModifiers.cs index 19057ba3..394d9e00 100644 --- a/sources/SDL2Sharp/Input/KeyModifiers.cs +++ b/sources/SDL2Sharp/events/KeyModifiers.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { [Flags] public enum KeyModifiers diff --git a/sources/SDL2Sharp/Input/KeyUpEvent.cs b/sources/SDL2Sharp/events/KeyUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/KeyUpEvent.cs rename to sources/SDL2Sharp/events/KeyUpEvent.cs index 1cb30564..2adb2dcb 100644 --- a/sources/SDL2Sharp/Input/KeyUpEvent.cs +++ b/sources/SDL2Sharp/events/KeyUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class KeyUpEvent : KeyboardEvent { diff --git a/sources/SDL2Sharp/Input/KeyboardEvent.cs b/sources/SDL2Sharp/events/KeyboardEvent.cs similarity index 98% rename from sources/SDL2Sharp/Input/KeyboardEvent.cs rename to sources/SDL2Sharp/events/KeyboardEvent.cs index 54731dfa..dcc63d2d 100644 --- a/sources/SDL2Sharp/Input/KeyboardEvent.cs +++ b/sources/SDL2Sharp/events/KeyboardEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public abstract class KeyboardEvent : Event { diff --git a/sources/SDL2Sharp/Input/LocaleChangedEvent.cs b/sources/SDL2Sharp/events/LocaleChangedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/LocaleChangedEvent.cs rename to sources/SDL2Sharp/events/LocaleChangedEvent.cs index 1937e221..69104792 100644 --- a/sources/SDL2Sharp/Input/LocaleChangedEvent.cs +++ b/sources/SDL2Sharp/events/LocaleChangedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class LocaleChangedEvent : Event { diff --git a/sources/SDL2Sharp/Input/MouseButtonDownEvent.cs b/sources/SDL2Sharp/events/MouseButtonDownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/MouseButtonDownEvent.cs rename to sources/SDL2Sharp/events/MouseButtonDownEvent.cs index d5074220..ede9745a 100644 --- a/sources/SDL2Sharp/Input/MouseButtonDownEvent.cs +++ b/sources/SDL2Sharp/events/MouseButtonDownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class MouseButtonDownEvent : Event { diff --git a/sources/SDL2Sharp/Input/MouseButtonUpEvent.cs b/sources/SDL2Sharp/events/MouseButtonUpEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/MouseButtonUpEvent.cs rename to sources/SDL2Sharp/events/MouseButtonUpEvent.cs index e6de3402..18f22368 100644 --- a/sources/SDL2Sharp/Input/MouseButtonUpEvent.cs +++ b/sources/SDL2Sharp/events/MouseButtonUpEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class MouseButtonUpEvent : Event { diff --git a/sources/SDL2Sharp/Input/MouseMotionEvent.cs b/sources/SDL2Sharp/events/MouseMotionEvent.cs similarity index 98% rename from sources/SDL2Sharp/Input/MouseMotionEvent.cs rename to sources/SDL2Sharp/events/MouseMotionEvent.cs index 54192770..26743356 100644 --- a/sources/SDL2Sharp/Input/MouseMotionEvent.cs +++ b/sources/SDL2Sharp/events/MouseMotionEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class MouseMotionEvent : Event { diff --git a/sources/SDL2Sharp/Input/MouseWheelDirection.cs b/sources/SDL2Sharp/events/MouseWheelDirection.cs similarity index 97% rename from sources/SDL2Sharp/Input/MouseWheelDirection.cs rename to sources/SDL2Sharp/events/MouseWheelDirection.cs index a41931dd..dbec458e 100644 --- a/sources/SDL2Sharp/Input/MouseWheelDirection.cs +++ b/sources/SDL2Sharp/events/MouseWheelDirection.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_MouseWheelDirection; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public enum MouseWheelDirection { diff --git a/sources/SDL2Sharp/Input/MouseWheelEvent.cs b/sources/SDL2Sharp/events/MouseWheelEvent.cs similarity index 98% rename from sources/SDL2Sharp/Input/MouseWheelEvent.cs rename to sources/SDL2Sharp/events/MouseWheelEvent.cs index a3fc30f5..a2d6cff4 100644 --- a/sources/SDL2Sharp/Input/MouseWheelEvent.cs +++ b/sources/SDL2Sharp/events/MouseWheelEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class MouseWheelEvent : Event { diff --git a/sources/SDL2Sharp/Input/MultiGestureEvent.cs b/sources/SDL2Sharp/events/MultiGestureEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/MultiGestureEvent.cs rename to sources/SDL2Sharp/events/MultiGestureEvent.cs index ed48740f..99f6dc2a 100644 --- a/sources/SDL2Sharp/Input/MultiGestureEvent.cs +++ b/sources/SDL2Sharp/events/MultiGestureEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class MultiGestureEvent : Event { diff --git a/sources/SDL2Sharp/Input/PollSentinelEvent.cs b/sources/SDL2Sharp/events/PollSentinelEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/PollSentinelEvent.cs rename to sources/SDL2Sharp/events/PollSentinelEvent.cs index fc6045de..129e1491 100644 --- a/sources/SDL2Sharp/Input/PollSentinelEvent.cs +++ b/sources/SDL2Sharp/events/PollSentinelEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class PollSentinelEvent : Event { diff --git a/sources/SDL2Sharp/Input/QuitEvent.cs b/sources/SDL2Sharp/events/QuitEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/QuitEvent.cs rename to sources/SDL2Sharp/events/QuitEvent.cs index 46a20b0e..f6c62013 100644 --- a/sources/SDL2Sharp/Input/QuitEvent.cs +++ b/sources/SDL2Sharp/events/QuitEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class QuitEvent : Event { diff --git a/sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs b/sources/SDL2Sharp/events/RenderDeviceResetEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs rename to sources/SDL2Sharp/events/RenderDeviceResetEvent.cs index 66adeb3f..930028f5 100644 --- a/sources/SDL2Sharp/Input/RenderDeviceResetEvent.cs +++ b/sources/SDL2Sharp/events/RenderDeviceResetEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class RenderDeviceResetEvent : Event { diff --git a/sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs b/sources/SDL2Sharp/events/RenderTargetsResetEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs rename to sources/SDL2Sharp/events/RenderTargetsResetEvent.cs index 988784bf..ba47a551 100644 --- a/sources/SDL2Sharp/Input/RenderTargetsResetEvent.cs +++ b/sources/SDL2Sharp/events/RenderTargetsResetEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class RenderTargetsResetEvent : Event { diff --git a/sources/SDL2Sharp/Input/SensorUpdateEvent.cs b/sources/SDL2Sharp/events/SensorUpdateEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/SensorUpdateEvent.cs rename to sources/SDL2Sharp/events/SensorUpdateEvent.cs index 5079fbe4..e2034dec 100644 --- a/sources/SDL2Sharp/Input/SensorUpdateEvent.cs +++ b/sources/SDL2Sharp/events/SensorUpdateEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class SensorUpdateEvent : Event { diff --git a/sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs b/sources/SDL2Sharp/events/SystemWindowManagerEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs rename to sources/SDL2Sharp/events/SystemWindowManagerEvent.cs index 7880dff0..957af9f7 100644 --- a/sources/SDL2Sharp/Input/SystemWindowManagerEvent.cs +++ b/sources/SDL2Sharp/events/SystemWindowManagerEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class SystemWindowManagerEvent : Event { diff --git a/sources/SDL2Sharp/Input/TextEditingEvent.cs b/sources/SDL2Sharp/events/TextEditingEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/TextEditingEvent.cs rename to sources/SDL2Sharp/events/TextEditingEvent.cs index 042118db..0f75d1fa 100644 --- a/sources/SDL2Sharp/Input/TextEditingEvent.cs +++ b/sources/SDL2Sharp/events/TextEditingEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class TextEditingEvent : Event { diff --git a/sources/SDL2Sharp/Input/TextEditingExtEvent.cs b/sources/SDL2Sharp/events/TextEditingExtEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/TextEditingExtEvent.cs rename to sources/SDL2Sharp/events/TextEditingExtEvent.cs index ea7d78e4..05b7f311 100644 --- a/sources/SDL2Sharp/Input/TextEditingExtEvent.cs +++ b/sources/SDL2Sharp/events/TextEditingExtEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class TextEditingExtEvent : Event { diff --git a/sources/SDL2Sharp/Input/TextInputEvent.cs b/sources/SDL2Sharp/events/TextInputEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/TextInputEvent.cs rename to sources/SDL2Sharp/events/TextInputEvent.cs index be2d7fd4..4b3db588 100644 --- a/sources/SDL2Sharp/Input/TextInputEvent.cs +++ b/sources/SDL2Sharp/events/TextInputEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class TextInputEvent : Event { diff --git a/sources/SDL2Sharp/Input/UserEvent.cs b/sources/SDL2Sharp/events/UserEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/UserEvent.cs rename to sources/SDL2Sharp/events/UserEvent.cs index 9508f596..59f89691 100644 --- a/sources/SDL2Sharp/Input/UserEvent.cs +++ b/sources/SDL2Sharp/events/UserEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class UserEvent : Event { diff --git a/sources/SDL2Sharp/Input/WindowCloseEvent.cs b/sources/SDL2Sharp/events/WindowCloseEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowCloseEvent.cs rename to sources/SDL2Sharp/events/WindowCloseEvent.cs index 7859aa7b..657d9c7d 100644 --- a/sources/SDL2Sharp/Input/WindowCloseEvent.cs +++ b/sources/SDL2Sharp/events/WindowCloseEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowCloseEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs b/sources/SDL2Sharp/events/WindowDisplayChangedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs rename to sources/SDL2Sharp/events/WindowDisplayChangedEvent.cs index 58cc9cab..3b39d1f9 100644 --- a/sources/SDL2Sharp/Input/WindowDisplayChangedEvent.cs +++ b/sources/SDL2Sharp/events/WindowDisplayChangedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowDisplayChangedEvent : Event { diff --git a/sources/SDL2Sharp/Input/WindowEnterEvent.cs b/sources/SDL2Sharp/events/WindowEnterEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowEnterEvent.cs rename to sources/SDL2Sharp/events/WindowEnterEvent.cs index 5b094551..e8aafe4c 100644 --- a/sources/SDL2Sharp/Input/WindowEnterEvent.cs +++ b/sources/SDL2Sharp/events/WindowEnterEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowEnterEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowEvent.cs b/sources/SDL2Sharp/events/WindowEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowEvent.cs rename to sources/SDL2Sharp/events/WindowEvent.cs index 00476664..380e4e56 100644 --- a/sources/SDL2Sharp/Input/WindowEvent.cs +++ b/sources/SDL2Sharp/events/WindowEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public abstract class WindowEvent : Event { diff --git a/sources/SDL2Sharp/Input/WindowExposedEvent.cs b/sources/SDL2Sharp/events/WindowExposedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowExposedEvent.cs rename to sources/SDL2Sharp/events/WindowExposedEvent.cs index 4a83df5a..9d954f84 100644 --- a/sources/SDL2Sharp/Input/WindowExposedEvent.cs +++ b/sources/SDL2Sharp/events/WindowExposedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowExposedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs b/sources/SDL2Sharp/events/WindowFocusGainedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs rename to sources/SDL2Sharp/events/WindowFocusGainedEvent.cs index 5fa84579..f027f55f 100644 --- a/sources/SDL2Sharp/Input/WindowFocusGainedEvent.cs +++ b/sources/SDL2Sharp/events/WindowFocusGainedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowFocusGainedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowFocusLostEvent.cs b/sources/SDL2Sharp/events/WindowFocusLostEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowFocusLostEvent.cs rename to sources/SDL2Sharp/events/WindowFocusLostEvent.cs index a044acf4..be32ebc7 100644 --- a/sources/SDL2Sharp/Input/WindowFocusLostEvent.cs +++ b/sources/SDL2Sharp/events/WindowFocusLostEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowFocusLostEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowHiddenEvent.cs b/sources/SDL2Sharp/events/WindowHiddenEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowHiddenEvent.cs rename to sources/SDL2Sharp/events/WindowHiddenEvent.cs index 4b6dc707..c7a1b098 100644 --- a/sources/SDL2Sharp/Input/WindowHiddenEvent.cs +++ b/sources/SDL2Sharp/events/WindowHiddenEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowHiddenEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowHitTestEvent.cs b/sources/SDL2Sharp/events/WindowHitTestEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowHitTestEvent.cs rename to sources/SDL2Sharp/events/WindowHitTestEvent.cs index fe6fe1c8..ac618a50 100644 --- a/sources/SDL2Sharp/Input/WindowHitTestEvent.cs +++ b/sources/SDL2Sharp/events/WindowHitTestEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowHitTestEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs b/sources/SDL2Sharp/events/WindowIccProfileChangedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs rename to sources/SDL2Sharp/events/WindowIccProfileChangedEvent.cs index 56923888..c5389cc0 100644 --- a/sources/SDL2Sharp/Input/WindowIccProfileChangedEvent.cs +++ b/sources/SDL2Sharp/events/WindowIccProfileChangedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowIccProfileChangedEvent : Event { diff --git a/sources/SDL2Sharp/Input/WindowLeaveEvent.cs b/sources/SDL2Sharp/events/WindowLeaveEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowLeaveEvent.cs rename to sources/SDL2Sharp/events/WindowLeaveEvent.cs index fb3e0a97..f738df67 100644 --- a/sources/SDL2Sharp/Input/WindowLeaveEvent.cs +++ b/sources/SDL2Sharp/events/WindowLeaveEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowLeaveEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowMaximizedEvent.cs b/sources/SDL2Sharp/events/WindowMaximizedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowMaximizedEvent.cs rename to sources/SDL2Sharp/events/WindowMaximizedEvent.cs index 03e2aa26..e83ca405 100644 --- a/sources/SDL2Sharp/Input/WindowMaximizedEvent.cs +++ b/sources/SDL2Sharp/events/WindowMaximizedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowMaximizedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowMinimizedEvent.cs b/sources/SDL2Sharp/events/WindowMinimizedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowMinimizedEvent.cs rename to sources/SDL2Sharp/events/WindowMinimizedEvent.cs index cc19b30e..ca879e91 100644 --- a/sources/SDL2Sharp/Input/WindowMinimizedEvent.cs +++ b/sources/SDL2Sharp/events/WindowMinimizedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowMinimizedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowMovedEvent.cs b/sources/SDL2Sharp/events/WindowMovedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowMovedEvent.cs rename to sources/SDL2Sharp/events/WindowMovedEvent.cs index 4de3fec7..6a286b6a 100644 --- a/sources/SDL2Sharp/Input/WindowMovedEvent.cs +++ b/sources/SDL2Sharp/events/WindowMovedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowMovedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowResizedEvent.cs b/sources/SDL2Sharp/events/WindowResizedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowResizedEvent.cs rename to sources/SDL2Sharp/events/WindowResizedEvent.cs index ff85bdf9..d73425ea 100644 --- a/sources/SDL2Sharp/Input/WindowResizedEvent.cs +++ b/sources/SDL2Sharp/events/WindowResizedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowResizedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowRestoredEvent.cs b/sources/SDL2Sharp/events/WindowRestoredEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowRestoredEvent.cs rename to sources/SDL2Sharp/events/WindowRestoredEvent.cs index bfd28dde..7f6f4031 100644 --- a/sources/SDL2Sharp/Input/WindowRestoredEvent.cs +++ b/sources/SDL2Sharp/events/WindowRestoredEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowRestoredEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowShownEvent.cs b/sources/SDL2Sharp/events/WindowShownEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowShownEvent.cs rename to sources/SDL2Sharp/events/WindowShownEvent.cs index d5ba93bf..87ac4920 100644 --- a/sources/SDL2Sharp/Input/WindowShownEvent.cs +++ b/sources/SDL2Sharp/events/WindowShownEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowShownEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs b/sources/SDL2Sharp/events/WindowSizeChangedEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs rename to sources/SDL2Sharp/events/WindowSizeChangedEvent.cs index c70d5e9f..91caaa79 100644 --- a/sources/SDL2Sharp/Input/WindowSizeChangedEvent.cs +++ b/sources/SDL2Sharp/events/WindowSizeChangedEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowSizeChangedEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs b/sources/SDL2Sharp/events/WindowTakeFocusEvent.cs similarity index 97% rename from sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs rename to sources/SDL2Sharp/events/WindowTakeFocusEvent.cs index b693801b..2ac1928c 100644 --- a/sources/SDL2Sharp/Input/WindowTakeFocusEvent.cs +++ b/sources/SDL2Sharp/events/WindowTakeFocusEvent.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public sealed class WindowTakeFocusEvent : WindowEvent { diff --git a/sources/SDL2Sharp/Fonts/Font.cs b/sources/SDL2Sharp/fonts/Font.cs similarity index 95% rename from sources/SDL2Sharp/Fonts/Font.cs rename to sources/SDL2Sharp/fonts/Font.cs index 7aebd877..8854e4cb 100644 --- a/sources/SDL2Sharp/Fonts/Font.cs +++ b/sources/SDL2Sharp/fonts/Font.cs @@ -19,12 +19,9 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; -using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp.Fonts +namespace SDL2Sharp { public sealed unsafe class Font : IDisposable { diff --git a/sources/SDL2Sharp/Fonts/FontError.cs b/sources/SDL2Sharp/fonts/FontError.cs similarity index 98% rename from sources/SDL2Sharp/Fonts/FontError.cs rename to sources/SDL2Sharp/fonts/FontError.cs index 9995872b..520842f7 100644 --- a/sources/SDL2Sharp/Fonts/FontError.cs +++ b/sources/SDL2Sharp/fonts/FontError.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Fonts +namespace SDL2Sharp { public sealed class FontError : Exception { diff --git a/sources/SDL2Sharp/Fonts/FontSubsystem.cs b/sources/SDL2Sharp/fonts/FontSubsystem.cs similarity index 93% rename from sources/SDL2Sharp/Fonts/FontSubsystem.cs rename to sources/SDL2Sharp/fonts/FontSubsystem.cs index c68a1661..e075832c 100644 --- a/sources/SDL2Sharp/Fonts/FontSubsystem.cs +++ b/sources/SDL2Sharp/fonts/FontSubsystem.cs @@ -21,9 +21,9 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Fonts +namespace SDL2Sharp { - public sealed class FontSubsystem : IFontSubsystem, IDisposable + internal sealed class FontSubsystem : IFontSubsystem, IDisposable { public FontSubsystem() { diff --git a/sources/SDL2Sharp/Fonts/IFontSubsystem.cs b/sources/SDL2Sharp/fonts/IFontSubsystem.cs similarity index 97% rename from sources/SDL2Sharp/Fonts/IFontSubsystem.cs rename to sources/SDL2Sharp/fonts/IFontSubsystem.cs index 581b05b5..27848688 100644 --- a/sources/SDL2Sharp/Fonts/IFontSubsystem.cs +++ b/sources/SDL2Sharp/fonts/IFontSubsystem.cs @@ -18,10 +18,10 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Fonts +namespace SDL2Sharp { public interface IFontSubsystem { Font OpenFont(string path, int pointSize); } -} \ No newline at end of file +} diff --git a/sources/SDL2Sharp/Internals/MarshaledString.cs b/sources/SDL2Sharp/internals/MarshaledString.cs similarity index 98% rename from sources/SDL2Sharp/Internals/MarshaledString.cs rename to sources/SDL2Sharp/internals/MarshaledString.cs index ba5b27c9..5cadda62 100644 --- a/sources/SDL2Sharp/Internals/MarshaledString.cs +++ b/sources/SDL2Sharp/internals/MarshaledString.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using System.Text; -namespace SDL2Sharp.Internals +namespace SDL2Sharp { internal unsafe struct MarshaledString : IDisposable { diff --git a/sources/SDL2Sharp/Internals/SpanExtensions.cs b/sources/SDL2Sharp/internals/SpanExtensions.cs similarity index 98% rename from sources/SDL2Sharp/Internals/SpanExtensions.cs rename to sources/SDL2Sharp/internals/SpanExtensions.cs index 452e3abb..0f9f5f11 100644 --- a/sources/SDL2Sharp/Internals/SpanExtensions.cs +++ b/sources/SDL2Sharp/internals/SpanExtensions.cs @@ -21,7 +21,7 @@ using System; using System.Text; -namespace SDL2Sharp.Internals +namespace SDL2Sharp { internal static unsafe class SpanExtensions { diff --git a/sources/SDL2Sharp/Input/KeyCode.cs b/sources/SDL2Sharp/keyboard/KeyCode.cs similarity index 99% rename from sources/SDL2Sharp/Input/KeyCode.cs rename to sources/SDL2Sharp/keyboard/KeyCode.cs index dbbe7083..9a24b338 100644 --- a/sources/SDL2Sharp/Input/KeyCode.cs +++ b/sources/SDL2Sharp/keyboard/KeyCode.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public enum KeyCode { diff --git a/sources/SDL2Sharp/Input/KeyboardState.cs b/sources/SDL2Sharp/keyboard/KeyboardState.cs similarity index 94% rename from sources/SDL2Sharp/Input/KeyboardState.cs rename to sources/SDL2Sharp/keyboard/KeyboardState.cs index 6bde7166..3f6e4827 100644 --- a/sources/SDL2Sharp/Input/KeyboardState.cs +++ b/sources/SDL2Sharp/keyboard/KeyboardState.cs @@ -20,13 +20,13 @@ using System; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public readonly ref struct KeyboardState { private readonly ReadOnlySpan _keyStates; - public KeyboardState(Span keyStates) + internal KeyboardState(Span keyStates) { _keyStates = keyStates; } diff --git a/sources/SDL2Sharp/Input/Keyboard.cs b/sources/SDL2Sharp/keyboard/SDL.cs similarity index 84% rename from sources/SDL2Sharp/Input/Keyboard.cs rename to sources/SDL2Sharp/keyboard/SDL.cs index 958e7f41..afd35a01 100644 --- a/sources/SDL2Sharp/Input/Keyboard.cs +++ b/sources/SDL2Sharp/keyboard/SDL.cs @@ -19,18 +19,19 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { - public static class Keyboard + public sealed partial class SDL { - public static unsafe KeyboardState State + public unsafe KeyboardState KeyboardState { get { + ThrowIfDisposed(); + int keyCount; - byte* keyStates = SDL.GetKeyboardState(&keyCount); + byte* keyStates = Interop.SDL.GetKeyboardState(&keyCount); return new KeyboardState(new Span(keyStates, keyCount)); } } diff --git a/sources/SDL2Sharp/Input/Scancode.cs b/sources/SDL2Sharp/keyboard/Scancode.cs similarity index 99% rename from sources/SDL2Sharp/Input/Scancode.cs rename to sources/SDL2Sharp/keyboard/Scancode.cs index edae8cb0..e5f4de47 100644 --- a/sources/SDL2Sharp/Input/Scancode.cs +++ b/sources/SDL2Sharp/keyboard/Scancode.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Input +namespace SDL2Sharp { public enum Scancode { diff --git a/sources/SDL2Sharp/MainSystem.cs b/sources/SDL2Sharp/mouse/SDL.cs similarity index 69% rename from sources/SDL2Sharp/MainSystem.cs rename to sources/SDL2Sharp/mouse/SDL.cs index 61ee4799..44c051fa 100644 --- a/sources/SDL2Sharp/MainSystem.cs +++ b/sources/SDL2Sharp/mouse/SDL.cs @@ -19,22 +19,27 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Interop; namespace SDL2Sharp { - public sealed class MainSystem : IMainSystem, IDisposable + public sealed partial class SDL { - public MainSystem() + public bool ShowCursor { - Error.ThrowLastErrorIfNegative( - SDL.Init(0) - ); - } + get + { + ThrowIfDisposed(); - public void Dispose() - { - SDL.Quit(); + return Interop.SDL.SDL_ENABLE == Interop.SDL.ShowCursor(Interop.SDL.SDL_QUERY); + } + set + { + ThrowIfDisposed(); + + Error.ThrowLastErrorIfNegative( + Interop.SDL.ShowCursor(Interop.SDL.SDL_ENABLE) + ); + } } } } diff --git a/sources/SDL2Sharp/Video/ArrayOrder.cs b/sources/SDL2Sharp/video/ArrayOrder.cs similarity index 98% rename from sources/SDL2Sharp/Video/ArrayOrder.cs rename to sources/SDL2Sharp/video/ArrayOrder.cs index bad6474e..26143b45 100644 --- a/sources/SDL2Sharp/Video/ArrayOrder.cs +++ b/sources/SDL2Sharp/video/ArrayOrder.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_ArrayOrder; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum ArrayOrder { diff --git a/sources/SDL2Sharp/Video/BitmapOrder.cs b/sources/SDL2Sharp/video/BitmapOrder.cs similarity index 97% rename from sources/SDL2Sharp/Video/BitmapOrder.cs rename to sources/SDL2Sharp/video/BitmapOrder.cs index 49844b6e..4ceeeb8a 100644 --- a/sources/SDL2Sharp/Video/BitmapOrder.cs +++ b/sources/SDL2Sharp/video/BitmapOrder.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_BitmapOrder; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum BitmapOrder { diff --git a/sources/SDL2Sharp/Video/BlendMode.cs b/sources/SDL2Sharp/video/BlendMode.cs similarity index 97% rename from sources/SDL2Sharp/Video/BlendMode.cs rename to sources/SDL2Sharp/video/BlendMode.cs index b1831507..ff92cb29 100644 --- a/sources/SDL2Sharp/Video/BlendMode.cs +++ b/sources/SDL2Sharp/video/BlendMode.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_BlendMode; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum BlendMode { diff --git a/sources/SDL2Sharp/Video/Color.cs b/sources/SDL2Sharp/video/Color.cs similarity index 98% rename from sources/SDL2Sharp/Video/Color.cs rename to sources/SDL2Sharp/video/Color.cs index 17874b3a..7f41f0ec 100644 --- a/sources/SDL2Sharp/Video/Color.cs +++ b/sources/SDL2Sharp/video/Color.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly struct Color { diff --git a/sources/SDL2Sharp/Video/Display.cs b/sources/SDL2Sharp/video/Display.cs similarity index 85% rename from sources/SDL2Sharp/Video/Display.cs rename to sources/SDL2Sharp/video/Display.cs index 012dba0d..df905b37 100644 --- a/sources/SDL2Sharp/Video/Display.cs +++ b/sources/SDL2Sharp/video/Display.cs @@ -21,7 +21,7 @@ using System.Collections.Generic; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class Display { @@ -33,7 +33,7 @@ public string Name { return new string( Error.ThrowLastErrorIfNull( - SDL.GetDisplayName(_displayIndex) + Interop.SDL.GetDisplayName(_displayIndex) ) ); } @@ -45,7 +45,7 @@ public Rectangle Bounds { var rect = new SDL_Rect(); Error.ThrowLastErrorIfNegative( - SDL.GetDisplayBounds(_displayIndex, &rect) + Interop.SDL.GetDisplayBounds(_displayIndex, &rect) ); return new Rectangle(rect.x, rect.y, rect.w, rect.h); } @@ -57,7 +57,7 @@ public DisplayMode CurrentMode { var displayMode = new SDL_DisplayMode(); Error.ThrowLastErrorIfNegative( - SDL.GetCurrentDisplayMode(_displayIndex, &displayMode) + Interop.SDL.GetCurrentDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( (PixelFormat)displayMode.format, @@ -73,7 +73,7 @@ public DisplayMode DesktopMode { var displayMode = new SDL_DisplayMode(); Error.ThrowLastErrorIfNegative( - SDL.GetDesktopDisplayMode(_displayIndex, &displayMode) + Interop.SDL.GetDesktopDisplayMode(_displayIndex, &displayMode) ); return new DisplayMode( (PixelFormat)displayMode.format, @@ -87,13 +87,13 @@ public IReadOnlyList Modes { get { - var modeCount = SDL.GetNumDisplayModes(_displayIndex); + var modeCount = Interop.SDL.GetNumDisplayModes(_displayIndex); var modes = new List(modeCount); for (var modeIndex = 0; modeIndex < modeCount; modeIndex++) { var displayMode = new SDL_DisplayMode(); Error.ThrowLastErrorIfNegative( - SDL.GetDisplayMode(_displayIndex, modeIndex, &displayMode) + Interop.SDL.GetDisplayMode(_displayIndex, modeIndex, &displayMode) ); modes.Add(new DisplayMode( (PixelFormat)displayMode.format, @@ -109,7 +109,7 @@ public DisplayOrientation Orientation { get { - return (DisplayOrientation)SDL.GetDisplayOrientation(_displayIndex); + return (DisplayOrientation)Interop.SDL.GetDisplayOrientation(_displayIndex); } } diff --git a/sources/SDL2Sharp/Video/DisplayMode.cs b/sources/SDL2Sharp/video/DisplayMode.cs similarity index 98% rename from sources/SDL2Sharp/Video/DisplayMode.cs rename to sources/SDL2Sharp/video/DisplayMode.cs index 0bde4d1f..cb4d6167 100644 --- a/sources/SDL2Sharp/Video/DisplayMode.cs +++ b/sources/SDL2Sharp/video/DisplayMode.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class DisplayMode { diff --git a/sources/SDL2Sharp/Video/DisplayOrientation.cs b/sources/SDL2Sharp/video/DisplayOrientation.cs similarity index 98% rename from sources/SDL2Sharp/Video/DisplayOrientation.cs rename to sources/SDL2Sharp/video/DisplayOrientation.cs index 618fe938..d1b1c69a 100644 --- a/sources/SDL2Sharp/Video/DisplayOrientation.cs +++ b/sources/SDL2Sharp/video/DisplayOrientation.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_DisplayOrientation; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum DisplayOrientation { diff --git a/sources/SDL2Sharp/Video/IVideoSubsystem.cs b/sources/SDL2Sharp/video/IVideoSubsystem.cs similarity index 98% rename from sources/SDL2Sharp/Video/IVideoSubsystem.cs rename to sources/SDL2Sharp/video/IVideoSubsystem.cs index de52d624..c594bdad 100644 --- a/sources/SDL2Sharp/Video/IVideoSubsystem.cs +++ b/sources/SDL2Sharp/video/IVideoSubsystem.cs @@ -20,7 +20,7 @@ using System.Collections.Generic; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public interface IVideoSubsystem { diff --git a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs b/sources/SDL2Sharp/video/ImageMemoryPlane.cs similarity index 99% rename from sources/SDL2Sharp/Video/ImageMemoryPlane.cs rename to sources/SDL2Sharp/video/ImageMemoryPlane.cs index bc2aab2a..6c6d5a7b 100644 --- a/sources/SDL2Sharp/Video/ImageMemoryPlane.cs +++ b/sources/SDL2Sharp/video/ImageMemoryPlane.cs @@ -22,7 +22,7 @@ using System.Runtime.InteropServices; using CommunityToolkit.HighPerformance; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class ImageMemoryPlane where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/ImagePlane.cs b/sources/SDL2Sharp/video/ImagePlane.cs similarity index 99% rename from sources/SDL2Sharp/Video/ImagePlane.cs rename to sources/SDL2Sharp/video/ImagePlane.cs index fb91d990..93f45382 100644 --- a/sources/SDL2Sharp/Video/ImagePlane.cs +++ b/sources/SDL2Sharp/video/ImagePlane.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly unsafe ref struct ImagePlane where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/NV12Image.cs b/sources/SDL2Sharp/video/NV12Image.cs similarity index 97% rename from sources/SDL2Sharp/Video/NV12Image.cs rename to sources/SDL2Sharp/video/NV12Image.cs index fc1794a0..25697ae7 100644 --- a/sources/SDL2Sharp/Video/NV12Image.cs +++ b/sources/SDL2Sharp/video/NV12Image.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly ref struct NV12Image { diff --git a/sources/SDL2Sharp/Video/NV12MemoryImage.cs b/sources/SDL2Sharp/video/NV12MemoryImage.cs similarity index 97% rename from sources/SDL2Sharp/Video/NV12MemoryImage.cs rename to sources/SDL2Sharp/video/NV12MemoryImage.cs index d3fd1abe..b445ce93 100644 --- a/sources/SDL2Sharp/Video/NV12MemoryImage.cs +++ b/sources/SDL2Sharp/video/NV12MemoryImage.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class NV12MemoryImage { diff --git a/sources/SDL2Sharp/Video/NV12Texture.cs b/sources/SDL2Sharp/video/NV12Texture.cs similarity index 88% rename from sources/SDL2Sharp/Video/NV12Texture.cs rename to sources/SDL2Sharp/video/NV12Texture.cs index 60529189..ab6b4b62 100644 --- a/sources/SDL2Sharp/Video/NV12Texture.cs +++ b/sources/SDL2Sharp/video/NV12Texture.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class NV12Texture : IDisposable { @@ -58,18 +58,7 @@ internal NV12Texture(Texture texture) _texture = texture; } - ~NV12Texture() - { - Dispose(false); - } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) { if (_texture is null) return; _texture.Dispose(); @@ -96,18 +85,18 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) void* pixels; int pitch; Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) + Interop.SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new NV12Image(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture.Handle); + Interop.SDL.UnlockTexture(_texture.Handle); } public void Update(NV12Image image) { Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, + Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.UV, image.UV.Pitch) ); @@ -118,7 +107,7 @@ public void Update(NV12MemoryImage image) ArgumentNullException.ThrowIfNull(image); Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, + Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.UV, image.UV.Pitch ) diff --git a/sources/SDL2Sharp/Video/NV21Image.cs b/sources/SDL2Sharp/video/NV21Image.cs similarity index 97% rename from sources/SDL2Sharp/Video/NV21Image.cs rename to sources/SDL2Sharp/video/NV21Image.cs index fc01f999..e05c7098 100644 --- a/sources/SDL2Sharp/Video/NV21Image.cs +++ b/sources/SDL2Sharp/video/NV21Image.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly ref struct NV21Image { diff --git a/sources/SDL2Sharp/Video/NV21MemoryImage.cs b/sources/SDL2Sharp/video/NV21MemoryImage.cs similarity index 97% rename from sources/SDL2Sharp/Video/NV21MemoryImage.cs rename to sources/SDL2Sharp/video/NV21MemoryImage.cs index f4df3b52..40725b25 100644 --- a/sources/SDL2Sharp/Video/NV21MemoryImage.cs +++ b/sources/SDL2Sharp/video/NV21MemoryImage.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class NV21MemoryImage { diff --git a/sources/SDL2Sharp/Video/NV21Texture.cs b/sources/SDL2Sharp/video/NV21Texture.cs similarity index 88% rename from sources/SDL2Sharp/Video/NV21Texture.cs rename to sources/SDL2Sharp/video/NV21Texture.cs index 067a5138..f1c85e46 100644 --- a/sources/SDL2Sharp/Video/NV21Texture.cs +++ b/sources/SDL2Sharp/video/NV21Texture.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class NV21Texture : IDisposable { @@ -58,18 +58,7 @@ internal NV21Texture(Texture texture) _texture = texture; } - ~NV21Texture() - { - Dispose(false); - } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) { if (_texture is null) return; _texture.Dispose(); @@ -96,18 +85,18 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) void* pixels; int pitch; Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) + Interop.SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new NV21Image(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture.Handle); + Interop.SDL.UnlockTexture(_texture.Handle); } public void Update(NV21Image image) { Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, + Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.UV, image.UV.Pitch) ); @@ -118,7 +107,7 @@ public void Update(NV21MemoryImage image) ArgumentNullException.ThrowIfNull(image); Error.ThrowLastErrorIfNegative( - SDL.UpdateNVTexture(_texture.Handle, null, + Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.UV, image.UV.Pitch ) diff --git a/sources/SDL2Sharp/Video/PackedImage.cs b/sources/SDL2Sharp/video/PackedImage.cs similarity index 99% rename from sources/SDL2Sharp/Video/PackedImage.cs rename to sources/SDL2Sharp/video/PackedImage.cs index c60f1ce7..4a20f05a 100644 --- a/sources/SDL2Sharp/Video/PackedImage.cs +++ b/sources/SDL2Sharp/video/PackedImage.cs @@ -21,7 +21,7 @@ using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly ref struct PackedImage where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/PackedLayout.cs b/sources/SDL2Sharp/video/PackedLayout.cs similarity index 98% rename from sources/SDL2Sharp/Video/PackedLayout.cs rename to sources/SDL2Sharp/video/PackedLayout.cs index aedf2c32..f19c85f3 100644 --- a/sources/SDL2Sharp/Video/PackedLayout.cs +++ b/sources/SDL2Sharp/video/PackedLayout.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_PackedLayout; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum PackedLayout { diff --git a/sources/SDL2Sharp/Video/PackedMemoryImage.cs b/sources/SDL2Sharp/video/PackedMemoryImage.cs similarity index 99% rename from sources/SDL2Sharp/Video/PackedMemoryImage.cs rename to sources/SDL2Sharp/video/PackedMemoryImage.cs index f866d959..7ba71ee7 100644 --- a/sources/SDL2Sharp/Video/PackedMemoryImage.cs +++ b/sources/SDL2Sharp/video/PackedMemoryImage.cs @@ -21,7 +21,7 @@ using System; using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class PackedMemoryImage where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/PackedOrder.cs b/sources/SDL2Sharp/video/PackedOrder.cs similarity index 98% rename from sources/SDL2Sharp/Video/PackedOrder.cs rename to sources/SDL2Sharp/video/PackedOrder.cs index f74685e7..833a0123 100644 --- a/sources/SDL2Sharp/Video/PackedOrder.cs +++ b/sources/SDL2Sharp/video/PackedOrder.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_PackedOrder; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum PackedOrder { diff --git a/sources/SDL2Sharp/Video/PackedTexture.cs b/sources/SDL2Sharp/video/PackedTexture.cs similarity index 89% rename from sources/SDL2Sharp/Video/PackedTexture.cs rename to sources/SDL2Sharp/video/PackedTexture.cs index 0b59c196..7d5b6ae4 100644 --- a/sources/SDL2Sharp/Video/PackedTexture.cs +++ b/sources/SDL2Sharp/video/PackedTexture.cs @@ -23,9 +23,8 @@ using System.Runtime.InteropServices; using CommunityToolkit.HighPerformance; using SDL2Sharp.Interop; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class PackedTexture : IDisposable where TPackedPixel : struct, IPackedPixel @@ -67,18 +66,7 @@ internal PackedTexture(Texture texture) _texture = texture; } - ~PackedTexture() - { - Dispose(false); - } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) { if (_texture is null) return; _texture.Dispose(); @@ -103,12 +91,12 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) void* pixels; int pitch; Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) + Interop.SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new PackedImage(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture.Handle); + Interop.SDL.UnlockTexture(_texture.Handle); } public void WithLock(LockToSurfaceCallback callback) @@ -128,11 +116,11 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; Error.ThrowLastErrorIfNegative( - SDL.LockTextureToSurface(_texture.Handle, &rect, &surfaceHandle) + Interop.SDL.LockTextureToSurface(_texture.Handle, &rect, &surfaceHandle) ); var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); - SDL.UnlockTexture(_texture.Handle); + Interop.SDL.UnlockTexture(_texture.Handle); } public void Update(PackedImage pixels) @@ -162,7 +150,7 @@ public void Update(TPackedPixel[,] pixels) private void Update(SDL_Rect* rect, void* pixels, int pitch) { Error.ThrowLastErrorIfNegative( - SDL.UpdateTexture(_texture.Handle, rect, pixels, pitch) + Interop.SDL.UpdateTexture(_texture.Handle, rect, pixels, pitch) ); } diff --git a/sources/SDL2Sharp/Video/PixelFormat.cs b/sources/SDL2Sharp/video/PixelFormat.cs similarity index 99% rename from sources/SDL2Sharp/Video/PixelFormat.cs rename to sources/SDL2Sharp/video/PixelFormat.cs index bc569116..c4f6d926 100644 --- a/sources/SDL2Sharp/Video/PixelFormat.cs +++ b/sources/SDL2Sharp/video/PixelFormat.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_PixelFormatEnum; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum PixelFormat : uint { diff --git a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs b/sources/SDL2Sharp/video/PixelFormatDescriptor.cs similarity index 88% rename from sources/SDL2Sharp/Video/PixelFormatDescriptor.cs rename to sources/SDL2Sharp/video/PixelFormatDescriptor.cs index 3cf39c00..b0ef125d 100644 --- a/sources/SDL2Sharp/Video/PixelFormatDescriptor.cs +++ b/sources/SDL2Sharp/video/PixelFormatDescriptor.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class PixelFormatDescriptor : IDisposable { @@ -69,7 +69,7 @@ internal PixelFormatDescriptor(SDL_PixelFormat* handle, bool ownsHandle) } public PixelFormatDescriptor(PixelFormat pixelFormat) - : this(Error.ThrowLastErrorIfNull(SDL.AllocFormat((uint)pixelFormat)), true) + : this(Error.ThrowLastErrorIfNull(Interop.SDL.AllocFormat((uint)pixelFormat)), true) { } ~PixelFormatDescriptor() @@ -86,31 +86,31 @@ public void Dispose() private void Dispose(bool _) { if (!_ownsHandle || _handle == null) return; - SDL.FreeFormat(_handle); + Interop.SDL.FreeFormat(_handle); _handle = null; } internal uint MapRGB(byte r, byte g, byte b) { - return SDL.MapRGB(_handle, r, g, b); + return Interop.SDL.MapRGB(_handle, r, g, b); } public uint MapRGBA(byte r, byte g, byte b, byte a) { - return SDL.MapRGBA(_handle, r, g, b, a); + return Interop.SDL.MapRGBA(_handle, r, g, b, a); } public (byte r, byte g, byte b) GetRGB(uint value) { byte r, g, b; - SDL.GetRGB(value, _handle, &r, &g, &b); + Interop.SDL.GetRGB(value, _handle, &r, &g, &b); return (r, g, b); } public (byte r, byte g, byte b, byte a) GetRGBA(uint value) { byte r, g, b, a; - SDL.GetRGBA(value, _handle, &r, &g, &b, &a); + Interop.SDL.GetRGBA(value, _handle, &r, &g, &b, &a); return (r, g, b, a); } } diff --git a/sources/SDL2Sharp/Video/PixelFormatExtensions.cs b/sources/SDL2Sharp/video/PixelFormatExtensions.cs similarity index 99% rename from sources/SDL2Sharp/Video/PixelFormatExtensions.cs rename to sources/SDL2Sharp/video/PixelFormatExtensions.cs index cbcec760..39578e01 100644 --- a/sources/SDL2Sharp/Video/PixelFormatExtensions.cs +++ b/sources/SDL2Sharp/video/PixelFormatExtensions.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public static class PixelFormatExtensions { diff --git a/sources/SDL2Sharp/Video/PixelOrder.cs b/sources/SDL2Sharp/video/PixelOrder.cs similarity index 100% rename from sources/SDL2Sharp/Video/PixelOrder.cs rename to sources/SDL2Sharp/video/PixelOrder.cs diff --git a/sources/SDL2Sharp/Video/PixelType.cs b/sources/SDL2Sharp/video/PixelType.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelType.cs rename to sources/SDL2Sharp/video/PixelType.cs index 6b89ff2b..b1b26931 100644 --- a/sources/SDL2Sharp/Video/PixelType.cs +++ b/sources/SDL2Sharp/video/PixelType.cs @@ -20,7 +20,7 @@ using static SDL2Sharp.Interop.SDL_PixelType; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum PixelType { diff --git a/sources/SDL2Sharp/Video/Point.cs b/sources/SDL2Sharp/video/Point.cs similarity index 97% rename from sources/SDL2Sharp/Video/Point.cs rename to sources/SDL2Sharp/video/Point.cs index 5ff328b9..2d684aec 100644 --- a/sources/SDL2Sharp/Video/Point.cs +++ b/sources/SDL2Sharp/video/Point.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly record struct Point { diff --git a/sources/SDL2Sharp/Video/Rectangle.cs b/sources/SDL2Sharp/video/Rectangle.cs similarity index 98% rename from sources/SDL2Sharp/Video/Rectangle.cs rename to sources/SDL2Sharp/video/Rectangle.cs index ebf3b81b..239c9db3 100644 --- a/sources/SDL2Sharp/Video/Rectangle.cs +++ b/sources/SDL2Sharp/video/Rectangle.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly record struct Rectangle { diff --git a/sources/SDL2Sharp/Video/Renderer.cs b/sources/SDL2Sharp/video/Renderer.cs similarity index 81% rename from sources/SDL2Sharp/Video/Renderer.cs rename to sources/SDL2Sharp/video/Renderer.cs index 53289f30..76d2a54c 100644 --- a/sources/SDL2Sharp/Video/Renderer.cs +++ b/sources/SDL2Sharp/video/Renderer.cs @@ -22,9 +22,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL2Sharp.Interop; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class Renderer : IDisposable { @@ -40,7 +39,7 @@ public RendererInfo Info var rendererInfo = new SDL_RendererInfo(); Error.ThrowLastErrorIfNegative( - SDL.GetRendererInfo(_handle, &rendererInfo) + Interop.SDL.GetRendererInfo(_handle, &rendererInfo) ); return new RendererInfo(rendererInfo); } @@ -54,7 +53,7 @@ public Size OutputSize int width, height; Error.ThrowLastErrorIfNegative( - SDL.GetRendererOutputSize(_handle, &width, &height) + Interop.SDL.GetRendererOutputSize(_handle, &width, &height) ); return new Size(width, height); } @@ -68,7 +67,7 @@ public int OutputWidth int width; Error.ThrowLastErrorIfNegative( - SDL.GetRendererOutputSize(_handle, &width, null) + Interop.SDL.GetRendererOutputSize(_handle, &width, null) ); return width; } @@ -82,7 +81,7 @@ public int OutputHeight int height; Error.ThrowLastErrorIfNegative( - SDL.GetRendererOutputSize(_handle, null, &height) + Interop.SDL.GetRendererOutputSize(_handle, null, &height) ); return height; } @@ -96,7 +95,7 @@ public Color DrawColor byte r, g, b, a; Error.ThrowLastErrorIfNegative( - SDL.GetRenderDrawColor(_handle, &r, &g, &b, &a) + Interop.SDL.GetRenderDrawColor(_handle, &r, &g, &b, &a) ); return new Color(r, g, b, a); } @@ -105,7 +104,7 @@ public Color DrawColor ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.SetRenderDrawColor(_handle, value.R, value.G, value.B, value.A) + Interop.SDL.SetRenderDrawColor(_handle, value.R, value.G, value.B, value.A) ); } } @@ -118,7 +117,7 @@ public BlendMode BlendMode SDL_BlendMode blendMode; Error.ThrowLastErrorIfNegative( - SDL.GetRenderDrawBlendMode(_handle, &blendMode) + Interop.SDL.GetRenderDrawBlendMode(_handle, &blendMode) ); return (BlendMode)blendMode; } @@ -127,7 +126,7 @@ public BlendMode BlendMode ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.SetRenderDrawBlendMode(_handle, (SDL_BlendMode)value) + Interop.SDL.SetRenderDrawBlendMode(_handle, (SDL_BlendMode)value) ); } } @@ -139,7 +138,7 @@ public Size LogicalViewSize ThrowWhenDisposed(); int width, height; - SDL.RenderGetLogicalSize(_handle, &width, &height); + Interop.SDL.RenderGetLogicalSize(_handle, &width, &height); return new Size(width, height); } set @@ -147,7 +146,7 @@ public Size LogicalViewSize ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderSetLogicalSize(_handle, value.Width, value.Height) + Interop.SDL.RenderSetLogicalSize(_handle, value.Width, value.Height) ); } } @@ -160,7 +159,7 @@ public Scale Scale ThrowWhenDisposed(); float scaleX, scaleY; - SDL.RenderGetScale(_handle, &scaleX, &scaleY); + Interop.SDL.RenderGetScale(_handle, &scaleX, &scaleY); return new Scale(scaleX, scaleY); } set @@ -168,7 +167,7 @@ public Scale Scale ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderSetScale(_handle, value.X, value.Y) + Interop.SDL.RenderSetScale(_handle, value.X, value.Y) ); } } @@ -180,7 +179,7 @@ public Rectangle ViewPort ThrowWhenDisposed(); var rect = new SDL_Rect(); - SDL.RenderGetViewport(_handle, &rect); + Interop.SDL.RenderGetViewport(_handle, &rect); return new Rectangle(rect.x, rect.y, rect.w, rect.h); } set @@ -189,7 +188,7 @@ public Rectangle ViewPort var rect = new SDL_Rect { x = value.X, y = value.Y, w = value.Width, h = value.Height }; Error.ThrowLastErrorIfNegative( - SDL.RenderSetViewport(_handle, &rect) + Interop.SDL.RenderSetViewport(_handle, &rect) ); } } @@ -209,13 +208,13 @@ public Texture? Target if (value is null) { Error.ThrowLastErrorIfNegative( - SDL.SetRenderTarget(_handle, null) + Interop.SDL.SetRenderTarget(_handle, null) ); } else { Error.ThrowLastErrorIfNegative( - SDL.SetRenderTarget(_handle, value.Handle) + Interop.SDL.SetRenderTarget(_handle, value.Handle) ); } @@ -244,7 +243,7 @@ public void Dispose() private void Dispose(bool _) { if (_handle is null) return; - SDL.DestroyRenderer(_handle); + Interop.SDL.DestroyRenderer(_handle); _handle = null; } @@ -257,7 +256,7 @@ public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, int { ThrowWhenDisposed(); - var texture = SDL.CreateTexture(_handle, (uint)pixelFormat, (int)access, width, height); + var texture = Interop.SDL.CreateTexture(_handle, (uint)pixelFormat, (int)access, width, height); Error.ThrowLastErrorIfNull(texture); return new Texture(texture); } @@ -266,7 +265,7 @@ public Texture CreateTextureFromSurface(Surface surface) { ThrowWhenDisposed(); - var texture = SDL.CreateTextureFromSurface(_handle, surface.Handle); + var texture = Interop.SDL.CreateTextureFromSurface(_handle, surface.Handle); Error.ThrowLastErrorIfNull(texture); return new Texture(texture); } @@ -276,7 +275,7 @@ public void Clear() ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderClear(_handle) + Interop.SDL.RenderClear(_handle) ); } @@ -285,7 +284,7 @@ public void Copy(Texture texture) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderCopy(_handle, texture.Handle, null, null) + Interop.SDL.RenderCopy(_handle, texture.Handle, null, null) ); } @@ -302,7 +301,7 @@ public void Copy(Texture texture, Rectangle destination) }; Error.ThrowLastErrorIfNegative( - SDL.RenderCopy(_handle, texture.Handle, null, &dest) + Interop.SDL.RenderCopy(_handle, texture.Handle, null, &dest) ); } @@ -327,7 +326,7 @@ public void Copy(Texture texture, Rectangle source, Rectangle destination) }; Error.ThrowLastErrorIfNegative( - SDL.RenderCopy(_handle, texture.Handle, &src, &dest) + Interop.SDL.RenderCopy(_handle, texture.Handle, &src, &dest) ); } @@ -336,7 +335,7 @@ public void DrawLine(int x1, int y1, int x2, int y2) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderDrawLine(_handle, x1, y1, x2, y2) + Interop.SDL.RenderDrawLine(_handle, x1, y1, x2, y2) ); } @@ -347,7 +346,7 @@ public void DrawLines(Point[] points) fixed (Point* point = &points[0]) { Error.ThrowLastErrorIfNegative( - SDL.RenderDrawLines(_handle, (SDL_Point*)point, points.Length) + Interop.SDL.RenderDrawLines(_handle, (SDL_Point*)point, points.Length) ); } } @@ -357,7 +356,7 @@ public void DrawLine(float x1, float y1, float x2, float y2) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderDrawLineF(_handle, x1, y1, x2, y2) + Interop.SDL.RenderDrawLineF(_handle, x1, y1, x2, y2) ); } @@ -366,7 +365,7 @@ public void DrawPoint(int x, int y) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderDrawPoint(_handle, x, y) + Interop.SDL.RenderDrawPoint(_handle, x, y) ); } @@ -375,7 +374,7 @@ public void DrawPoint(float x, float y) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.RenderDrawPointF(_handle, x, y) + Interop.SDL.RenderDrawPointF(_handle, x, y) ); } @@ -386,7 +385,7 @@ public void DrawPoints(Point[] points) fixed (Point* point = &points[0]) { Error.ThrowLastErrorIfNegative( - SDL.RenderDrawPoints(_handle, (SDL_Point*)point, points.Length) + Interop.SDL.RenderDrawPoints(_handle, (SDL_Point*)point, points.Length) ); } } @@ -397,7 +396,7 @@ public void FillRect(int x, int y, int width, int height) var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; Error.ThrowLastErrorIfNegative( - SDL.RenderFillRect(_handle, &rect) + Interop.SDL.RenderFillRect(_handle, &rect) ); } @@ -410,7 +409,7 @@ public void Present() { ThrowWhenDisposed(); - SDL.RenderPresent(_handle); + Interop.SDL.RenderPresent(_handle); } public PackedMemoryImage ReadPixels() @@ -434,7 +433,7 @@ public PackedMemoryImage ReadPixels(Rectangle rectan var pixels = Unsafe.AsPointer(ref image.DangerousGetReference()); var pitch = rectangle.Width * Marshal.SizeOf(); Error.ThrowLastErrorIfNegative( - SDL.RenderReadPixels(_handle, + Interop.SDL.RenderReadPixels(_handle, &rect, format, pixels, diff --git a/sources/SDL2Sharp/Video/RendererExtensions.cs b/sources/SDL2Sharp/video/RendererExtensions.cs similarity index 99% rename from sources/SDL2Sharp/Video/RendererExtensions.cs rename to sources/SDL2Sharp/video/RendererExtensions.cs index ec0fb152..af0baf39 100644 --- a/sources/SDL2Sharp/Video/RendererExtensions.cs +++ b/sources/SDL2Sharp/video/RendererExtensions.cs @@ -19,11 +19,9 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Fonts; -using SDL2Sharp.Video.PixelFormats; using static System.Math; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public static class RendererExtensions { diff --git a/sources/SDL2Sharp/Video/RendererFlags.cs b/sources/SDL2Sharp/video/RendererFlags.cs similarity index 98% rename from sources/SDL2Sharp/Video/RendererFlags.cs rename to sources/SDL2Sharp/video/RendererFlags.cs index 3527edc6..7031ae32 100644 --- a/sources/SDL2Sharp/Video/RendererFlags.cs +++ b/sources/SDL2Sharp/video/RendererFlags.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Video +namespace SDL2Sharp { [Flags] public enum RendererFlags : uint diff --git a/sources/SDL2Sharp/Video/RendererInfo.cs b/sources/SDL2Sharp/video/RendererInfo.cs similarity index 98% rename from sources/SDL2Sharp/Video/RendererInfo.cs rename to sources/SDL2Sharp/video/RendererInfo.cs index e322acec..e8e321cf 100644 --- a/sources/SDL2Sharp/Video/RendererInfo.cs +++ b/sources/SDL2Sharp/video/RendererInfo.cs @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class RendererInfo { diff --git a/sources/SDL2Sharp/Video/Scale.cs b/sources/SDL2Sharp/video/Scale.cs similarity index 97% rename from sources/SDL2Sharp/Video/Scale.cs rename to sources/SDL2Sharp/video/Scale.cs index 932ae26f..6d4f7102 100644 --- a/sources/SDL2Sharp/Video/Scale.cs +++ b/sources/SDL2Sharp/video/Scale.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly struct Scale { diff --git a/sources/SDL2Sharp/Video/Size.cs b/sources/SDL2Sharp/video/Size.cs similarity index 97% rename from sources/SDL2Sharp/Video/Size.cs rename to sources/SDL2Sharp/video/Size.cs index 7e572912..a1f6ba5c 100644 --- a/sources/SDL2Sharp/Video/Size.cs +++ b/sources/SDL2Sharp/video/Size.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly record struct Size { diff --git a/sources/SDL2Sharp/Video/Surface.cs b/sources/SDL2Sharp/video/Surface.cs similarity index 78% rename from sources/SDL2Sharp/Video/Surface.cs rename to sources/SDL2Sharp/video/Surface.cs index 371e6ea8..1737960e 100644 --- a/sources/SDL2Sharp/Video/Surface.cs +++ b/sources/SDL2Sharp/video/Surface.cs @@ -19,10 +19,9 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Internals; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class Surface : IDisposable { @@ -42,15 +41,15 @@ public sealed unsafe class Surface : IDisposable public int Pitch => _handle->pitch; - private bool MustLock => (_handle->flags & SDL.SDL_RLEACCEL) != 0; + private bool MustLock => (_handle->flags & Interop.SDL.SDL_RLEACCEL) != 0; public static Surface LoadBitmap(string filename) { using var file = new MarshaledString(filename); using var mode = new MarshaledString("rb"); - var source = SDL.RWFromFile(file, mode); + var source = Interop.SDL.RWFromFile(file, mode); Error.ThrowLastErrorIfNull(source); - var bitmap = SDL.LoadBMP_RW(source, 1); + var bitmap = Interop.SDL.LoadBMP_RW(source, 1); Error.ThrowLastErrorIfNull(bitmap); return new Surface(bitmap); } @@ -71,19 +70,19 @@ internal Surface(SDL_Surface* handle, bool freeHandle) } public Surface(int width, int height, PixelFormat format) - : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) + : this(Error.ThrowLastErrorIfNull(Interop.SDL.CreateRGBSurfaceWithFormat(0, width, height, 0, (uint)format))) { } public Surface(int width, int height, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) + : this(Error.ThrowLastErrorIfNull(Interop.SDL.CreateRGBSurface(0, width, height, 0, redMask, greenMask, blueMask, alphaMask))) { } public Surface(void* pixels, int width, int height, int pitch, PixelFormat format) - : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) + : this(Error.ThrowLastErrorIfNull(Interop.SDL.CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, (uint)format))) { } public Surface(void* pixels, int width, int height, int pitch, uint redMask, uint greenMask, uint blueMask, uint alphaMask) - : this(Error.ThrowLastErrorIfNull(SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) + : this(Error.ThrowLastErrorIfNull(Interop.SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) { } ~Surface() @@ -106,7 +105,7 @@ private void Dispose(bool _) if (_freeHandle) { - SDL.FreeSurface(_handle); + Interop.SDL.FreeSurface(_handle); } _handle = null; @@ -119,7 +118,7 @@ public void Blit(Surface surface) ArgumentNullException.ThrowIfNull(surface); Error.ThrowLastErrorIfNegative( - SDL.Blit(_handle, null, surface._handle, null) + Interop.SDL.Blit(_handle, null, surface._handle, null) ); } @@ -127,7 +126,7 @@ public Surface ConvertTo(PixelFormat format) { ThrowWhenDisposed(); - return new Surface(SDL.ConvertSurfaceFormat(_handle, (uint)format, 0)); + return new Surface(Interop.SDL.ConvertSurfaceFormat(_handle, (uint)format, 0)); } public void FillRect(uint color) @@ -135,7 +134,7 @@ public void FillRect(uint color) ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.FillRect(_handle, null, color) + Interop.SDL.FillRect(_handle, null, color) ); } @@ -148,7 +147,7 @@ public void WithLock(SurfaceLockCallback callback) if (mustLock) { Error.ThrowLastErrorIfNegative( - SDL.LockSurface(_handle) + Interop.SDL.LockSurface(_handle) ); } @@ -161,7 +160,7 @@ public void WithLock(SurfaceLockCallback callback) if (mustLock) { - SDL.UnlockSurface(_handle); + Interop.SDL.UnlockSurface(_handle); } } diff --git a/sources/SDL2Sharp/Video/SurfaceLockCallback.cs b/sources/SDL2Sharp/video/SurfaceLockCallback.cs similarity index 97% rename from sources/SDL2Sharp/Video/SurfaceLockCallback.cs rename to sources/SDL2Sharp/video/SurfaceLockCallback.cs index eefd164d..5601a6dd 100644 --- a/sources/SDL2Sharp/Video/SurfaceLockCallback.cs +++ b/sources/SDL2Sharp/video/SurfaceLockCallback.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public delegate void SurfaceLockCallback(PackedImage pixels) where TPacketColor : struct; diff --git a/sources/SDL2Sharp/Video/Surface{T}.cs b/sources/SDL2Sharp/video/Surface{T}.cs similarity index 98% rename from sources/SDL2Sharp/Video/Surface{T}.cs rename to sources/SDL2Sharp/video/Surface{T}.cs index a2f21505..941148f5 100644 --- a/sources/SDL2Sharp/Video/Surface{T}.cs +++ b/sources/SDL2Sharp/video/Surface{T}.cs @@ -20,9 +20,8 @@ using System; using SDL2Sharp.Interop; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class Surface : IDisposable where TPackedPixel : struct, IPackedPixel diff --git a/sources/SDL2Sharp/Video/Texture.cs b/sources/SDL2Sharp/video/Texture.cs similarity index 76% rename from sources/SDL2Sharp/Video/Texture.cs rename to sources/SDL2Sharp/video/Texture.cs index 13ba74b7..5e5df1a6 100644 --- a/sources/SDL2Sharp/Video/Texture.cs +++ b/sources/SDL2Sharp/video/Texture.cs @@ -21,7 +21,7 @@ using System; using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe class Texture : IDisposable { @@ -36,7 +36,7 @@ public PixelFormat Format get { uint format; - Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, &format, null, null, null)); + Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, &format, null, null, null)); return (PixelFormat)format; } } @@ -46,7 +46,7 @@ public TextureAccess Access get { int access; - Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, &access, null, null)); + Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, &access, null, null)); return (TextureAccess)access; } } @@ -56,7 +56,7 @@ public int Width get { int width; - Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, &width, null)); + Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, &width, null)); return width; } } @@ -66,7 +66,7 @@ public int Height get { int height; - Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, null, &height)); + Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, null, &height)); return height; } } @@ -76,7 +76,7 @@ public Size Size get { int width, height; - Error.ThrowLastErrorIfNegative(SDL.QueryTexture(_handle, null, null, &width, &height)); + Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, &width, &height)); return new Size(width, height); } } @@ -87,19 +87,19 @@ public BlendMode BlendMode { SDL_BlendMode blendMode; Error.ThrowLastErrorIfNegative( - SDL.GetTextureBlendMode(_handle, &blendMode) + Interop.SDL.GetTextureBlendMode(_handle, &blendMode) ); return (BlendMode)blendMode; } set { Error.ThrowLastErrorIfNegative( - SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) + Interop.SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) ); } } - public bool IsValid => 0 == SDL.QueryTexture(_handle, null, null, null, null); + public bool IsValid => 0 == Interop.SDL.QueryTexture(_handle, null, null, null, null); internal Texture(SDL_Texture* texture) { @@ -110,19 +110,19 @@ internal Texture(SDL_Texture* texture) ~Texture() { - Dispose(false); + ReleaseHandle(); } public void Dispose() { - Dispose(true); + ReleaseHandle(); GC.SuppressFinalize(this); } - private void Dispose(bool _) + private void ReleaseHandle() { if (_handle is null) return; - SDL.DestroyTexture(_handle); + Interop.SDL.DestroyTexture(_handle); _handle = null; } @@ -143,11 +143,11 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; Error.ThrowLastErrorIfNegative( - SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) + Interop.SDL.LockTextureToSurface(_handle, &rect, &surfaceHandle) ); var surface = new Surface(surfaceHandle, false); callback.Invoke(surface); - SDL.UnlockTexture(_handle); + Interop.SDL.UnlockTexture(_handle); } private void ThrowWhenDisposed() diff --git a/sources/SDL2Sharp/Video/TextureAccess.cs b/sources/SDL2Sharp/video/TextureAccess.cs similarity index 97% rename from sources/SDL2Sharp/Video/TextureAccess.cs rename to sources/SDL2Sharp/video/TextureAccess.cs index 962cc3ca..eb705335 100644 --- a/sources/SDL2Sharp/Video/TextureAccess.cs +++ b/sources/SDL2Sharp/video/TextureAccess.cs @@ -20,7 +20,7 @@ using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum TextureAccess : int { diff --git a/sources/SDL2Sharp/Video/TextureExtensions.cs b/sources/SDL2Sharp/video/TextureExtensions.cs similarity index 96% rename from sources/SDL2Sharp/Video/TextureExtensions.cs rename to sources/SDL2Sharp/video/TextureExtensions.cs index be3aec79..6b44a571 100644 --- a/sources/SDL2Sharp/Video/TextureExtensions.cs +++ b/sources/SDL2Sharp/video/TextureExtensions.cs @@ -18,9 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Video.PixelFormats; - -namespace SDL2Sharp.Video +namespace SDL2Sharp { public static class TextureExtensions { diff --git a/sources/SDL2Sharp/Video/VideoSubsystem.cs b/sources/SDL2Sharp/video/VideoSubsystem.cs similarity index 86% rename from sources/SDL2Sharp/Video/VideoSubsystem.cs rename to sources/SDL2Sharp/video/VideoSubsystem.cs index d861442b..5828ff59 100644 --- a/sources/SDL2Sharp/Video/VideoSubsystem.cs +++ b/sources/SDL2Sharp/video/VideoSubsystem.cs @@ -20,19 +20,18 @@ using System; using System.Collections.Generic; -using SDL2Sharp.Interop; -namespace SDL2Sharp.Video +namespace SDL2Sharp { - public sealed class VideoSubsystem : IVideoSubsystem, IDisposable + internal sealed class VideoSubsystem : IVideoSubsystem, IDisposable { - private const uint InitSubsystemFlags = SDL.SDL_INIT_VIDEO; + private const uint InitSubsystemFlags = Interop.SDL.SDL_INIT_VIDEO; public IReadOnlyList Displays { get { - var displayCount = SDL.GetNumVideoDisplays(); + var displayCount = Interop.SDL.GetNumVideoDisplays(); var displays = new List(displayCount); for (var displayIndex = 0; displayIndex < displayCount; displayIndex++) { @@ -45,13 +44,13 @@ public IReadOnlyList Displays public VideoSubsystem() { Error.ThrowLastErrorIfNegative( - SDL.InitSubSystem(InitSubsystemFlags) + Interop.SDL.InitSubSystem(InitSubsystemFlags) ); } public void Dispose() { - SDL.QuitSubSystem(InitSubsystemFlags); + Interop.SDL.QuitSubSystem(InitSubsystemFlags); } public Window CreateWindow(string title, int width, int height) diff --git a/sources/SDL2Sharp/Video/Window.cs b/sources/SDL2Sharp/video/Window.cs similarity index 80% rename from sources/SDL2Sharp/Video/Window.cs rename to sources/SDL2Sharp/video/Window.cs index 0ede912a..30f1a556 100644 --- a/sources/SDL2Sharp/Video/Window.cs +++ b/sources/SDL2Sharp/video/Window.cs @@ -19,13 +19,13 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Internals; using SDL2Sharp.Interop; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video +namespace SDL2Sharp { + public sealed unsafe class Window : IDisposable { private SDL_Window* _handle; @@ -36,7 +36,7 @@ public uint Id { ThrowWhenDisposed(); - return SDL.GetWindowID(_handle); + return Interop.SDL.GetWindowID(_handle); } } @@ -46,14 +46,14 @@ public string Title { ThrowWhenDisposed(); - return new string(SDL.GetWindowTitle(_handle)); + return new string(Interop.SDL.GetWindowTitle(_handle)); } set { ThrowWhenDisposed(); using var marshaledValue = new MarshaledString(value); - SDL.SetWindowTitle(_handle, marshaledValue); + Interop.SDL.SetWindowTitle(_handle, marshaledValue); } } @@ -64,14 +64,14 @@ public Point Position ThrowWhenDisposed(); int x, y; - SDL.GetWindowPosition(_handle, &x, &y); + Interop.SDL.GetWindowPosition(_handle, &x, &y); return new Point(x, y); } set { ThrowWhenDisposed(); - SDL.SetWindowPosition(_handle, value.X, value.Y); + Interop.SDL.SetWindowPosition(_handle, value.X, value.Y); } } @@ -82,7 +82,7 @@ public int Width ThrowWhenDisposed(); int width; - SDL.GetWindowSize(_handle, &width, null); + Interop.SDL.GetWindowSize(_handle, &width, null); return width; } } @@ -94,7 +94,7 @@ public int Height ThrowWhenDisposed(); int height; - SDL.GetWindowSize(_handle, null, &height); + Interop.SDL.GetWindowSize(_handle, null, &height); return height; } } @@ -106,14 +106,14 @@ public Size Size ThrowWhenDisposed(); int width, height; - SDL.GetWindowSize(_handle, &width, &height); + Interop.SDL.GetWindowSize(_handle, &width, &height); return new Size(width, height); } set { ThrowWhenDisposed(); - SDL.SetWindowSize(_handle, value.Width, value.Height); + Interop.SDL.SetWindowSize(_handle, value.Width, value.Height); } } @@ -124,14 +124,14 @@ public Size MinimumSize ThrowWhenDisposed(); int width, height; - SDL.GetWindowMinimumSize(_handle, &width, &height); + Interop.SDL.GetWindowMinimumSize(_handle, &width, &height); return new Size(width, height); } set { ThrowWhenDisposed(); - SDL.SetWindowMinimumSize(_handle, value.Width, value.Height); + Interop.SDL.SetWindowMinimumSize(_handle, value.Width, value.Height); } } @@ -142,14 +142,14 @@ public Size MaximumSize ThrowWhenDisposed(); int width, height; - SDL.GetWindowMaximumSize(_handle, &width, &height); + Interop.SDL.GetWindowMaximumSize(_handle, &width, &height); return new Size(width, height); } set { ThrowWhenDisposed(); - SDL.SetWindowMaximumSize(_handle, value.Width, value.Height); + Interop.SDL.SetWindowMaximumSize(_handle, value.Width, value.Height); } } @@ -161,10 +161,10 @@ public Size ClientSize int borderTop, borderLeft, borderBottom, borderRight; Error.ThrowLastErrorIfNegative( - SDL.GetWindowBordersSize(_handle, &borderTop, &borderLeft, &borderBottom, &borderRight) + Interop.SDL.GetWindowBordersSize(_handle, &borderTop, &borderLeft, &borderBottom, &borderRight) ); int windowWidth, windowHeight; - SDL.GetWindowSize(_handle, &windowWidth, &windowHeight); + Interop.SDL.GetWindowSize(_handle, &windowWidth, &windowHeight); var clientWidth = windowWidth - borderRight - borderLeft; var clientHeight = windowHeight - borderBottom - borderTop; return new Size(clientWidth, clientHeight); @@ -177,7 +177,7 @@ public PixelFormat PixelFormat { ThrowWhenDisposed(); - var pixelFormat = SDL.GetWindowPixelFormat(_handle); + var pixelFormat = Interop.SDL.GetWindowPixelFormat(_handle); Error.ThrowLastErrorIfZero(pixelFormat); return (PixelFormat)pixelFormat; } @@ -189,7 +189,7 @@ public Surface Surface { ThrowWhenDisposed(); - var surfaceHandle = SDL.GetWindowSurface(_handle); + var surfaceHandle = Interop.SDL.GetWindowSurface(_handle); Error.ThrowLastErrorIfNull(surfaceHandle); return new Surface(surfaceHandle, false); } @@ -207,7 +207,7 @@ public bool IsBordered { ThrowWhenDisposed(); - SDL.SetWindowBordered(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); + Interop.SDL.SetWindowBordered(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); } } @@ -223,7 +223,7 @@ public bool IsResizable { ThrowWhenDisposed(); - SDL.SetWindowResizable(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); + Interop.SDL.SetWindowResizable(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); } } @@ -241,7 +241,7 @@ public bool IsFullScreen var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN : 0; Error.ThrowLastErrorIfNegative( - SDL.SetWindowFullscreen(_handle, (uint)flags) + Interop.SDL.SetWindowFullscreen(_handle, (uint)flags) ); } } @@ -260,7 +260,7 @@ public bool IsFullScreenDesktop var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP : 0; Error.ThrowLastErrorIfNegative( - SDL.SetWindowFullscreen(_handle, (uint)flags) + Interop.SDL.SetWindowFullscreen(_handle, (uint)flags) ); } } @@ -276,11 +276,11 @@ public bool IsVisible } internal Window(string title, int width, int height) - : this(title, (int)SDL.SDL_WINDOWPOS_UNDEFINED, (int)SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)0) + : this(title, (int)Interop.SDL.SDL_WINDOWPOS_UNDEFINED, (int)Interop.SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)0) { } internal Window(string title, int width, int height, WindowFlags flags) - : this(title, (int)SDL.SDL_WINDOWPOS_UNDEFINED, (int)SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)flags) + : this(title, (int)Interop.SDL.SDL_WINDOWPOS_UNDEFINED, (int)Interop.SDL.SDL_WINDOWPOS_UNDEFINED, width, height, (uint)flags) { } internal Window(string title, int x, int y, int width, int height) @@ -295,13 +295,13 @@ private Window(string title, int x, int y, int width, int height, uint flags) { using var marshaledTitle = new MarshaledString(title); _handle = Error.ThrowLastErrorIfNull( - SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) + Interop.SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) ); if (!IsBordered) { Error.ThrowLastErrorIfNegative( - SDL.SetWindowHitTest(_handle, &HitTestCallback, null) + Interop.SDL.SetWindowHitTest(_handle, &HitTestCallback, null) ); } } @@ -320,7 +320,7 @@ public void Dispose() private void Dispose(bool _) { if (_handle is null) return; - SDL.DestroyWindow(_handle); + Interop.SDL.DestroyWindow(_handle); _handle = null; } @@ -328,42 +328,42 @@ public void Show() { ThrowWhenDisposed(); - SDL.ShowWindow(_handle); + Interop.SDL.ShowWindow(_handle); } public void Hide() { ThrowWhenDisposed(); - SDL.HideWindow(_handle); + Interop.SDL.HideWindow(_handle); } public void Raise() { ThrowWhenDisposed(); - SDL.RaiseWindow(_handle); + Interop.SDL.RaiseWindow(_handle); } public void Maximize() { ThrowWhenDisposed(); - SDL.MaximizeWindow(_handle); + Interop.SDL.MaximizeWindow(_handle); } public void Minimize() { ThrowWhenDisposed(); - SDL.MinimizeWindow(_handle); + Interop.SDL.MinimizeWindow(_handle); } public void Restore() { ThrowWhenDisposed(); - SDL.RestoreWindow(_handle); + Interop.SDL.RestoreWindow(_handle); } public Renderer CreateRenderer() @@ -395,10 +395,10 @@ public bool TryCreateRenderer(RendererFlags flags, out Renderer renderer, out Er { ThrowWhenDisposed(); - var handle = SDL.CreateRenderer(_handle, -1, (uint)flags); + var handle = Interop.SDL.CreateRenderer(_handle, -1, (uint)flags); if (handle is null) { - error = new Error(new string(SDL.GetError())); + error = new Error(new string(Interop.SDL.GetError())); renderer = null!; return false; } @@ -415,13 +415,13 @@ public void UpdateSurface() ThrowWhenDisposed(); Error.ThrowLastErrorIfNegative( - SDL.UpdateWindowSurface(_handle) + Interop.SDL.UpdateWindowSurface(_handle) ); } private bool HasWindowFlag(SDL_WindowFlags flag) { - var flags = (SDL_WindowFlags)SDL.GetWindowFlags(_handle); + var flags = (SDL_WindowFlags)Interop.SDL.GetWindowFlags(_handle); var hasFlag = flags.HasFlag(flag); return hasFlag; } @@ -438,7 +438,7 @@ private static unsafe SDL_HitTestResult HitTestCallback(SDL_Window* win, SDL_Poi var y = area->y; int windowWidth = 0, windowHeight = 0; - SDL.GetWindowSize(win, &windowWidth, &windowHeight); + Interop.SDL.GetWindowSize(win, &windowWidth, &windowHeight); var windowTop = 0; var windowLeft = 0; @@ -450,7 +450,7 @@ private static unsafe SDL_HitTestResult HitTestCallback(SDL_Window* win, SDL_Poi var borderBottom = 0; var borderRight = 0; #pragma warning disable CA1806 // Do not ignore method results - SDL.GetWindowBordersSize(win, &borderTop, &borderLeft, &borderBottom, &borderRight); + Interop.SDL.GetWindowBordersSize(win, &borderTop, &borderLeft, &borderBottom, &borderRight); #pragma warning restore CA1806 // Do not ignore method results var clientAreaTop = windowTop + borderTop; diff --git a/sources/SDL2Sharp/Video/WindowFlags.cs b/sources/SDL2Sharp/video/WindowFlags.cs similarity index 98% rename from sources/SDL2Sharp/Video/WindowFlags.cs rename to sources/SDL2Sharp/video/WindowFlags.cs index 8539b0fe..04ecdce9 100644 --- a/sources/SDL2Sharp/Video/WindowFlags.cs +++ b/sources/SDL2Sharp/video/WindowFlags.cs @@ -20,7 +20,7 @@ using System; -namespace SDL2Sharp.Video +namespace SDL2Sharp { [Flags] public enum WindowFlags diff --git a/sources/SDL2Sharp/Video/YUVConversionMode.cs b/sources/SDL2Sharp/video/YUVConversionMode.cs similarity index 98% rename from sources/SDL2Sharp/Video/YUVConversionMode.cs rename to sources/SDL2Sharp/video/YUVConversionMode.cs index 9154960b..3a2341be 100644 --- a/sources/SDL2Sharp/Video/YUVConversionMode.cs +++ b/sources/SDL2Sharp/video/YUVConversionMode.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video +namespace SDL2Sharp { public enum YUVConversionMode { diff --git a/sources/SDL2Sharp/Video/YUVImage.cs b/sources/SDL2Sharp/video/YUVImage.cs similarity index 97% rename from sources/SDL2Sharp/Video/YUVImage.cs rename to sources/SDL2Sharp/video/YUVImage.cs index e1e7aaf1..892da554 100644 --- a/sources/SDL2Sharp/Video/YUVImage.cs +++ b/sources/SDL2Sharp/video/YUVImage.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public readonly ref struct YUVImage where TYUVFormat : IYUVFormat { diff --git a/sources/SDL2Sharp/Video/YUVMemoryImage.cs b/sources/SDL2Sharp/video/YUVMemoryImage.cs similarity index 97% rename from sources/SDL2Sharp/Video/YUVMemoryImage.cs rename to sources/SDL2Sharp/video/YUVMemoryImage.cs index 5d6eaec3..898d3393 100644 --- a/sources/SDL2Sharp/Video/YUVMemoryImage.cs +++ b/sources/SDL2Sharp/video/YUVMemoryImage.cs @@ -20,9 +20,8 @@ using System; using System.Runtime.CompilerServices; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed class YUVMemoryImage { diff --git a/sources/SDL2Sharp/Video/YUVTexture.cs b/sources/SDL2Sharp/video/YUVTexture.cs similarity index 88% rename from sources/SDL2Sharp/Video/YUVTexture.cs rename to sources/SDL2Sharp/video/YUVTexture.cs index c4231d7a..e6713383 100644 --- a/sources/SDL2Sharp/Video/YUVTexture.cs +++ b/sources/SDL2Sharp/video/YUVTexture.cs @@ -20,9 +20,8 @@ using System; using SDL2Sharp.Interop; -using SDL2Sharp.Video.PixelFormats; -namespace SDL2Sharp.Video +namespace SDL2Sharp { public sealed unsafe partial class YUVTexture : IDisposable where TYUVFormat : IYUVFormat { @@ -59,18 +58,7 @@ internal YUVTexture(Texture texture) _texture = texture; } - ~YUVTexture() - { - Dispose(false); - } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) { if (_texture is null) return; _texture.Dispose(); @@ -95,18 +83,18 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) void* pixels; int pitch; Error.ThrowLastErrorIfNegative( - SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) + Interop.SDL.LockTexture(_texture.Handle, &rect, &pixels, &pitch) ); var image = new YUVImage(pixels, width, height, pitch); callback.Invoke(image); - SDL.UnlockTexture(_texture.Handle); + Interop.SDL.UnlockTexture(_texture.Handle); } public void Update(YUVImage image) { Error.ThrowLastErrorIfNegative( - SDL.UpdateYUVTexture(_texture.Handle, null, + Interop.SDL.UpdateYUVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.U, image.U.Pitch, (byte*)image.V, image.V.Pitch @@ -117,7 +105,7 @@ public void Update(YUVImage image) public void Update(YUVMemoryImage image) { Error.ThrowLastErrorIfNegative( - SDL.UpdateYUVTexture(_texture.Handle, null, + Interop.SDL.UpdateYUVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, (byte*)image.U, image.U.Pitch, (byte*)image.V, image.V.Pitch diff --git a/sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs b/sources/SDL2Sharp/video/pixels/ABGR1555.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs rename to sources/SDL2Sharp/video/pixels/ABGR1555.cs index f81128df..b86496c4 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ABGR1555.cs +++ b/sources/SDL2Sharp/video/pixels/ABGR1555.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct ABGR1555 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs b/sources/SDL2Sharp/video/pixels/ABGR4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs rename to sources/SDL2Sharp/video/pixels/ABGR4444.cs index 4efd499b..0185e66d 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ABGR4444.cs +++ b/sources/SDL2Sharp/video/pixels/ABGR4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct ABGR4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs b/sources/SDL2Sharp/video/pixels/ABGR8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs rename to sources/SDL2Sharp/video/pixels/ABGR8888.cs index 6bd5706f..33babdd1 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ABGR8888.cs +++ b/sources/SDL2Sharp/video/pixels/ABGR8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct ABGR8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs b/sources/SDL2Sharp/video/pixels/ARGB1555.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs rename to sources/SDL2Sharp/video/pixels/ARGB1555.cs index 6f592953..d6989eae 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ARGB1555.cs +++ b/sources/SDL2Sharp/video/pixels/ARGB1555.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct ARGB1555 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs b/sources/SDL2Sharp/video/pixels/ARGB2101010.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs rename to sources/SDL2Sharp/video/pixels/ARGB2101010.cs index 9c10017b..98893e34 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ARGB2101010.cs +++ b/sources/SDL2Sharp/video/pixels/ARGB2101010.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct ARGB2101010 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs b/sources/SDL2Sharp/video/pixels/ARGB4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs rename to sources/SDL2Sharp/video/pixels/ARGB4444.cs index be3303ec..fcb7c452 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ARGB4444.cs +++ b/sources/SDL2Sharp/video/pixels/ARGB4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct ARGB4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs b/sources/SDL2Sharp/video/pixels/ARGB8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs rename to sources/SDL2Sharp/video/pixels/ARGB8888.cs index e2835029..e0fb91db 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/ARGB8888.cs +++ b/sources/SDL2Sharp/video/pixels/ARGB8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct ARGB8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGR24.cs b/sources/SDL2Sharp/video/pixels/BGR24.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/BGR24.cs rename to sources/SDL2Sharp/video/pixels/BGR24.cs index 97b08691..b1c1192b 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGR24.cs +++ b/sources/SDL2Sharp/video/pixels/BGR24.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] public readonly record struct BGR24 diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGR565.cs b/sources/SDL2Sharp/video/pixels/BGR565.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/BGR565.cs rename to sources/SDL2Sharp/video/pixels/BGR565.cs index 99ebf39e..a7a5e769 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGR565.cs +++ b/sources/SDL2Sharp/video/pixels/BGR565.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct BGR565 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs b/sources/SDL2Sharp/video/pixels/BGRA4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs rename to sources/SDL2Sharp/video/pixels/BGRA4444.cs index 9da9518a..aba91336 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGRA4444.cs +++ b/sources/SDL2Sharp/video/pixels/BGRA4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct BGRA4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs b/sources/SDL2Sharp/video/pixels/BGRA5551.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs rename to sources/SDL2Sharp/video/pixels/BGRA5551.cs index 15ebf9f6..5786b28f 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGRA5551.cs +++ b/sources/SDL2Sharp/video/pixels/BGRA5551.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct BGRA5551 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs b/sources/SDL2Sharp/video/pixels/BGRA8888.cs similarity index 95% rename from sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs rename to sources/SDL2Sharp/video/pixels/BGRA8888.cs index df40a367..4c64c0f6 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGRA8888.cs +++ b/sources/SDL2Sharp/video/pixels/BGRA8888.cs @@ -18,9 +18,10 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct BGRA8888 : IPackedPixel @@ -62,7 +63,7 @@ private BGRA8888(uint value) public static BGRA8888 FromRGB(byte r, byte g, byte b) { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } } } diff --git a/sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs b/sources/SDL2Sharp/video/pixels/BGRX8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs rename to sources/SDL2Sharp/video/pixels/BGRX8888.cs index 4c80e7b8..0626b0d4 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/BGRX8888.cs +++ b/sources/SDL2Sharp/video/pixels/BGRX8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct BGRX8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs b/sources/SDL2Sharp/video/pixels/IPackedPixel.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs rename to sources/SDL2Sharp/video/pixels/IPackedPixel.cs index a7b1e871..fb171006 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/IPackedPixel.cs +++ b/sources/SDL2Sharp/video/pixels/IPackedPixel.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { public interface IPackedPixel where TPackedPixel : struct { diff --git a/sources/SDL2Sharp/Video/PixelFormats/IYUV.cs b/sources/SDL2Sharp/video/pixels/IYUV.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/IYUV.cs rename to sources/SDL2Sharp/video/pixels/IYUV.cs index 805fe7e5..40b308d1 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/IYUV.cs +++ b/sources/SDL2Sharp/video/pixels/IYUV.cs @@ -20,7 +20,7 @@ using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { public readonly struct IYUV : IYUVFormat { diff --git a/sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs b/sources/SDL2Sharp/video/pixels/IYUVFormat.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs rename to sources/SDL2Sharp/video/pixels/IYUVFormat.cs index 71714d36..b55962d7 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/IYUVFormat.cs +++ b/sources/SDL2Sharp/video/pixels/IYUVFormat.cs @@ -18,7 +18,7 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { public interface IYUVFormat { diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGB24.cs b/sources/SDL2Sharp/video/pixels/RGB24.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/RGB24.cs rename to sources/SDL2Sharp/video/pixels/RGB24.cs index 404ed0a5..985015c5 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGB24.cs +++ b/sources/SDL2Sharp/video/pixels/RGB24.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 3)] public readonly record struct RGB24 diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGB332.cs b/sources/SDL2Sharp/video/pixels/RGB332.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGB332.cs rename to sources/SDL2Sharp/video/pixels/RGB332.cs index f4e91860..c7674226 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGB332.cs +++ b/sources/SDL2Sharp/video/pixels/RGB332.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct RGB332 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGB565.cs b/sources/SDL2Sharp/video/pixels/RGB565.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGB565.cs rename to sources/SDL2Sharp/video/pixels/RGB565.cs index e06703b4..d8536c49 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGB565.cs +++ b/sources/SDL2Sharp/video/pixels/RGB565.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct RGB565 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs b/sources/SDL2Sharp/video/pixels/RGB96f.cs similarity index 99% rename from sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs rename to sources/SDL2Sharp/video/pixels/RGB96f.cs index 664c7af6..5306f406 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGB96f.cs +++ b/sources/SDL2Sharp/video/pixels/RGB96f.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 12)] public readonly struct RGB96f : IEquatable diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs b/sources/SDL2Sharp/video/pixels/RGB96fExtensions.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs rename to sources/SDL2Sharp/video/pixels/RGB96fExtensions.cs index 40ebe06d..fd420c93 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGB96fExtensions.cs +++ b/sources/SDL2Sharp/video/pixels/RGB96fExtensions.cs @@ -20,7 +20,7 @@ using static System.Math; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { public static class RGB96fExtensions { diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs b/sources/SDL2Sharp/video/pixels/RGBA4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs rename to sources/SDL2Sharp/video/pixels/RGBA4444.cs index 4cf18f25..38887247 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGBA4444.cs +++ b/sources/SDL2Sharp/video/pixels/RGBA4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct RGBA4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs b/sources/SDL2Sharp/video/pixels/RGBA5551.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs rename to sources/SDL2Sharp/video/pixels/RGBA5551.cs index f51ff014..232308da 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGBA5551.cs +++ b/sources/SDL2Sharp/video/pixels/RGBA5551.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct RGBA5551 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs b/sources/SDL2Sharp/video/pixels/RGBA8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs rename to sources/SDL2Sharp/video/pixels/RGBA8888.cs index fd197786..e4d18298 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGBA8888.cs +++ b/sources/SDL2Sharp/video/pixels/RGBA8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct RGBA8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs b/sources/SDL2Sharp/video/pixels/RGBX8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs rename to sources/SDL2Sharp/video/pixels/RGBX8888.cs index 802ce627..853bd7a8 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/RGBX8888.cs +++ b/sources/SDL2Sharp/video/pixels/RGBX8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct RGBX8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/U8.cs b/sources/SDL2Sharp/video/pixels/U8.cs similarity index 96% rename from sources/SDL2Sharp/Video/PixelFormats/U8.cs rename to sources/SDL2Sharp/video/pixels/U8.cs index aa369d9d..db6cc563 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/U8.cs +++ b/sources/SDL2Sharp/video/pixels/U8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct U8 diff --git a/sources/SDL2Sharp/Video/PixelFormats/UV88.cs b/sources/SDL2Sharp/video/pixels/UV88.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/UV88.cs rename to sources/SDL2Sharp/video/pixels/UV88.cs index d957633b..3e7f435b 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/UV88.cs +++ b/sources/SDL2Sharp/video/pixels/UV88.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct UV88 diff --git a/sources/SDL2Sharp/Video/PixelFormats/UYVY.cs b/sources/SDL2Sharp/video/pixels/UYVY.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/UYVY.cs rename to sources/SDL2Sharp/video/pixels/UYVY.cs index 76099d6d..1f14d2ce 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/UYVY.cs +++ b/sources/SDL2Sharp/video/pixels/UYVY.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct UYVY diff --git a/sources/SDL2Sharp/Video/PixelFormats/V8.cs b/sources/SDL2Sharp/video/pixels/V8.cs similarity index 96% rename from sources/SDL2Sharp/Video/PixelFormats/V8.cs rename to sources/SDL2Sharp/video/pixels/V8.cs index eb36cb2c..83285a49 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/V8.cs +++ b/sources/SDL2Sharp/video/pixels/V8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct V8 diff --git a/sources/SDL2Sharp/Video/PixelFormats/VU88.cs b/sources/SDL2Sharp/video/pixels/VU88.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/VU88.cs rename to sources/SDL2Sharp/video/pixels/VU88.cs index 8056d4a0..59eb9e2e 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/VU88.cs +++ b/sources/SDL2Sharp/video/pixels/VU88.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct VU88 diff --git a/sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs b/sources/SDL2Sharp/video/pixels/XBGR1555.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs rename to sources/SDL2Sharp/video/pixels/XBGR1555.cs index a305126f..56fdc6d8 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XBGR1555.cs +++ b/sources/SDL2Sharp/video/pixels/XBGR1555.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct XBGR1555 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs b/sources/SDL2Sharp/video/pixels/XBGR4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs rename to sources/SDL2Sharp/video/pixels/XBGR4444.cs index 703926d8..338d7809 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XBGR4444.cs +++ b/sources/SDL2Sharp/video/pixels/XBGR4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct XBGR4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs b/sources/SDL2Sharp/video/pixels/XBGR8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs rename to sources/SDL2Sharp/video/pixels/XBGR8888.cs index 7dc8c5c7..11ff6f85 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XBGR8888.cs +++ b/sources/SDL2Sharp/video/pixels/XBGR8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct XBGR8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs b/sources/SDL2Sharp/video/pixels/XRGB1555.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs rename to sources/SDL2Sharp/video/pixels/XRGB1555.cs index b53ecae9..9e65a844 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XRGB1555.cs +++ b/sources/SDL2Sharp/video/pixels/XRGB1555.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct XRGB1555 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs b/sources/SDL2Sharp/video/pixels/XRGB4444.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs rename to sources/SDL2Sharp/video/pixels/XRGB4444.cs index 86a9459c..1c01e24d 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XRGB4444.cs +++ b/sources/SDL2Sharp/video/pixels/XRGB4444.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 2, Size = 2)] public readonly record struct XRGB4444 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs b/sources/SDL2Sharp/video/pixels/XRGB8888.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs rename to sources/SDL2Sharp/video/pixels/XRGB8888.cs index ad10ba74..b4829368 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/XRGB8888.cs +++ b/sources/SDL2Sharp/video/pixels/XRGB8888.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct XRGB8888 : IPackedPixel diff --git a/sources/SDL2Sharp/Video/PixelFormats/Y8.cs b/sources/SDL2Sharp/video/pixels/Y8.cs similarity index 96% rename from sources/SDL2Sharp/Video/PixelFormats/Y8.cs rename to sources/SDL2Sharp/video/pixels/Y8.cs index a86c4460..089cc3cf 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/Y8.cs +++ b/sources/SDL2Sharp/video/pixels/Y8.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 1)] public readonly record struct Y8 diff --git a/sources/SDL2Sharp/Video/PixelFormats/YUY2.cs b/sources/SDL2Sharp/video/pixels/YUY2.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/YUY2.cs rename to sources/SDL2Sharp/video/pixels/YUY2.cs index 6ecc8723..562f6e38 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/YUY2.cs +++ b/sources/SDL2Sharp/video/pixels/YUY2.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct YUY2 diff --git a/sources/SDL2Sharp/Video/PixelFormats/YV12.cs b/sources/SDL2Sharp/video/pixels/YV12.cs similarity index 98% rename from sources/SDL2Sharp/Video/PixelFormats/YV12.cs rename to sources/SDL2Sharp/video/pixels/YV12.cs index 9e2c4d21..8e62dc8a 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/YV12.cs +++ b/sources/SDL2Sharp/video/pixels/YV12.cs @@ -20,7 +20,7 @@ using System.Runtime.CompilerServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { public readonly struct YV12 : IYUVFormat { diff --git a/sources/SDL2Sharp/Video/PixelFormats/YVYU.cs b/sources/SDL2Sharp/video/pixels/YVYU.cs similarity index 97% rename from sources/SDL2Sharp/Video/PixelFormats/YVYU.cs rename to sources/SDL2Sharp/video/pixels/YVYU.cs index d2b41144..3324a228 100644 --- a/sources/SDL2Sharp/Video/PixelFormats/YVYU.cs +++ b/sources/SDL2Sharp/video/pixels/YVYU.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; -namespace SDL2Sharp.Video.PixelFormats +namespace SDL2Sharp { [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 4)] public readonly record struct YVYU diff --git a/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs b/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs similarity index 98% rename from tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs rename to tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs index 2ac8bec3..77ffa6e5 100644 --- a/tests/SDL2Sharp.Tests/AudioFormatExtensionTests.cs +++ b/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs @@ -18,7 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Audio; using Xunit; namespace SDL2Sharp.Tests diff --git a/tests/SDL2Sharp.Tests/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs similarity index 96% rename from tests/SDL2Sharp.Tests/PackedTextureTests.cs rename to tests/SDL2Sharp.Tests/video/PackedTextureTests.cs index 5a969c1b..640158ea 100644 --- a/tests/SDL2Sharp.Tests/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs @@ -19,8 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -175,9 +173,11 @@ public static void WriteAndReadRgb565() => WriteAndRead( private static void WriteAndRead(Func colorGenerator) where TPackedPixelFormat : struct, IPackedPixel { - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("PackedTextureTests", 640, 480, WindowFlags.Hidden); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles + + using var window = SDL.Video.CreateWindow("PackedTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(RendererFlags.Software | RendererFlags.TargetTexture); using var sourceTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var targetTexture = renderer.CreatePackedTexture(TextureAccess.Target, renderer.OutputSize); diff --git a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs similarity index 86% rename from tests/SDL2Sharp.Tests/PlanarTextureTests.cs rename to tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs index e4ad097b..e1a1713c 100644 --- a/tests/SDL2Sharp.Tests/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs @@ -18,8 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -35,9 +33,11 @@ public static class PlanarTextureTests private static void WriteAndRead() where TYUVFormat : struct, IYUVFormat { - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles + + using var window = SDL.Video.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateYUVTexture(TextureAccess.Streaming, renderer.OutputSize); diff --git a/tests/SDL2Sharp.Tests/SurfaceTests.cs b/tests/SDL2Sharp.Tests/video/SurfaceTests.cs similarity index 96% rename from tests/SDL2Sharp.Tests/SurfaceTests.cs rename to tests/SDL2Sharp.Tests/video/SurfaceTests.cs index 64f0c443..71ada501 100644 --- a/tests/SDL2Sharp.Tests/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/video/SurfaceTests.cs @@ -18,8 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests diff --git a/tests/SDL2Sharp.Tests/TextureTests.cs b/tests/SDL2Sharp.Tests/video/TextureTests.cs similarity index 94% rename from tests/SDL2Sharp.Tests/TextureTests.cs rename to tests/SDL2Sharp.Tests/video/TextureTests.cs index ab866b13..88a15dc8 100644 --- a/tests/SDL2Sharp.Tests/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/TextureTests.cs @@ -19,8 +19,6 @@ // 3. This notice may not be removed or altered from any source distribution. using System; -using SDL2Sharp.Video; -using SDL2Sharp.Video.PixelFormats; using Xunit; namespace SDL2Sharp.Tests @@ -123,9 +121,11 @@ public void CreateTextureOfYV12() private static void WithRenderer(Action test) { - using var mainSystem = new MainSystem(); - using var videoSystem = new VideoSubsystem(); - using var window = videoSystem.CreateWindow("TextureTests", 640, 480, WindowFlags.Hidden); +#pragma warning disable IDE1006 // Naming Styles + using var SDL = new SDL(); +#pragma warning restore IDE1006 // Naming Styles + + using var window = SDL.Video.CreateWindow("TextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); test(renderer); } diff --git a/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs b/tests/SDL2Sharp.Tests/video/pixels/Argb2101010Tests.cs similarity index 96% rename from tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs rename to tests/SDL2Sharp.Tests/video/pixels/Argb2101010Tests.cs index 4d639374..246bb154 100644 --- a/tests/SDL2Sharp.Tests/Colors/Argb2101010Tests.cs +++ b/tests/SDL2Sharp.Tests/video/pixels/Argb2101010Tests.cs @@ -18,10 +18,9 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using SDL2Sharp.Video.PixelFormats; using Xunit; -namespace SDL2Sharp.Tests.Colors +namespace SDL2Sharp.Tests { public static class Argb2101010Tests { From 7f69e583da4c4a87a3de7206dad53e1346801184 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 2 Mar 2025 14:29:01 +0100 Subject: [PATCH 58/62] Redesign Disposable implementation. --- samples/TunnelEffect/Program.cs | 1 - sources/SDL2Sharp/audio/AudioSubsystem.cs | 22 +++- sources/SDL2Sharp/audio/WaveFile.cs | 15 +-- sources/SDL2Sharp/basics/DisposableObject.cs | 51 +++++++++ sources/SDL2Sharp/basics/FinalizableObject.cs | 27 +++++ sources/SDL2Sharp/basics/SDL.cs | 71 ++++++------ sources/SDL2Sharp/events/EventsSubsystem.cs | 10 +- sources/SDL2Sharp/fonts/Font.cs | 25 +---- sources/SDL2Sharp/fonts/FontSubsystem.cs | 12 ++- sources/SDL2Sharp/internals/Utilities.cs | 34 ++++++ sources/SDL2Sharp/mouse/SDL.cs | 2 - sources/SDL2Sharp/video/NV12Texture.cs | 97 +++++++++++++---- sources/SDL2Sharp/video/NV21Texture.cs | 97 +++++++++++++---- sources/SDL2Sharp/video/PackedTexture.cs | 101 +++++++++++++----- .../SDL2Sharp/video/PixelFormatDescriptor.cs | 15 +-- sources/SDL2Sharp/video/Renderer.cs | 84 ++++++--------- sources/SDL2Sharp/video/Surface.cs | 22 +--- sources/SDL2Sharp/video/Surface{T}.cs | 37 +++---- sources/SDL2Sharp/video/Texture.cs | 46 ++++---- sources/SDL2Sharp/video/VideoSubsystem.cs | 20 +++- sources/SDL2Sharp/video/Window.cs | 88 +++++++-------- sources/SDL2Sharp/video/YUVTexture.cs | 97 +++++++++++++---- 22 files changed, 628 insertions(+), 346 deletions(-) create mode 100644 sources/SDL2Sharp/basics/DisposableObject.cs create mode 100644 sources/SDL2Sharp/basics/FinalizableObject.cs create mode 100644 sources/SDL2Sharp/internals/Utilities.cs diff --git a/samples/TunnelEffect/Program.cs b/samples/TunnelEffect/Program.cs index daecff85..5a0f9bd1 100644 --- a/samples/TunnelEffect/Program.cs +++ b/samples/TunnelEffect/Program.cs @@ -36,7 +36,6 @@ public static void Main() using var screenTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); using var lazyFont = SDL.Fonts.OpenFont("lazy.ttf", 28); - var screenSize = renderer.OutputSize; var screenImage = new PackedMemoryImage(renderer.OutputSize); var sourceImageSize = NextPowerOfTwo(Max(renderer.OutputWidth, renderer.OutputHeight)); var sourceImage = GenerateXorImage(sourceImageSize); diff --git a/sources/SDL2Sharp/audio/AudioSubsystem.cs b/sources/SDL2Sharp/audio/AudioSubsystem.cs index 776960f4..b52a9c7b 100644 --- a/sources/SDL2Sharp/audio/AudioSubsystem.cs +++ b/sources/SDL2Sharp/audio/AudioSubsystem.cs @@ -18,48 +18,62 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - namespace SDL2Sharp { - internal sealed class AudioSubsystem : IAudioSubsystem, IDisposable + internal sealed class AudioSubsystem : FinalizableObject, IAudioSubsystem { private const uint InitSubsystemFlags = Interop.SDL.SDL_INIT_AUDIO; + private bool _fullyInitialized; + public AudioSubsystem() { Error.ThrowLastErrorIfNegative( Interop.SDL.InitSubSystem(InitSubsystemFlags) ); + + _fullyInitialized = true; } - public void Dispose() + protected override void Dispose(bool disposing) { + if (!_fullyInitialized) return; Interop.SDL.QuitSubSystem(InitSubsystemFlags); + _fullyInitialized = false; } public AudioDevice CreateDevice() { + ThrowIfDisposed(); + return new AudioDevice(); } public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples) { + ThrowIfDisposed(); + return new AudioDevice(frequency, format, channels, samples); } public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback) { + ThrowIfDisposed(); + return new AudioDevice(frequency, format, channels, samples, callback); } public AudioDevice OpenDevice(int frequency, AudioFormat format, AudioChannelLayout channels, ushort samples, AudioDeviceCallback callback, AudioDeviceAllowedChanges allowedChanges) { + ThrowIfDisposed(); + return new AudioDevice(frequency, format, channels, samples, callback, allowedChanges); } public WaveFile OpenWaveFile(string filename) { + ThrowIfDisposed(); + return new WaveFile(filename); } } diff --git a/sources/SDL2Sharp/audio/WaveFile.cs b/sources/SDL2Sharp/audio/WaveFile.cs index 3c08da0a..9b7e8b5a 100644 --- a/sources/SDL2Sharp/audio/WaveFile.cs +++ b/sources/SDL2Sharp/audio/WaveFile.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp { - public sealed unsafe class WaveFile : IDisposable + public sealed unsafe class WaveFile : FinalizableObject { private SDL_AudioSpec _waveSpec; @@ -65,18 +65,9 @@ internal WaveFile(string filename) } } - ~WaveFile() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } + ~WaveFile() => Dispose(false); - private void Dispose(bool _) + protected override void Dispose(bool _) { if (_waveBuffer != null) { diff --git a/sources/SDL2Sharp/basics/DisposableObject.cs b/sources/SDL2Sharp/basics/DisposableObject.cs new file mode 100644 index 00000000..c12c2664 --- /dev/null +++ b/sources/SDL2Sharp/basics/DisposableObject.cs @@ -0,0 +1,51 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; +using System.Threading; + +namespace SDL2Sharp +{ + public abstract class DisposableObject : IDisposable + { + private volatile uint _disposed = 0; + + public bool IsDisposed => _disposed != 0; + + ~DisposableObject() + { + Dispose(false); + } + + public void Dispose() + { + if (Interlocked.Exchange(ref _disposed, 1) == 0) return; + Dispose(true); + GC.SuppressFinalize(this); + } + + protected abstract void Dispose(bool disposing); + + protected void ThrowIfDisposed() + { + ObjectDisposedException.ThrowIf(_disposed != 0, this); + } + } +} \ No newline at end of file diff --git a/sources/SDL2Sharp/basics/FinalizableObject.cs b/sources/SDL2Sharp/basics/FinalizableObject.cs new file mode 100644 index 00000000..dcaa6bf2 --- /dev/null +++ b/sources/SDL2Sharp/basics/FinalizableObject.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +namespace SDL2Sharp +{ + public abstract class FinalizableObject : DisposableObject + { + ~FinalizableObject() => Dispose(false); + } +} diff --git a/sources/SDL2Sharp/basics/SDL.cs b/sources/SDL2Sharp/basics/SDL.cs index df0c1b91..512ade00 100644 --- a/sources/SDL2Sharp/basics/SDL.cs +++ b/sources/SDL2Sharp/basics/SDL.cs @@ -18,11 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; +using static SDL2Sharp.Utilities; namespace SDL2Sharp { - public sealed class SDL : IDisposable + public sealed partial class SDL : FinalizableObject { private VideoSubsystem? _videoSubsystem; @@ -32,43 +32,55 @@ public sealed class SDL : IDisposable private FontSubsystem? _fontSubsystem; - private bool _disposed = false; - - public IVideoSubsystem Video => _videoSubsystem ??= new VideoSubsystem(); - - public IAudioSubsystem Audio => _audioSubsystem ??= new AudioSubsystem(); + public IVideoSubsystem Video + { + get + { + ThrowIfDisposed(); - public IEventsSubsystem Events => _eventsSubsystem ??= new EventsSubsystem(); + return _videoSubsystem ??= new VideoSubsystem(); + } + } - public IFontSubsystem Fonts => _fontSubsystem ??= new FontSubsystem(); + public IAudioSubsystem Audio + { + get + { + ThrowIfDisposed(); - public bool IsDisposed => _disposed; + return _audioSubsystem ??= new AudioSubsystem(); + } + } - public SDL() + public IEventsSubsystem Events { - Error.ThrowLastErrorIfNegative( - Interop.SDL.Init(0) - ); + get + { + ThrowIfDisposed(); + + return _eventsSubsystem ??= new EventsSubsystem(); + } } - ~SDL() + public IFontSubsystem Fonts { - Dispose(false); + get + { + ThrowIfDisposed(); + + return _fontSubsystem ??= new FontSubsystem(); + } } - public void Dispose() + public SDL() { - Dispose(true); - GC.SuppressFinalize(this); + Error.ThrowLastErrorIfNegative( + Interop.SDL.Init(0) + ); } - private void Dispose(bool disposing) + protected override void Dispose(bool disposing) { - if (_disposed) - { - return; - } - if (disposing) { SafeDispose(ref _videoSubsystem); @@ -78,15 +90,6 @@ private void Dispose(bool disposing) } Interop.SDL.Quit(); - - _disposed = true; - } - - private static void SafeDispose(ref TDisposable? disposable) where TDisposable : IDisposable - { - var temp = disposable; - disposable = default; - temp?.Dispose(); } } } diff --git a/sources/SDL2Sharp/events/EventsSubsystem.cs b/sources/SDL2Sharp/events/EventsSubsystem.cs index 787dd2d6..d484cb87 100644 --- a/sources/SDL2Sharp/events/EventsSubsystem.cs +++ b/sources/SDL2Sharp/events/EventsSubsystem.cs @@ -26,7 +26,7 @@ namespace SDL2Sharp { - internal sealed unsafe class EventsSubsystem : IEventsSubsystem, IDisposable + internal sealed unsafe class EventsSubsystem : FinalizableObject, IEventsSubsystem { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int EventWatchCallbackDelegate(void* userdata, SDL_Event* @event); @@ -48,15 +48,11 @@ public EventsSubsystem() Interop.SDL.AddEventWatch(&OnEventWatchCallback, watchUserDataPointer); } - public void Dispose() + protected override void Dispose(bool disposing) { var watchUserDataPointer = (void*)(IntPtr)_watchCallbackUserData; Interop.SDL.DelEventWatch(&OnEventWatchCallback, watchUserDataPointer); - - if (_watchCallbackUserData.IsAllocated) - { - _watchCallbackUserData.Free(); - } + _watchCallbackUserData.Free(); Interop.SDL.QuitSubSystem(InitSubsystemFlags); } diff --git a/sources/SDL2Sharp/fonts/Font.cs b/sources/SDL2Sharp/fonts/Font.cs index 8854e4cb..a1d3daab 100644 --- a/sources/SDL2Sharp/fonts/Font.cs +++ b/sources/SDL2Sharp/fonts/Font.cs @@ -18,12 +18,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using SDL2Sharp.Interop; namespace SDL2Sharp { - public sealed unsafe class Font : IDisposable + public sealed unsafe class Font : FinalizableObject { private _TTF_Font* _handle; @@ -37,18 +36,7 @@ internal Font(string path, int pointSize) _handle = handle; } - ~Font() - { - Dispose(true); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) + protected override void Dispose(bool disposing) { if (_handle is null) return; TTF.CloseFont(_handle); @@ -57,7 +45,7 @@ private void Dispose(bool _) public Surface RenderSolid(string text, Color color) { - ThrowWhenDisposed(); + ThrowIfDisposed(); using var marshaledText = new MarshaledString(text); var surfaceHandle = TTF.RenderText_Solid(_handle, marshaledText, color); @@ -66,16 +54,11 @@ public Surface RenderSolid(string text, Color color) public Surface RenderBlended(string text, Color color) { - ThrowWhenDisposed(); + ThrowIfDisposed(); using var marshaledText = new MarshaledString(text); var surfaceHandle = TTF.RenderText_Blended(_handle, marshaledText, color); return new Surface(surfaceHandle); } - - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_handle is null, this); - } } } diff --git a/sources/SDL2Sharp/fonts/FontSubsystem.cs b/sources/SDL2Sharp/fonts/FontSubsystem.cs index e075832c..ac1749ac 100644 --- a/sources/SDL2Sharp/fonts/FontSubsystem.cs +++ b/sources/SDL2Sharp/fonts/FontSubsystem.cs @@ -18,27 +18,33 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using SDL2Sharp.Interop; namespace SDL2Sharp { - internal sealed class FontSubsystem : IFontSubsystem, IDisposable + internal sealed class FontSubsystem : FinalizableObject, IFontSubsystem { + private bool _fullyInitialized; + public FontSubsystem() { Error.ThrowLastErrorIfNegative( TTF.Init() ); + _fullyInitialized = true; } - public void Dispose() + protected override void Dispose(bool disposing) { + if (!_fullyInitialized) return; TTF.Quit(); + _fullyInitialized = false; } public Font OpenFont(string path, int pointSize) { + ThrowIfDisposed(); + return new Font(path, pointSize); } } diff --git a/sources/SDL2Sharp/internals/Utilities.cs b/sources/SDL2Sharp/internals/Utilities.cs new file mode 100644 index 00000000..2eca7948 --- /dev/null +++ b/sources/SDL2Sharp/internals/Utilities.cs @@ -0,0 +1,34 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using System; + +namespace SDL2Sharp +{ + internal static class Utilities + { + public static void SafeDispose(ref TDisposable? disposable) where TDisposable : IDisposable + { + var temp = disposable; + disposable = default; + temp?.Dispose(); + } + } +} \ No newline at end of file diff --git a/sources/SDL2Sharp/mouse/SDL.cs b/sources/SDL2Sharp/mouse/SDL.cs index 44c051fa..5dfd8073 100644 --- a/sources/SDL2Sharp/mouse/SDL.cs +++ b/sources/SDL2Sharp/mouse/SDL.cs @@ -18,8 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; - namespace SDL2Sharp { public sealed partial class SDL diff --git a/sources/SDL2Sharp/video/NV12Texture.cs b/sources/SDL2Sharp/video/NV12Texture.cs index ab6b4b62..3f995266 100644 --- a/sources/SDL2Sharp/video/NV12Texture.cs +++ b/sources/SDL2Sharp/video/NV12Texture.cs @@ -23,28 +23,87 @@ namespace SDL2Sharp { - public sealed unsafe class NV12Texture : IDisposable + public sealed unsafe class NV12Texture : DisposableObject { public delegate void LockCallback(NV12Image pixels); - private Texture _texture; + private readonly Texture _texture; - public PixelFormat Format => _texture.Format; + public PixelFormat Format + { + get + { + ThrowIfDisposed(); + + return _texture.Format; + } + } + + public TextureAccess Access + { + get + { + ThrowIfDisposed(); + + return _texture.Access; + } + } - public TextureAccess Access => _texture.Access; + public int Width + { + get + { + ThrowIfDisposed(); - public int Width => _texture.Width; + return _texture.Width; + } + } - public int Height => _texture.Height; + public int Height + { + get + { + ThrowIfDisposed(); + + return _texture.Height; + } + } + + public Size Size + { + get + { + ThrowIfDisposed(); + + return _texture.Size; + } + } public BlendMode BlendMode { - get => _texture.BlendMode; + get + { + ThrowIfDisposed(); - set => _texture.BlendMode = value; + return _texture.BlendMode; + } + set + { + ThrowIfDisposed(); + + _texture.BlendMode = value; + } } - public bool IsValid => _texture.IsValid; + public bool IsValid + { + get + { + ThrowIfDisposed(); + + return _texture.IsValid; + } + } internal NV12Texture(Texture texture) { @@ -58,11 +117,12 @@ internal NV12Texture(Texture texture) _texture = texture; } - public void Dispose() + protected override void Dispose(bool disposing) { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; + if (disposing) + { + _texture?.Dispose(); + } } public void WithLock(LockCallback callback) @@ -79,7 +139,7 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) { ArgumentNullException.ThrowIfNull(callback); - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; @@ -95,6 +155,8 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) public void Update(NV12Image image) { + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -106,6 +168,8 @@ public void Update(NV12MemoryImage image) { ArgumentNullException.ThrowIfNull(image); + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -114,11 +178,6 @@ public void Update(NV12MemoryImage image) ); } - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_texture is null, this); - } - public static implicit operator Texture(NV12Texture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/video/NV21Texture.cs b/sources/SDL2Sharp/video/NV21Texture.cs index f1c85e46..3aecc047 100644 --- a/sources/SDL2Sharp/video/NV21Texture.cs +++ b/sources/SDL2Sharp/video/NV21Texture.cs @@ -23,28 +23,87 @@ namespace SDL2Sharp { - public sealed unsafe class NV21Texture : IDisposable + public sealed unsafe class NV21Texture : DisposableObject { public delegate void LockCallback(NV21Image pixels); - private Texture _texture; + private readonly Texture _texture; - public PixelFormat Format => _texture.Format; + public PixelFormat Format + { + get + { + ThrowIfDisposed(); + + return _texture.Format; + } + } + + public TextureAccess Access + { + get + { + ThrowIfDisposed(); + + return _texture.Access; + } + } - public TextureAccess Access => _texture.Access; + public int Width + { + get + { + ThrowIfDisposed(); - public int Width => _texture.Width; + return _texture.Width; + } + } - public int Height => _texture.Height; + public int Height + { + get + { + ThrowIfDisposed(); + + return _texture.Height; + } + } + + public Size Size + { + get + { + ThrowIfDisposed(); + + return _texture.Size; + } + } public BlendMode BlendMode { - get => _texture.BlendMode; + get + { + ThrowIfDisposed(); - set => _texture.BlendMode = value; + return _texture.BlendMode; + } + set + { + ThrowIfDisposed(); + + _texture.BlendMode = value; + } } - public bool IsValid => _texture.IsValid; + public bool IsValid + { + get + { + ThrowIfDisposed(); + + return _texture.IsValid; + } + } internal NV21Texture(Texture texture) { @@ -58,11 +117,12 @@ internal NV21Texture(Texture texture) _texture = texture; } - public void Dispose() + protected override void Dispose(bool disposing) { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; + if (disposing) + { + _texture?.Dispose(); + } } public void WithLock(LockCallback callback) @@ -79,7 +139,7 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) { ArgumentNullException.ThrowIfNull(callback); - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; @@ -95,6 +155,8 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) public void Update(NV21Image image) { + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -106,6 +168,8 @@ public void Update(NV21MemoryImage image) { ArgumentNullException.ThrowIfNull(image); + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateNVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -114,11 +178,6 @@ public void Update(NV21MemoryImage image) ); } - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_texture is null, this); - } - public static implicit operator Texture(NV21Texture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/video/PackedTexture.cs b/sources/SDL2Sharp/video/PackedTexture.cs index 7d5b6ae4..8d12227a 100644 --- a/sources/SDL2Sharp/video/PackedTexture.cs +++ b/sources/SDL2Sharp/video/PackedTexture.cs @@ -26,33 +26,90 @@ namespace SDL2Sharp { - public sealed unsafe class PackedTexture : IDisposable + public sealed unsafe class PackedTexture : DisposableObject where TPackedPixel : struct, IPackedPixel { public delegate void LockCallback(PackedImage pixels); public delegate void LockToSurfaceCallback(Surface surface); - private Texture _texture; + private readonly Texture _texture; - public PixelFormat Format => _texture.Format; + public PixelFormat Format + { + get + { + ThrowIfDisposed(); + + return _texture.Format; + } + } + + public TextureAccess Access + { + get + { + ThrowIfDisposed(); + + return _texture.Access; + } + } + + public int Width + { + get + { + ThrowIfDisposed(); + + return _texture.Width; + } + } - public TextureAccess Access => _texture.Access; + public int Height + { + get + { + ThrowIfDisposed(); - public int Width => _texture.Width; + return _texture.Height; + } + } - public int Height => _texture.Height; + public Size Size + { + get + { + ThrowIfDisposed(); - public Size Size => _texture.Size; + return _texture.Size; + } + } public BlendMode BlendMode { - get => _texture.BlendMode; + get + { + ThrowIfDisposed(); - set => _texture.BlendMode = value; + return _texture.BlendMode; + } + set + { + ThrowIfDisposed(); + + _texture.BlendMode = value; + } } - public bool IsValid => _texture.IsValid; + public bool IsValid + { + get + { + ThrowIfDisposed(); + + return _texture.IsValid; + } + } internal PackedTexture(Texture texture) { @@ -66,11 +123,12 @@ internal PackedTexture(Texture texture) _texture = texture; } - public void Dispose() + protected override void Dispose(bool disposing) { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; + if (disposing) + { + _texture?.Dispose(); + } } public void WithLock(LockCallback callback) @@ -85,7 +143,7 @@ public void WithLock(Rectangle rectangle, LockCallback callback) public void WithLock(int x, int y, int width, int height, LockCallback callback) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; @@ -111,7 +169,7 @@ public void WithLock(Rectangle rectangle, LockToSurfaceCallback callback) public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback callback) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; @@ -125,21 +183,21 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback public void Update(PackedImage pixels) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Update(null, (void*)pixels, pixels.Pitch); } public void Update(PackedMemoryImage image) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Update(null, (void*)image, image.Pitch); } public void Update(TPackedPixel[,] pixels) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var pointer = Unsafe.AsPointer(ref pixels.DangerousGetReference()); var width = pixels.GetLength(1); @@ -154,11 +212,6 @@ private void Update(SDL_Rect* rect, void* pixels, int pitch) ); } - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_texture is null, this); - } - public static implicit operator Texture(PackedTexture texture) { ArgumentNullException.ThrowIfNull(texture); diff --git a/sources/SDL2Sharp/video/PixelFormatDescriptor.cs b/sources/SDL2Sharp/video/PixelFormatDescriptor.cs index b0ef125d..0d4a42d6 100644 --- a/sources/SDL2Sharp/video/PixelFormatDescriptor.cs +++ b/sources/SDL2Sharp/video/PixelFormatDescriptor.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp { - public sealed unsafe class PixelFormatDescriptor : IDisposable + public sealed unsafe class PixelFormatDescriptor : FinalizableObject { private SDL_PixelFormat* _handle; @@ -72,18 +72,7 @@ public PixelFormatDescriptor(PixelFormat pixelFormat) : this(Error.ThrowLastErrorIfNull(Interop.SDL.AllocFormat((uint)pixelFormat)), true) { } - ~PixelFormatDescriptor() - { - Dispose(false); - } - - public void Dispose() - { - GC.SuppressFinalize(this); - Dispose(true); - } - - private void Dispose(bool _) + protected override void Dispose(bool disposing) { if (!_ownsHandle || _handle == null) return; Interop.SDL.FreeFormat(_handle); diff --git a/sources/SDL2Sharp/video/Renderer.cs b/sources/SDL2Sharp/video/Renderer.cs index 76d2a54c..bd285aec 100644 --- a/sources/SDL2Sharp/video/Renderer.cs +++ b/sources/SDL2Sharp/video/Renderer.cs @@ -25,7 +25,7 @@ namespace SDL2Sharp { - public sealed unsafe class Renderer : IDisposable + public sealed unsafe class Renderer : FinalizableObject { private SDL_Renderer* _handle; @@ -35,7 +35,7 @@ public RendererInfo Info { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rendererInfo = new SDL_RendererInfo(); Error.ThrowLastErrorIfNegative( @@ -49,7 +49,7 @@ public Size OutputSize { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width, height; Error.ThrowLastErrorIfNegative( @@ -63,7 +63,7 @@ public int OutputWidth { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width; Error.ThrowLastErrorIfNegative( @@ -77,7 +77,7 @@ public int OutputHeight { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int height; Error.ThrowLastErrorIfNegative( @@ -91,7 +91,7 @@ public Color DrawColor { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); byte r, g, b, a; Error.ThrowLastErrorIfNegative( @@ -101,7 +101,7 @@ public Color DrawColor } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.SetRenderDrawColor(_handle, value.R, value.G, value.B, value.A) @@ -113,7 +113,7 @@ public BlendMode BlendMode { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); SDL_BlendMode blendMode; Error.ThrowLastErrorIfNegative( @@ -123,7 +123,7 @@ public BlendMode BlendMode } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.SetRenderDrawBlendMode(_handle, (SDL_BlendMode)value) @@ -135,7 +135,7 @@ public Size LogicalViewSize { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width, height; Interop.SDL.RenderGetLogicalSize(_handle, &width, &height); @@ -143,7 +143,7 @@ public Size LogicalViewSize } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderSetLogicalSize(_handle, value.Width, value.Height) @@ -156,7 +156,7 @@ public Scale Scale get { - ThrowWhenDisposed(); + ThrowIfDisposed(); float scaleX, scaleY; Interop.SDL.RenderGetScale(_handle, &scaleX, &scaleY); @@ -164,7 +164,7 @@ public Scale Scale } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderSetScale(_handle, value.X, value.Y) @@ -176,7 +176,7 @@ public Rectangle ViewPort { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect(); Interop.SDL.RenderGetViewport(_handle, &rect); @@ -184,7 +184,7 @@ public Rectangle ViewPort } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = value.X, y = value.Y, w = value.Width, h = value.Height }; Error.ThrowLastErrorIfNegative( @@ -197,13 +197,13 @@ public Texture? Target { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return _renderTarget; } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); if (value is null) { @@ -229,18 +229,7 @@ internal Renderer(SDL_Renderer* renderer) _handle = renderer; } - ~Renderer() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) + protected override void Dispose(bool disposing) { if (_handle is null) return; Interop.SDL.DestroyRenderer(_handle); @@ -254,7 +243,7 @@ public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, Size public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, int width, int height) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var texture = Interop.SDL.CreateTexture(_handle, (uint)pixelFormat, (int)access, width, height); Error.ThrowLastErrorIfNull(texture); @@ -263,7 +252,7 @@ public Texture CreateTexture(PixelFormat pixelFormat, TextureAccess access, int public Texture CreateTextureFromSurface(Surface surface) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var texture = Interop.SDL.CreateTextureFromSurface(_handle, surface.Handle); Error.ThrowLastErrorIfNull(texture); @@ -272,7 +261,7 @@ public Texture CreateTextureFromSurface(Surface surface) public void Clear() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderClear(_handle) @@ -281,7 +270,7 @@ public void Clear() public void Copy(Texture texture) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderCopy(_handle, texture.Handle, null, null) @@ -290,7 +279,7 @@ public void Copy(Texture texture) public void Copy(Texture texture, Rectangle destination) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var dest = new SDL_Rect { @@ -307,7 +296,7 @@ public void Copy(Texture texture, Rectangle destination) public void Copy(Texture texture, Rectangle source, Rectangle destination) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var src = new SDL_Rect { @@ -332,7 +321,7 @@ public void Copy(Texture texture, Rectangle source, Rectangle destination) public void DrawLine(int x1, int y1, int x2, int y2) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderDrawLine(_handle, x1, y1, x2, y2) @@ -341,7 +330,7 @@ public void DrawLine(int x1, int y1, int x2, int y2) public void DrawLines(Point[] points) { - ThrowWhenDisposed(); + ThrowIfDisposed(); fixed (Point* point = &points[0]) { @@ -353,7 +342,7 @@ public void DrawLines(Point[] points) public void DrawLine(float x1, float y1, float x2, float y2) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderDrawLineF(_handle, x1, y1, x2, y2) @@ -362,7 +351,7 @@ public void DrawLine(float x1, float y1, float x2, float y2) public void DrawPoint(int x, int y) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderDrawPoint(_handle, x, y) @@ -371,7 +360,7 @@ public void DrawPoint(int x, int y) public void DrawPoint(float x, float y) { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.RenderDrawPointF(_handle, x, y) @@ -380,7 +369,7 @@ public void DrawPoint(float x, float y) public void DrawPoints(Point[] points) { - ThrowWhenDisposed(); + ThrowIfDisposed(); fixed (Point* point = &points[0]) { @@ -392,7 +381,7 @@ public void DrawPoints(Point[] points) public void FillRect(int x, int y, int width, int height) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; Error.ThrowLastErrorIfNegative( @@ -407,7 +396,7 @@ public void FillRect(Rectangle rectangle) public void Present() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.RenderPresent(_handle); } @@ -415,7 +404,7 @@ public void Present() public PackedMemoryImage ReadPixels() where TPackedPixel : struct, IPackedPixel { - ThrowWhenDisposed(); + ThrowIfDisposed(); return ReadPixels( new Rectangle(0, 0, OutputWidth, OutputHeight) @@ -425,7 +414,7 @@ public PackedMemoryImage ReadPixels() public PackedMemoryImage ReadPixels(Rectangle rectangle) where TPackedPixel : struct, IPackedPixel { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = rectangle.X, y = rectangle.Y, w = rectangle.Width, h = rectangle.Height }; var format = (uint)TPackedPixel.Format; @@ -441,10 +430,5 @@ public PackedMemoryImage ReadPixels(Rectangle rectan ); return image; } - - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_handle is null, this); - } } } diff --git a/sources/SDL2Sharp/video/Surface.cs b/sources/SDL2Sharp/video/Surface.cs index 1737960e..5dcada17 100644 --- a/sources/SDL2Sharp/video/Surface.cs +++ b/sources/SDL2Sharp/video/Surface.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp { - public sealed unsafe class Surface : IDisposable + public sealed unsafe class Surface : FinalizableObject { private SDL_Surface* _handle; @@ -85,28 +85,14 @@ public Surface(void* pixels, int width, int height, int pitch, uint redMask, uin : this(Error.ThrowLastErrorIfNull(Interop.SDL.CreateRGBSurfaceFrom(pixels, width, height, 0, pitch, redMask, greenMask, blueMask, alphaMask))) { } - ~Surface() + protected override void Dispose(bool disposing) { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) - { - if (_handle is null) + if (!_freeHandle || _handle is null) { return; } - if (_freeHandle) - { - Interop.SDL.FreeSurface(_handle); - } + Interop.SDL.FreeSurface(_handle); _handle = null; } diff --git a/sources/SDL2Sharp/video/Surface{T}.cs b/sources/SDL2Sharp/video/Surface{T}.cs index 941148f5..57fc4623 100644 --- a/sources/SDL2Sharp/video/Surface{T}.cs +++ b/sources/SDL2Sharp/video/Surface{T}.cs @@ -23,10 +23,10 @@ namespace SDL2Sharp { - public sealed class Surface : IDisposable + public sealed class Surface : DisposableObject where TPackedPixel : struct, IPackedPixel { - private Surface _surface; + private readonly Surface _surface; public PixelFormatDescriptor Format => _surface.Format; @@ -55,27 +55,17 @@ internal Surface(Surface surface) _surface = surface ?? throw new ArgumentNullException(nameof(surface)); } - ~Surface() + protected override void Dispose(bool disposing) { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) - { - if (_surface is null) return; - _surface.Dispose(); - _surface = null!; + if (disposing) + { + _surface?.Dispose(); + } } public void Blit(Surface surface) { - ThrowWhenDisposed(); + ThrowIfDisposed(); ArgumentNullException.ThrowIfNull(surface); @@ -85,7 +75,7 @@ public void Blit(Surface surface) public Surface Convert() where TTargetPackedPixel : struct, IPackedPixel { - ThrowWhenDisposed(); + ThrowIfDisposed(); var targetPixelFormat = TTargetPackedPixel.Format; var targetSurface = _surface.ConvertTo(targetPixelFormat); @@ -94,19 +84,16 @@ public Surface Convert() public void FillRect(uint color) { - ThrowWhenDisposed(); + ThrowIfDisposed(); _surface.FillRect(color); } public void WithLock(SurfaceLockCallback callback) { - _surface.WithLock(callback); - } + ThrowIfDisposed(); - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_surface is null, this); + _surface.WithLock(callback); } public static implicit operator Surface(Surface surface) diff --git a/sources/SDL2Sharp/video/Texture.cs b/sources/SDL2Sharp/video/Texture.cs index 5e5df1a6..7bf04161 100644 --- a/sources/SDL2Sharp/video/Texture.cs +++ b/sources/SDL2Sharp/video/Texture.cs @@ -23,7 +23,7 @@ namespace SDL2Sharp { - public sealed unsafe class Texture : IDisposable + public sealed unsafe class Texture : FinalizableObject { public delegate void LockToSurfaceCallback(Surface pixels); @@ -35,6 +35,8 @@ public PixelFormat Format { get { + ThrowIfDisposed(); + uint format; Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, &format, null, null, null)); return (PixelFormat)format; @@ -45,6 +47,8 @@ public TextureAccess Access { get { + ThrowIfDisposed(); + int access; Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, &access, null, null)); return (TextureAccess)access; @@ -55,6 +59,8 @@ public int Width { get { + ThrowIfDisposed(); + int width; Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, &width, null)); return width; @@ -65,6 +71,8 @@ public int Height { get { + ThrowIfDisposed(); + int height; Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, null, &height)); return height; @@ -75,6 +83,8 @@ public Size Size { get { + ThrowIfDisposed(); + int width, height; Error.ThrowLastErrorIfNegative(Interop.SDL.QueryTexture(_handle, null, null, &width, &height)); return new Size(width, height); @@ -85,6 +95,8 @@ public BlendMode BlendMode { get { + ThrowIfDisposed(); + SDL_BlendMode blendMode; Error.ThrowLastErrorIfNegative( Interop.SDL.GetTextureBlendMode(_handle, &blendMode) @@ -93,33 +105,32 @@ public BlendMode BlendMode } set { + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.SetTextureBlendMode(_handle, (SDL_BlendMode)value) ); } } - public bool IsValid => 0 == Interop.SDL.QueryTexture(_handle, null, null, null, null); - - internal Texture(SDL_Texture* texture) + public bool IsValid { - ArgumentNullException.ThrowIfNull(texture); + get + { + ThrowIfDisposed(); - _handle = texture; + return 0 == Interop.SDL.QueryTexture(_handle, null, null, null, null); + } } - ~Texture() + internal Texture(SDL_Texture* handle) { - ReleaseHandle(); - } + ArgumentNullException.ThrowIfNull(handle); - public void Dispose() - { - ReleaseHandle(); - GC.SuppressFinalize(this); + _handle = handle; } - private void ReleaseHandle() + protected override void Dispose(bool disposing) { if (_handle is null) return; Interop.SDL.DestroyTexture(_handle); @@ -138,7 +149,7 @@ public void WithLock(Rectangle rectangle, LockToSurfaceCallback callback) public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback callback) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; SDL_Surface* surfaceHandle; @@ -149,10 +160,5 @@ public void WithLock(int x, int y, int width, int height, LockToSurfaceCallback callback.Invoke(surface); Interop.SDL.UnlockTexture(_handle); } - - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_handle is null, this); - } } } diff --git a/sources/SDL2Sharp/video/VideoSubsystem.cs b/sources/SDL2Sharp/video/VideoSubsystem.cs index 5828ff59..b9e1a4b8 100644 --- a/sources/SDL2Sharp/video/VideoSubsystem.cs +++ b/sources/SDL2Sharp/video/VideoSubsystem.cs @@ -18,19 +18,22 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using System.Collections.Generic; namespace SDL2Sharp { - internal sealed class VideoSubsystem : IVideoSubsystem, IDisposable + internal sealed class VideoSubsystem : FinalizableObject, IVideoSubsystem { private const uint InitSubsystemFlags = Interop.SDL.SDL_INIT_VIDEO; + private bool _fullyInitialized; + public IReadOnlyList Displays { get { + ThrowIfDisposed(); + var displayCount = Interop.SDL.GetNumVideoDisplays(); var displays = new List(displayCount); for (var displayIndex = 0; displayIndex < displayCount; displayIndex++) @@ -46,30 +49,41 @@ public VideoSubsystem() Error.ThrowLastErrorIfNegative( Interop.SDL.InitSubSystem(InitSubsystemFlags) ); + _fullyInitialized = true; } - public void Dispose() + protected override void Dispose(bool disposing) { + if (!_fullyInitialized) return; Interop.SDL.QuitSubSystem(InitSubsystemFlags); + _fullyInitialized = false; } public Window CreateWindow(string title, int width, int height) { + ThrowIfDisposed(); + return new Window(title, width, height); } public Window CreateWindow(string title, int width, int height, WindowFlags flags) { + ThrowIfDisposed(); + return new Window(title, width, height, flags); } public Window CreateWindow(string title, int x, int y, int width, int height) { + ThrowIfDisposed(); + return new Window(title, x, y, width, height); } public Window CreateWindow(string title, int x, int y, int width, int height, WindowFlags flags) { + ThrowIfDisposed(); + return new Window(title, x, y, width, height, flags); } } diff --git a/sources/SDL2Sharp/video/Window.cs b/sources/SDL2Sharp/video/Window.cs index 30f1a556..416eca0d 100644 --- a/sources/SDL2Sharp/video/Window.cs +++ b/sources/SDL2Sharp/video/Window.cs @@ -18,7 +18,6 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. -using System; using SDL2Sharp.Interop; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -26,7 +25,7 @@ namespace SDL2Sharp { - public sealed unsafe class Window : IDisposable + public sealed unsafe class Window : FinalizableObject { private SDL_Window* _handle; @@ -34,7 +33,7 @@ public uint Id { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return Interop.SDL.GetWindowID(_handle); } @@ -44,13 +43,13 @@ public string Title { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return new string(Interop.SDL.GetWindowTitle(_handle)); } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); using var marshaledValue = new MarshaledString(value); Interop.SDL.SetWindowTitle(_handle, marshaledValue); @@ -61,7 +60,7 @@ public Point Position { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int x, y; Interop.SDL.GetWindowPosition(_handle, &x, &y); @@ -69,7 +68,7 @@ public Point Position } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowPosition(_handle, value.X, value.Y); } @@ -79,7 +78,7 @@ public int Width { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width; Interop.SDL.GetWindowSize(_handle, &width, null); @@ -91,7 +90,7 @@ public int Height { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int height; Interop.SDL.GetWindowSize(_handle, null, &height); @@ -103,7 +102,7 @@ public Size Size { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width, height; Interop.SDL.GetWindowSize(_handle, &width, &height); @@ -111,7 +110,7 @@ public Size Size } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowSize(_handle, value.Width, value.Height); } @@ -121,7 +120,7 @@ public Size MinimumSize { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width, height; Interop.SDL.GetWindowMinimumSize(_handle, &width, &height); @@ -129,7 +128,7 @@ public Size MinimumSize } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowMinimumSize(_handle, value.Width, value.Height); } @@ -139,7 +138,7 @@ public Size MaximumSize { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int width, height; Interop.SDL.GetWindowMaximumSize(_handle, &width, &height); @@ -147,7 +146,7 @@ public Size MaximumSize } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowMaximumSize(_handle, value.Width, value.Height); } @@ -157,7 +156,7 @@ public Size ClientSize { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); int borderTop, borderLeft, borderBottom, borderRight; Error.ThrowLastErrorIfNegative( @@ -175,7 +174,7 @@ public PixelFormat PixelFormat { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); var pixelFormat = Interop.SDL.GetWindowPixelFormat(_handle); Error.ThrowLastErrorIfZero(pixelFormat); @@ -187,7 +186,7 @@ public Surface Surface { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); var surfaceHandle = Interop.SDL.GetWindowSurface(_handle); Error.ThrowLastErrorIfNull(surfaceHandle); @@ -199,13 +198,13 @@ public bool IsBordered { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_BORDERLESS); } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowBordered(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); } @@ -215,13 +214,13 @@ public bool IsResizable { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_RESIZABLE); } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.SetWindowResizable(_handle, value ? SDL_bool.SDL_TRUE : SDL_bool.SDL_FALSE); } @@ -231,13 +230,13 @@ public bool IsFullScreen { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_FULLSCREEN); } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN : 0; Error.ThrowLastErrorIfNegative( @@ -250,13 +249,13 @@ public bool IsFullScreenDesktop { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP); } set { - ThrowWhenDisposed(); + ThrowIfDisposed(); var flags = value ? SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP : 0; Error.ThrowLastErrorIfNegative( @@ -269,7 +268,7 @@ public bool IsVisible { get { - ThrowWhenDisposed(); + ThrowIfDisposed(); return HasWindowFlag(SDL_WindowFlags.SDL_WINDOW_SHOWN); } @@ -294,6 +293,7 @@ internal Window(string title, int x, int y, int width, int height, WindowFlags f private Window(string title, int x, int y, int width, int height, uint flags) { using var marshaledTitle = new MarshaledString(title); + _handle = Error.ThrowLastErrorIfNull( Interop.SDL.CreateWindow(marshaledTitle, x, y, width, height, flags) ); @@ -306,18 +306,7 @@ private Window(string title, int x, int y, int width, int height, uint flags) } } - ~Window() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) + protected override void Dispose(bool _) { if (_handle is null) return; Interop.SDL.DestroyWindow(_handle); @@ -326,42 +315,42 @@ private void Dispose(bool _) public void Show() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.ShowWindow(_handle); } public void Hide() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.HideWindow(_handle); } public void Raise() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.RaiseWindow(_handle); } public void Maximize() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.MaximizeWindow(_handle); } public void Minimize() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.MinimizeWindow(_handle); } public void Restore() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Interop.SDL.RestoreWindow(_handle); } @@ -393,7 +382,7 @@ public bool TryCreateRenderer(RendererFlags flags, out Renderer renderer) public bool TryCreateRenderer(RendererFlags flags, out Renderer renderer, out Error error) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var handle = Interop.SDL.CreateRenderer(_handle, -1, (uint)flags); if (handle is null) @@ -412,7 +401,7 @@ public bool TryCreateRenderer(RendererFlags flags, out Renderer renderer, out Er public void UpdateSurface() { - ThrowWhenDisposed(); + ThrowIfDisposed(); Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateWindowSurface(_handle) @@ -426,11 +415,6 @@ private bool HasWindowFlag(SDL_WindowFlags flag) return hasFlag; } - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_handle is null, this); - } - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])] private static unsafe SDL_HitTestResult HitTestCallback(SDL_Window* win, SDL_Point* area, void* data) { diff --git a/sources/SDL2Sharp/video/YUVTexture.cs b/sources/SDL2Sharp/video/YUVTexture.cs index e6713383..055a75ec 100644 --- a/sources/SDL2Sharp/video/YUVTexture.cs +++ b/sources/SDL2Sharp/video/YUVTexture.cs @@ -23,28 +23,87 @@ namespace SDL2Sharp { - public sealed unsafe partial class YUVTexture : IDisposable where TYUVFormat : IYUVFormat + public sealed unsafe partial class YUVTexture : DisposableObject where TYUVFormat : IYUVFormat { public delegate void LockCallback(YUVImage pixels); - private Texture _texture; + private readonly Texture _texture; - public PixelFormat Format => _texture.Format; + public PixelFormat Format + { + get + { + ThrowIfDisposed(); + + return _texture.Format; + } + } + + public TextureAccess Access + { + get + { + ThrowIfDisposed(); + + return _texture.Access; + } + } - public TextureAccess Access => _texture.Access; + public int Width + { + get + { + ThrowIfDisposed(); - public int Width => _texture.Width; + return _texture.Width; + } + } - public int Height => _texture.Height; + public int Height + { + get + { + ThrowIfDisposed(); + + return _texture.Height; + } + } + + public Size Size + { + get + { + ThrowIfDisposed(); + + return _texture.Size; + } + } public BlendMode BlendMode { - get => _texture.BlendMode; + get + { + ThrowIfDisposed(); - set => _texture.BlendMode = value; + return _texture.BlendMode; + } + set + { + ThrowIfDisposed(); + + _texture.BlendMode = value; + } } - public bool IsValid => _texture.IsValid; + public bool IsValid + { + get + { + ThrowIfDisposed(); + + return _texture.IsValid; + } + } internal YUVTexture(Texture texture) { @@ -58,11 +117,12 @@ internal YUVTexture(Texture texture) _texture = texture; } - public void Dispose() + protected override void Dispose(bool disposing) { - if (_texture is null) return; - _texture.Dispose(); - _texture = null!; + if (disposing) + { + _texture?.Dispose(); + } } public void WithLock(LockCallback callback) @@ -77,7 +137,7 @@ public void WithLock(Rectangle rectangle, LockCallback callback) public void WithLock(int x, int y, int width, int height, LockCallback callback) { - ThrowWhenDisposed(); + ThrowIfDisposed(); var rect = new SDL_Rect { x = x, y = y, w = width, h = height }; void* pixels; @@ -93,6 +153,8 @@ public void WithLock(int x, int y, int width, int height, LockCallback callback) public void Update(YUVImage image) { + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateYUVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -104,6 +166,8 @@ public void Update(YUVImage image) public void Update(YUVMemoryImage image) { + ThrowIfDisposed(); + Error.ThrowLastErrorIfNegative( Interop.SDL.UpdateYUVTexture(_texture.Handle, null, (byte*)image.Y, image.Y.Pitch, @@ -113,11 +177,6 @@ public void Update(YUVMemoryImage image) ); } - private void ThrowWhenDisposed() - { - ObjectDisposedException.ThrowIf(_texture is null, this); - } - public static implicit operator Texture(YUVTexture texture) { ArgumentNullException.ThrowIfNull(texture); From 53719f45a7d0a37ceff09d07426142c1f8320d56 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Sun, 28 Sep 2025 05:58:10 +0200 Subject: [PATCH 59/62] Fix NuGet configuration. --- nuget.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuget.config b/nuget.config index fb5d2b5b..bf8830d6 100644 --- a/nuget.config +++ b/nuget.config @@ -7,10 +7,10 @@ - + - + From 2ae74003bb0e8ac9da7c2d3cf024e5859ee80d8c Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 29 Sep 2025 13:42:50 +0200 Subject: [PATCH 60/62] Fix tests failing due to SDL being disposed to early when tests are running in parallel. --- .../video/PackedTextureTests.cs | 42 +++++++++---------- .../video/PlanarTextureTests.cs | 17 ++++---- tests/SDL2Sharp.Tests/video/TextureTests.cs | 12 +++--- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs index 640158ea..59b16cb4 100644 --- a/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs @@ -23,12 +23,16 @@ namespace SDL2Sharp.Tests { - public static class PackedTextureTests + public sealed class PackedTextureTests(SDL sdl) : IAssemblyFixture { - private static readonly Random _random = new(); + private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); + + private readonly Random _random = new(); + + private SDL SDL => _sdl; [Fact] - public static void WriteAndReadAbgr1555() => WriteAndRead + public void WriteAndReadAbgr1555() => WriteAndRead ( () => ABGR1555.FromRGBA( r: (byte)_random.Next(0, 256), @@ -39,7 +43,7 @@ public static void WriteAndReadAbgr1555() => WriteAndRead ); [Fact] - public static void WriteAndReadAbgr4444() => WriteAndRead + public void WriteAndReadAbgr4444() => WriteAndRead ( () => ABGR4444.FromRGBA( r: (byte)_random.Next(0, 256), @@ -50,7 +54,7 @@ public static void WriteAndReadAbgr4444() => WriteAndRead ); [Fact] - public static void WriteAndReadAbgr8888() => WriteAndRead + public void WriteAndReadAbgr8888() => WriteAndRead ( () => ABGR8888.FromRGBA( r: (byte)_random.Next(0, 256), @@ -61,7 +65,7 @@ public static void WriteAndReadAbgr8888() => WriteAndRead ); [Fact] - public static void WriteAndReadArgb1555() => WriteAndRead + public void WriteAndReadArgb1555() => WriteAndRead ( () => ARGB1555.FromRGBA( r: (byte)_random.Next(0, 256), @@ -72,7 +76,7 @@ public static void WriteAndReadArgb1555() => WriteAndRead ); [Fact] - public static void WriteAndReadArgb2101010() => WriteAndRead + public void WriteAndReadArgb2101010() => WriteAndRead ( () => ARGB2101010.FromRGBA( r: (byte)_random.Next(0, 256), @@ -83,7 +87,7 @@ public static void WriteAndReadArgb2101010() => WriteAndRead ); [Fact] - public static void WriteAndReadArgb4444() => WriteAndRead + public void WriteAndReadArgb4444() => WriteAndRead ( () => ARGB4444.FromRGBA( r: (byte)_random.Next(0, 256), @@ -94,7 +98,7 @@ public static void WriteAndReadArgb4444() => WriteAndRead ); [Fact] - public static void WriteAndReadArgb8888() => WriteAndRead( + public void WriteAndReadArgb8888() => WriteAndRead( () => ARGB8888.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -104,7 +108,7 @@ public static void WriteAndReadArgb8888() => WriteAndRead( ); [Fact] - public static void WriteAndReadRgba8888() => WriteAndRead( + public void WriteAndReadRgba8888() => WriteAndRead( () => new RGBA8888( a: (byte)_random.Next(0, 256), r: (byte)_random.Next(0, 256), @@ -114,7 +118,7 @@ public static void WriteAndReadRgba8888() => WriteAndRead( ); [Fact] - public static void WriteAndReadBgr565() => WriteAndRead( + public void WriteAndReadBgr565() => WriteAndRead( () => BGR565.FromRGB( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -123,7 +127,7 @@ public static void WriteAndReadBgr565() => WriteAndRead( ); [Fact] - public static void WriteAndReadBgra4444() => WriteAndRead( + public void WriteAndReadBgra4444() => WriteAndRead( () => BGRA4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -133,7 +137,7 @@ public static void WriteAndReadBgra4444() => WriteAndRead( ); [Fact] - public static void WriteAndReadBgra5551() => WriteAndRead( + public void WriteAndReadBgra5551() => WriteAndRead( () => BGRA4444.FromRGBA( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -143,7 +147,7 @@ public static void WriteAndReadBgra5551() => WriteAndRead( ); [Fact] - public static void WriteAndReadBgra8888() => WriteAndRead( + public void WriteAndReadBgra8888() => WriteAndRead( () => new BGRA8888( b: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -153,7 +157,7 @@ public static void WriteAndReadBgra8888() => WriteAndRead( ); //[Fact] - //public static void WriteAndReadRgb332() => WriteAndRead( + //public void WriteAndReadRgb332() => WriteAndRead( // () => Rgb332.FromRGB( // r: (byte)_random.Next(0, 256), // g: (byte)_random.Next(0, 256), @@ -162,7 +166,7 @@ public static void WriteAndReadBgra8888() => WriteAndRead( //); [Fact] - public static void WriteAndReadRgb565() => WriteAndRead( + public void WriteAndReadRgb565() => WriteAndRead( () => RGB565.FromRGB( r: (byte)_random.Next(0, 256), g: (byte)_random.Next(0, 256), @@ -170,13 +174,9 @@ public static void WriteAndReadRgb565() => WriteAndRead( ) ); - private static void WriteAndRead(Func colorGenerator) + private void WriteAndRead(Func colorGenerator) where TPackedPixelFormat : struct, IPackedPixel { -#pragma warning disable IDE1006 // Naming Styles - using var SDL = new SDL(); -#pragma warning restore IDE1006 // Naming Styles - using var window = SDL.Video.CreateWindow("PackedTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(RendererFlags.Software | RendererFlags.TargetTexture); using var sourceTexture = renderer.CreatePackedTexture(TextureAccess.Streaming, renderer.OutputSize); diff --git a/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs index e1a1713c..bc99aadf 100644 --- a/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs @@ -18,25 +18,26 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +using System; using Xunit; namespace SDL2Sharp.Tests { - public static class PlanarTextureTests + public sealed class PlanarTextureTests(SDL sdl) : IAssemblyFixture { + private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); + + private SDL SDL => _sdl; + [Fact] - public static void WriteAndReadYV12() => WriteAndRead(); + public void WriteAndReadYV12() => WriteAndRead(); [Fact] - public static void WriteAndReadIYUV() => WriteAndRead(); + public void WriteAndReadIYUV() => WriteAndRead(); - private static void WriteAndRead() + private void WriteAndRead() where TYUVFormat : struct, IYUVFormat { -#pragma warning disable IDE1006 // Naming Styles - using var SDL = new SDL(); -#pragma warning restore IDE1006 // Naming Styles - using var window = SDL.Video.CreateWindow("PlanarTextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); using var texture = renderer.CreateYUVTexture(TextureAccess.Streaming, renderer.OutputSize); diff --git a/tests/SDL2Sharp.Tests/video/TextureTests.cs b/tests/SDL2Sharp.Tests/video/TextureTests.cs index 88a15dc8..b4236da1 100644 --- a/tests/SDL2Sharp.Tests/video/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/TextureTests.cs @@ -23,8 +23,12 @@ namespace SDL2Sharp.Tests { - public sealed class TextureTests + public sealed class TextureTests(SDL sdl) : IAssemblyFixture { + private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); + + private SDL SDL => _sdl; + [Fact] public void CreateTextureOfArgb8888() { @@ -119,12 +123,8 @@ public void CreateTextureOfYV12() }); } - private static void WithRenderer(Action test) + private void WithRenderer(Action test) { -#pragma warning disable IDE1006 // Naming Styles - using var SDL = new SDL(); -#pragma warning restore IDE1006 // Naming Styles - using var window = SDL.Video.CreateWindow("TextureTests", 640, 480, WindowFlags.Hidden); using var renderer = window.CreateRenderer(); test(renderer); From 3b7417409b1dfdb5bbdf4ded3660618b44754eee Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 29 Sep 2025 18:10:36 +0200 Subject: [PATCH 61/62] Change minial SDK version to 8.0.20. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 69aa839c..95c86a0b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.405", + "version": "8.0.20", "rollForward": "latestFeature" } } From 133c09f937775743e74fa525a91f21d522d29684 Mon Sep 17 00:00:00 2001 From: Ronald van Manen Date: Mon, 29 Sep 2025 18:11:10 +0200 Subject: [PATCH 62/62] Group tests in collections to delineate the "parallelism" boundary. --- .../audio/AudioCollectionDefinition.cs | 27 +++++++++++++++++++ .../audio/AudioFormatExtensionTests.cs | 1 + .../video/PackedTextureTests.cs | 1 + .../video/PlanarTextureTests.cs | 1 + tests/SDL2Sharp.Tests/video/SurfaceTests.cs | 1 + tests/SDL2Sharp.Tests/video/TextureTests.cs | 1 + .../video/VideoCollectionDefinition.cs | 27 +++++++++++++++++++ 7 files changed, 59 insertions(+) create mode 100644 tests/SDL2Sharp.Tests/audio/AudioCollectionDefinition.cs create mode 100644 tests/SDL2Sharp.Tests/video/VideoCollectionDefinition.cs diff --git a/tests/SDL2Sharp.Tests/audio/AudioCollectionDefinition.cs b/tests/SDL2Sharp.Tests/audio/AudioCollectionDefinition.cs new file mode 100644 index 00000000..ae65f3b7 --- /dev/null +++ b/tests/SDL2Sharp.Tests/audio/AudioCollectionDefinition.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using Xunit; + +namespace SDL2Sharp.Tests +{ + [CollectionDefinition("Audio", DisableParallelization = true)] + public sealed class AudioCollectionDefinition { } +} diff --git a/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs b/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs index 77ffa6e5..b8f7fcf5 100644 --- a/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs +++ b/tests/SDL2Sharp.Tests/audio/AudioFormatExtensionTests.cs @@ -22,6 +22,7 @@ namespace SDL2Sharp.Tests { + [Collection("Audio")] public static class AudioFormatExtensionTests { [Fact] diff --git a/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs index 59b16cb4..81b3b9c6 100644 --- a/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PackedTextureTests.cs @@ -23,6 +23,7 @@ namespace SDL2Sharp.Tests { + [Collection("Video")] public sealed class PackedTextureTests(SDL sdl) : IAssemblyFixture { private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); diff --git a/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs index bc99aadf..52fea55f 100644 --- a/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/PlanarTextureTests.cs @@ -23,6 +23,7 @@ namespace SDL2Sharp.Tests { + [Collection("Video")] public sealed class PlanarTextureTests(SDL sdl) : IAssemblyFixture { private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); diff --git a/tests/SDL2Sharp.Tests/video/SurfaceTests.cs b/tests/SDL2Sharp.Tests/video/SurfaceTests.cs index 71ada501..d208cdef 100644 --- a/tests/SDL2Sharp.Tests/video/SurfaceTests.cs +++ b/tests/SDL2Sharp.Tests/video/SurfaceTests.cs @@ -22,6 +22,7 @@ namespace SDL2Sharp.Tests { + [Collection("Video")] public sealed class SurfaceTests { [Fact] diff --git a/tests/SDL2Sharp.Tests/video/TextureTests.cs b/tests/SDL2Sharp.Tests/video/TextureTests.cs index b4236da1..e8d0882e 100644 --- a/tests/SDL2Sharp.Tests/video/TextureTests.cs +++ b/tests/SDL2Sharp.Tests/video/TextureTests.cs @@ -23,6 +23,7 @@ namespace SDL2Sharp.Tests { + [Collection("Video")] public sealed class TextureTests(SDL sdl) : IAssemblyFixture { private readonly SDL _sdl = sdl ?? throw new ArgumentNullException(nameof(sdl)); diff --git a/tests/SDL2Sharp.Tests/video/VideoCollectionDefinition.cs b/tests/SDL2Sharp.Tests/video/VideoCollectionDefinition.cs new file mode 100644 index 00000000..1f9cdb62 --- /dev/null +++ b/tests/SDL2Sharp.Tests/video/VideoCollectionDefinition.cs @@ -0,0 +1,27 @@ +// SDL2Sharp +// +// Copyright (C) 2021-2024 Ronald van Manen +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +using Xunit; + +namespace SDL2Sharp.Tests +{ + [CollectionDefinition("Video", DisableParallelization = true)] + public sealed class VideoCollectionDefinition { } +}