mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
107 lines
3.9 KiB
C#
107 lines
3.9 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.OpenAlApi
|
|
{
|
|
public static unsafe partial class Al
|
|
{
|
|
/// <summary>
|
|
/// Generates buffers (<c>alGenBuffers</c>), filling <paramref name="buffers"/>.
|
|
/// </summary>
|
|
/// <param name="buffers">The span to fill; its length determines how many buffers are generated.</param>
|
|
public static void GenBuffers(Span<AlBuffer> buffers)
|
|
{
|
|
if (buffers.IsEmpty)
|
|
return;
|
|
var names = buffers.Cast<AlBuffer, uint>();
|
|
fixed (uint* p = names)
|
|
Al.PInvoke.GenBuffers(names.Length, p);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates buffers (<c>alGenBuffers</c>). Allocates the returned array; use the <c>Span</c> overload to bring your own storage.
|
|
/// </summary>
|
|
/// <param name="count">How many buffers to generate; a non-positive count returns an empty array.</param>
|
|
public static AlBuffer[] GenBuffers(int count)
|
|
{
|
|
if (count <= 0)
|
|
return [];
|
|
var buffers = new AlBuffer[count];
|
|
GenBuffers(buffers.AsSpan());
|
|
return buffers;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates a single buffer.
|
|
/// </summary>
|
|
public static AlBuffer GenBuffer()
|
|
{
|
|
Span<AlBuffer> buffer = stackalloc AlBuffer[1];
|
|
GenBuffers(buffer);
|
|
return buffer[0];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deletes the given buffers (<c>alDeleteBuffers</c>). Each must not be in use by a source. A successful delete releases any callback handlers registered via <see cref="AlBuffer.SetCallback"/>.
|
|
/// </summary>
|
|
/// <param name="buffers">The buffers to delete.</param>
|
|
public static void DeleteBuffers(ReadOnlySpan<AlBuffer> buffers)
|
|
{
|
|
if (buffers.IsEmpty)
|
|
return;
|
|
var names = buffers.Cast<AlBuffer, uint>();
|
|
fixed (uint* p = names)
|
|
AlBuffer.DeleteAndEvictCallbackRoots(p, names.Length);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates sources (<c>alGenSources</c>), filling <paramref name="sources"/>.
|
|
/// </summary>
|
|
/// <param name="sources">The span to fill; its length determines how many sources are generated.</param>
|
|
public static void GenSources(Span<AlSource> sources)
|
|
{
|
|
if (sources.IsEmpty)
|
|
return;
|
|
var names = sources.Cast<AlSource, uint>();
|
|
fixed (uint* p = names)
|
|
Al.PInvoke.GenSources(names.Length, p);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates sources (<c>alGenSources</c>). Allocates the returned array; use the <c>Span</c> overload to bring your own storage.
|
|
/// </summary>
|
|
/// <param name="count">How many sources to generate; a non-positive count returns an empty array.</param>
|
|
public static AlSource[] GenSources(int count)
|
|
{
|
|
if (count <= 0)
|
|
return [];
|
|
var sources = new AlSource[count];
|
|
GenSources(sources.AsSpan());
|
|
return sources;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generates a single source.
|
|
/// </summary>
|
|
public static AlSource GenSource()
|
|
{
|
|
Span<AlSource> source = stackalloc AlSource[1];
|
|
GenSources(source);
|
|
return source[0];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deletes the given sources (<c>alDeleteSources</c>).
|
|
/// </summary>
|
|
/// <param name="sources">The sources to delete.</param>
|
|
public static void DeleteSources(ReadOnlySpan<AlSource> sources)
|
|
{
|
|
if (sources.IsEmpty)
|
|
return;
|
|
var names = sources.Cast<AlSource, uint>();
|
|
fixed (uint* p = names)
|
|
Al.PInvoke.DeleteSources(names.Length, p);
|
|
}
|
|
}
|
|
}
|