mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
55
Brutal.OpenAl/Generated/Al/AlBuffer.ObjectName.gen.cs
Normal file
55
Brutal.OpenAl/Generated/Al/AlBuffer.ObjectName.gen.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// <auto-generated/>
|
||||
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
|
||||
#nullable enable
|
||||
|
||||
namespace Brutal.OpenAlApi
|
||||
{
|
||||
/// <summary>
|
||||
/// An OpenAL buffer (an <c>ALuint</c> object name).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Created by <see cref="Al.GenBuffers"/> and released by <see cref="Delete"/> (or <see cref="Al.DeleteBuffers"/> 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 cref="AlError.InvalidName"/> (see <see cref="Al.ThrowIfError"/>). For parameter access keyed by enum, import the opt-in <c>Brutal.OpenAlApi.Params</c> namespace.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public unsafe readonly partial struct AlBuffer : 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 AlBuffer(uint name) => Name = name;
|
||||
|
||||
/// <summary>
|
||||
/// The null buffer (name <c>0</c>). OpenAL never assigns it to a real buffer.
|
||||
/// </summary>
|
||||
public static AlBuffer Null
|
||||
{
|
||||
get => default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns <see langword="true"/> if this is the null buffer.
|
||||
/// </summary>
|
||||
public bool IsNull() => Name == 0;
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the buffer (<c>alDeleteBuffers</c>). It must not be in use by a source. A successful delete releases any callback handler registered via <see cref="SetCallback"/>.
|
||||
/// </summary>
|
||||
public void Delete()
|
||||
{
|
||||
var name = Name;
|
||||
DeleteAndEvictCallbackRoots(&name, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns <see langword="true"/> if the name is a live buffer (<c>alIsBuffer</c>).
|
||||
/// </summary>
|
||||
public bool IsValid() => Al.PInvoke.IsBuffer(Name);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue