brutal/Brutal.OpenAl/Generated/Al/Params.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

107 lines
4.9 KiB
C#

// <auto-generated/>
// Generated by Brutal.OpenAl.Generate; do not edit by hand.
#nullable enable
namespace Brutal.OpenAlApi.Params
{
/// <summary>
/// Keyed source parameter access (<c>alSourcef</c>/<c>alSourcei</c>/<c>alSource3f</c>) as extension members on <see cref="AlSource"/>, for generic or data-driven code. Typical code uses the named properties on <see cref="AlSource"/> instead.
/// </summary>
public static class SourceParams
{
extension(AlSource source)
{
/// <summary>
/// Sets a float-valued source property (<c>alSourcef</c>).
/// </summary>
public void Set(AlSourcef param, float value) => Al.PInvoke.Sourcef(source.Name, (int)param, value);
/// <summary>
/// Gets a float-valued source property (<c>alGetSourcef</c>).
/// </summary>
public float Get(AlSourcef param) => Al.GetSourcef(source.Name, (int)param);
/// <summary>
/// Sets an integer-valued source property (<c>alSourcei</c>).
/// </summary>
public void Set(AlSourcei param, int value) => Al.PInvoke.Sourcei(source.Name, (int)param, value);
/// <summary>
/// Gets an integer-valued source property (<c>alGetSourcei</c>).
/// </summary>
public int Get(AlSourcei param) => Al.GetSourcei(source.Name, (int)param);
/// <summary>
/// Sets a <see cref="float3"/>-valued source property (<c>alSource3f</c>).
/// </summary>
public void Set(AlSource3f param, float3 value) =>
Al.PInvoke.Source3f(source.Name, (int)param, value.X, value.Y, value.Z);
/// <summary>
/// Gets a <see cref="float3"/>-valued source property (<c>alGetSource3f</c>).
/// </summary>
public float3 Get(AlSource3f param) => Al.GetSource3f(source.Name, (int)param);
/// <summary>
/// Sets a double-valued source property (<c>alSourcedSOFT</c>); provided by <c>AL_SOFT_source_latency</c>.
/// </summary>
public void Set(AlSourced param, double value) => Al.PInvoke.SourcedSOFT(source.Name, (int)param, value);
/// <summary>
/// Gets a double-valued source property (<c>alGetSourcedSOFT</c>); provided by <c>AL_SOFT_source_latency</c>.
/// </summary>
public double Get(AlSourced param) => Al.GetSourcedSOFT(source.Name, (int)param);
/// <summary>
/// Sets a 64-bit-integer-valued source property (<c>alSourcei64SOFT</c>); provided by <c>AL_SOFT_source_latency</c>.
/// </summary>
public void Set(AlSourcei64 param, long value) => Al.PInvoke.Sourcei64SOFT(source.Name, (int)param, value);
/// <summary>
/// Gets a 64-bit-integer-valued source property (<c>alGetSourcei64SOFT</c>); provided by <c>AL_SOFT_source_latency</c>.
/// </summary>
public long Get(AlSourcei64 param) => Al.GetSourcei64SOFT(source.Name, (int)param);
}
}
/// <summary>
/// Keyed buffer query access (<c>alGetBufferi</c>) as an extension member on <see cref="AlBuffer"/>. All <see cref="AlBufferi"/> keys are get-only. Typical code uses the named properties on <see cref="AlBuffer"/> instead.
/// </summary>
public static class BufferParams
{
extension(AlBuffer buffer)
{
/// <summary>
/// Gets an integer-valued buffer query (<c>alGetBufferi</c>).
/// </summary>
public int Get(AlBufferi param) => Al.GetBufferi(buffer.Name, (int)param);
}
}
/// <summary>
/// Keyed listener parameter access (<c>alListenerf</c>/<c>alListener3f</c>). The listener is per-context state with no handle, so these are plain statics. Typical code uses the named properties on <see cref="Al.Listener"/> instead.
/// </summary>
public static class ListenerParams
{
/// <summary>
/// Sets a float-valued listener property (<c>alListenerf</c>).
/// </summary>
public static void Set(AlListenerf param, float value) => Al.PInvoke.Listenerf((int)param, value);
/// <summary>
/// Gets a float-valued listener property (<c>alGetListenerf</c>).
/// </summary>
public static float Get(AlListenerf param) => Al.GetListenerf((int)param);
/// <summary>
/// Sets a <see cref="float3"/>-valued listener property (<c>alListener3f</c>).
/// </summary>
public static void Set(AlListener3f param, float3 value) =>
Al.PInvoke.Listener3f((int)param, value.X, value.Y, value.Z);
/// <summary>
/// Gets a <see cref="float3"/>-valued listener property (<c>alGetListener3f</c>).
/// </summary>
public static float3 Get(AlListener3f param) => Al.GetListener3f((int)param);
}
}