Skip to content

Commit

Permalink
OpenAL MCFormats extension (#1618)
Browse files Browse the repository at this point in the history
* start of openal ext_mcformats support

* OpenAL EXT_MCFORMATS support

* Improve docs
  • Loading branch information
aleksrutins committed Aug 20, 2023
1 parent 4cea82a commit e980241
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Silk.NET.OpenAL.Extensions.EXT.Enums
{
/// <summary>
/// Defines valid format specifiers for sound samples. This covers the additions from the OpenAL multi-channel buffers
/// extension.
/// </summary>
public enum MCBufferFormat
{
/// <summary>
/// 4 channels, unsigned 8-bit
/// </summary>
Quad8 = 0x1204,
/// <summary>
/// 4 channels, signed 16-bit
/// </summary>
Quad16 = 0x1205,
/// <summary>
/// 4 channels, 32-bit float
/// </summary>
Quad32 = 0x1206,

/// <summary>
/// 2 channels, unsigned 8-bit
/// </summary>
Rear8 = 0x1207,
/// <summary>
/// 2 channels, signed 16-bit
/// </summary>
Rear16 = 0x1208,
/// <summary>
/// 2 channels, 32-bit float
/// </summary>
Rear32 = 0x1209,

/// <summary>
/// 5.1 (6 channels), unsigned 8-bit
/// </summary>
S51Chn8 = 0x120A,
/// <summary>
/// 5.1 (6 channels), signed 16-bit
/// </summary>
S51Chn16 = 0x120B,
/// <summary>
/// 5.1 (6 channels), 32-bit float
/// </summary>
S51Chn32 = 0x120C,

/// <summary>
/// 6.1 (7 channels), unsigned 8-bit
/// </summary>
S61Chn8 = 0x120D,
/// <summary>
/// 6.1 (7 channels), signed 16-bit
/// </summary>
S61Chn16 = 0x120E,
/// <summary>
/// 6.1 (7 channels), 32-bit float
/// </summary>
S61Chn32 = 0x120F,

/// <summary>
/// 7.1 (8 channels), unsigned 8-bit
/// </summary>
S71Chn8 = 0x1210,
/// <summary>
/// 7.1 (8 channels), signed 16-bit
/// </summary>
S71Chn16 = 0x1211,
/// <summary>
/// 7.1 (8 channels), 32-bit float
/// </summary>
S71Chn32 = 0x1212
}
}
26 changes: 26 additions & 0 deletions src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.EXT/MCFormats.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Silk.NET.Core.Attributes;
using Silk.NET.Core.Contexts;
using Silk.NET.Core.Native;
using Silk.NET.OpenAL.Extensions.EXT.Enums;

namespace Silk.NET.OpenAL.Extensions.EXT
{

/// <summary>
/// Exposes the OpenAL multi-channel buffers extension.
/// </summary>
[Extension("AL_EXT_MCFORMATS")]
[NativeApi(Prefix = "al")]
public partial class MCFormats : FormatExtensionBase<MCBufferFormat>
{
/// <inheritdoc cref="ExtensionBase" />
public MCFormats(INativeContext ctx)
: base(ctx)
{
}
}

}

0 comments on commit e980241

Please sign in to comment.