//
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
#nullable enable
namespace Brutal.OpenAlApi
{
///
/// An OpenAL buffer (an ALuint object name).
///
///
///
/// Created by and released by (or in bulk). This is a plain name, not a resource handle: copies refer to the same buffer; delete it exactly once. Operating on a null or deleted name sets (see ). For parameter access keyed by enum, import the opt-in Brutal.OpenAlApi.Params namespace.
///
///
public unsafe readonly partial struct AlBuffer : INullable
{
///
/// The raw OpenAL object name.
///
public readonly uint Name;
///
/// Wraps an existing object name without validating it.
///
/// The raw OpenAL object name.
public AlBuffer(uint name) => Name = name;
///
/// The null buffer (name 0). OpenAL never assigns it to a real buffer.
///
public static AlBuffer Null
{
get => default;
}
///
/// Returns if this is the null buffer.
///
public bool IsNull() => Name == 0;
///
/// Deletes the buffer (alDeleteBuffers). It must not be in use by a source. A successful delete releases any callback handler registered via .
///
public void Delete()
{
var name = Name;
DeleteAndEvictCallbackRoots(&name, 1);
}
///
/// Returns if the name is a live buffer (alIsBuffer).
///
public bool IsValid() => Al.PInvoke.IsBuffer(Name);
}
}