// // Generated by Brutal.OpenAl.Generate; do not edit by hand. #nullable enable namespace Brutal.OpenAlApi { /// /// An OpenAL source (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 source; 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 AlSource : INullable { /// /// The raw OpenAL object name. /// public readonly uint Name; /// /// Wraps an existing object name without validating it. /// /// The raw OpenAL object name. public AlSource(uint name) => Name = name; /// /// The null source (name 0). OpenAL never assigns it to a real source. /// public static AlSource Null { get => default; } /// /// Returns if this is the null source. /// public bool IsNull() => Name == 0; /// /// Deletes the source (alDeleteSources). /// public void Delete() { var name = Name; Al.PInvoke.DeleteSources(1, &name); } /// /// Returns if the name is a live source (alIsSource). /// public bool IsValid() => Al.PInvoke.IsSource(Name); } }