brutal/Brutal.Sdl/Generated/Sdl.Handles.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

170 lines
5.7 KiB
C#

// <auto-generated/>
// Generated by Brutal.Sdl.Generate; do not edit by hand.
#nullable enable
using System;
using Brutal.Interop;
namespace Brutal.SdlApi;
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_AudioStream</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlAudioStream : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyAudioStream(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Camera</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlCamera : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.CloseCamera(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Cursor</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlCursor : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyCursor(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Gamepad</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlGamepad : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.CloseGamepad(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_GPUDevice</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlGpuDevice : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyGpuDevice(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Joystick</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlJoystick : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.CloseJoystick(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Renderer</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlRenderer : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyRenderer(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Texture</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlTexture : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyTexture(this);
}
}
/// <summary>
/// A strongly-typed interop handle wrapping the opaque SDL <c>SDL_Window</c> pointer.
/// </summary>
[InteropHandle]
public readonly unsafe partial struct SdlWindow : IDisposable
{
/// <inheritdoc/>
public void Dispose()
{
// A default/zeroed handle owns nothing; forwarding it to the native destructor is at
// best a wasted call and at worst undefined behaviour. Guard so Dispose is a safe no-op
// on a null handle (and so a double-dispose after the value was cleared is harmless).
if (IsNull())
return;
Sdl.PInvoke.DestroyWindow(this);
}
}