//
// Generated by Brutal.Sdl.Generate; do not edit by hand.
#nullable enable
using System;
using Brutal.Interop;
namespace Brutal.SdlApi;
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_AudioStream pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlAudioStream : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Camera pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlCamera : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Cursor pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlCursor : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Gamepad pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlGamepad : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_GPUDevice pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlGpuDevice : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Joystick pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlJoystick : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Renderer pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlRenderer : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Texture pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlTexture : IDisposable
{
///
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);
}
}
///
/// A strongly-typed interop handle wrapping the opaque SDL SDL_Window pointer.
///
[InteropHandle]
public readonly unsafe partial struct SdlWindow : IDisposable
{
///
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);
}
}