Skip to content

Commit a8d1cab

Browse files
authored
Fix OpenAL extensions (#602)
1 parent f96e9fc commit a8d1cab

35 files changed

+301
-49
lines changed

Silk.NET.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.OpenXR.Extensions.
452452
EndProject
453453
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TriangleNET6", "src\Lab\Experiments\TriangleNET6\TriangleNET6.csproj", "{477046D2-AF81-4E2B-83BD-20176A971FDD}"
454454
EndProject
455+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenAL.Tests", "src\OpenAL\Silk.NET.OpenAL.Tests\Silk.NET.OpenAL.Tests.csproj", "{514DED00-4DA3-46D1-B2E8-10CE826CD52D}"
456+
EndProject
455457
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL Demos", "OpenGL Demos", "{2F547104-C74A-4A84-8980-D1B973CC40C1}"
456458
EndProject
457459
Global
@@ -2707,6 +2709,18 @@ Global
27072709
{477046D2-AF81-4E2B-83BD-20176A971FDD}.Release|x64.Build.0 = Release|Any CPU
27082710
{477046D2-AF81-4E2B-83BD-20176A971FDD}.Release|x86.ActiveCfg = Release|Any CPU
27092711
{477046D2-AF81-4E2B-83BD-20176A971FDD}.Release|x86.Build.0 = Release|Any CPU
2712+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2713+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|Any CPU.Build.0 = Debug|Any CPU
2714+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|x64.ActiveCfg = Debug|Any CPU
2715+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|x64.Build.0 = Debug|Any CPU
2716+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|x86.ActiveCfg = Debug|Any CPU
2717+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Debug|x86.Build.0 = Debug|Any CPU
2718+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|Any CPU.ActiveCfg = Release|Any CPU
2719+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|Any CPU.Build.0 = Release|Any CPU
2720+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|x64.ActiveCfg = Release|Any CPU
2721+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|x64.Build.0 = Release|Any CPU
2722+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|x86.ActiveCfg = Release|Any CPU
2723+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D}.Release|x86.Build.0 = Release|Any CPU
27102724
EndGlobalSection
27112725
GlobalSection(SolutionProperties) = preSolution
27122726
HideSolutionNode = FALSE
@@ -2925,6 +2939,7 @@ Global
29252939
{AE5A7BBD-E303-46C4-9DDC-29E80C9128F5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
29262940
{0D1E5AD9-E329-4B84-A5FE-FC1EE33BF038} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
29272941
{477046D2-AF81-4E2B-83BD-20176A971FDD} = {39B598E9-44BA-4A61-A1BB-7C543734DBA6}
2942+
{514DED00-4DA3-46D1-B2E8-10CE826CD52D} = {081E7761-B200-4DBF-8950-941464DECACE}
29282943
{2F547104-C74A-4A84-8980-D1B973CC40C1} = {6842A2C6-5C7B-42DD-9825-0EDE91BFEBF7}
29292944
{58E7EE89-B67C-482D-9605-04B3BCC5CFBB} = {2F547104-C74A-4A84-8980-D1B973CC40C1}
29302945
EndGlobalSection

src/Core/Silk.NET.Core/Native/NativeAPI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public abstract class NativeAPI : NativeApiContainer
1414
public INativeContext Context { get; }
1515

1616
/// <inheritdoc />
17-
protected NativeAPI(INativeContext ctx)
17+
public NativeAPI(INativeContext ctx)
1818
: base(ctx)
1919
{
2020
Context = ctx;

src/Core/Silk.NET.Core/Native/NativeApiContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public abstract class NativeApiContainer : IDisposable
1515
protected readonly INativeContext _ctx;
1616
private IVTable _vTable;
1717

18-
protected NativeApiContainer(INativeContext ctx)
18+
public NativeApiContainer(INativeContext ctx)
1919
{
2020
_ctx = ctx;
2121
// Virtual member call should be fine unless we have a rogue implementer

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.Creative/EffectExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ namespace Silk.NET.OpenAL.Extensions.Creative
1111
/// <summary>
1212
/// Exposes the functions of the Effects Extension.
1313
/// </summary>
14-
[Extension("AL_EXT_EFX")]
14+
[Extension("ALC_EXT_EFX")] // the ALC_ prefix is misleading
1515
[NativeApi(Prefix = "al")]
1616
public partial class EffectExtension : NativeExtension<AL>
1717
{
1818
/// <inheritdoc cref="ExtensionBase" />
19-
protected EffectExtension(INativeContext ctx)
19+
public EffectExtension(INativeContext ctx)
2020
: base(ctx)
2121
{
2222
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.Creative/EffectExtensionContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ namespace Silk.NET.OpenAL.Extensions.Creative
1111
/// <summary>
1212
/// Exposes the context-related functions of the Effects Extension.
1313
/// </summary>
14-
[Extension("AL_EXT_EFX")]
14+
[Extension("ALC_EXT_EFX")]
1515
[NativeApi(Prefix = "alc")]
16-
public partial class EffectExtensionContext : NativeExtension<AL>
16+
public partial class EffectExtensionContext : NativeExtension<ALContext>
1717
{
1818
/// <inheritdoc cref="ExtensionBase" />
19-
protected EffectExtensionContext(INativeContext ctx)
19+
public EffectExtensionContext(INativeContext ctx)
2020
: base(ctx)
2121
{
2222
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.Creative/EnumerateAll.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Silk.NET.OpenAL.Extensions.Creative
1818
public partial class EnumerateAll : ContextExtensionBase
1919
{
2020
/// <inheritdoc cref="ExtensionBase" />
21-
protected EnumerateAll(INativeContext ctx)
21+
public EnumerateAll(INativeContext ctx)
2222
: base(ctx)
2323
{
2424
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.Creative/MultiChannelBuffers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace Silk.NET.OpenAL.Extensions.Creative
1010
/// <summary>
1111
/// Exposes the multi-channel buffers extension by Creative Labs.
1212
/// </summary>
13-
[Extension("AL_EXT_EFX")]
13+
[Extension("AL_EXT_MCFORMATS")]
1414
[NativeApi(Prefix = "al")]
1515
public partial class MultiChannelBuffers : FormatExtensionBase<MultiChannelBufferFormat>
1616
{
1717
/// <inheritdoc cref="ExtensionBase" />
18-
protected MultiChannelBuffers(INativeContext ctx)
18+
public MultiChannelBuffers(INativeContext ctx)
1919
: base(ctx)
2020
{
2121
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.Creative/XRam.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public partial class XRam : NativeExtension<AL>
2626
private readonly int _ramSize;
2727

2828
/// <inheritdoc cref="NativeLibraryBase" />
29-
protected XRam(INativeContext ctx)
29+
public XRam(INativeContext ctx)
3030
: base(ctx)
3131
{
3232
_bufferStorageModeAutomatic = GetEnumValue("AL_STORAGE_AUTOMATIC");
@@ -38,6 +38,7 @@ protected XRam(INativeContext ctx)
3838
}
3939

4040
/// <inheritdoc />
41+
[NativeApi(Prefix = "al")]
4142
public partial int GetInteger(int param);
4243

4344
/// <inheritdoc />
@@ -199,8 +200,11 @@ private BufferStorageMode GetEnumForValue(int value)
199200
}
200201

201202
[return: UnmanagedType(UnmanagedType.I4)]
203+
[NativeApi(Prefix = "al")]
202204
public partial bool IsExtensionPresent(string name);
205+
[NativeApi(Prefix = "al")]
203206
public partial nint GetProcAddress(string name);
207+
[NativeApi(Prefix = "al")]
204208
public partial int GetEnumValue(string name);
205209
}
206210
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.EXT/ALAWFormat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Silk.NET.OpenAL.Extensions.EXT
1515
public partial class ALAWFormat : FormatExtensionBase<ALAWBufferFormat>
1616
{
1717
/// <inheritdoc cref="ExtensionBase" />
18-
protected ALAWFormat(INativeContext ctx)
18+
public ALAWFormat(INativeContext ctx)
1919
: base(ctx)
2020
{
2121
}

src/OpenAL/Extensions/Silk.NET.OpenAL.Extensions.EXT/Capture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Silk.NET.OpenAL.Extensions.EXT
1717
public partial class Capture : ContextExtensionBase
1818
{
1919
/// <inheritdoc cref="ExtensionBase" />
20-
protected Capture(INativeContext ctx)
20+
public Capture(INativeContext ctx)
2121
: base(ctx)
2222
{
2323
}

0 commit comments

Comments
 (0)