mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
55 lines
2 KiB
C#
55 lines
2 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.OpenAlApi
|
|
{
|
|
/// <summary>
|
|
/// An EFX effect object (an <c>ALuint</c> object name); requires <c>ALC_EXT_EFX</c>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Created by the typed <see cref="Efx"/> create methods (or <see cref="Efx.GenEffect"/>) and released by <see cref="Delete"/>. This is a plain name, not a resource handle: copies refer to the same effect; delete it exactly once. Operating on a null or deleted name sets <see cref="AlError.InvalidName"/> (see <see cref="Al.ThrowIfError"/>).
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe readonly partial struct AlEffect : INullable
|
|
{
|
|
/// <summary>
|
|
/// The raw OpenAL object name.
|
|
/// </summary>
|
|
public readonly uint Name;
|
|
|
|
/// <summary>
|
|
/// Wraps an existing object name without validating it.
|
|
/// </summary>
|
|
/// <param name="name">The raw OpenAL object name.</param>
|
|
public AlEffect(uint name) => Name = name;
|
|
|
|
/// <summary>
|
|
/// The null effect (name <c>0</c>). Passing it to <see cref="AlAuxiliaryEffectSlot.Load"/> detaches the slot's effect.
|
|
/// </summary>
|
|
public static AlEffect Null
|
|
{
|
|
get => default;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns <see langword="true"/> if this is the null effect.
|
|
/// </summary>
|
|
public bool IsNull() => Name == 0;
|
|
|
|
/// <summary>
|
|
/// Deletes the effect (<c>alDeleteEffects</c>). It must not be attached to a slot.
|
|
/// </summary>
|
|
public void Delete()
|
|
{
|
|
var name = Name;
|
|
Al.PInvoke.DeleteEffects(1, &name);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns <see langword="true"/> if the name is a live effect (<c>alIsEffect</c>).
|
|
/// </summary>
|
|
public bool IsValid() => Al.PInvoke.IsEffect(Name);
|
|
}
|
|
}
|