Skip to content

Commit

Permalink
enable openAL and re-add files i shouldnt have removed
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikja163 committed Apr 19, 2020
1 parent 4258f07 commit 551eec6
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 5 deletions.
7 changes: 7 additions & 0 deletions OpenTK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenToolkit.Windowing.Graph
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenToolkit.Windowing.Desktop", "src\OpenToolkit.Windowing.Desktop\OpenToolkit.Windowing.Desktop.csproj", "{172C1E62-DA67-4203-BBCB-9DA4D9111EF0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenToolkit.OpenAL.Extensions.Creative.EFX", "src\OpenAL\Extensions\OpenToolkit.OpenAL.Extensions.Creative.EFX\OpenToolkit.OpenAL.Extensions.Creative.EFX.csproj", "{EB8523E3-04A7-485B-960A-352204492642}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -156,6 +158,10 @@ Global
{5F47DB55-4BFC-4832-A68F-AB36CE7431CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F47DB55-4BFC-4832-A68F-AB36CE7431CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F47DB55-4BFC-4832-A68F-AB36CE7431CE}.Release|Any CPU.Build.0 = Release|Any CPU
{EB8523E3-04A7-485B-960A-352204492642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB8523E3-04A7-485B-960A-352204492642}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB8523E3-04A7-485B-960A-352204492642}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB8523E3-04A7-485B-960A-352204492642}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -171,6 +177,7 @@ Global
{172C1E62-DA67-4203-BBCB-9DA4D9111EF0} = {BBBE802B-9F6E-4299-97CE-97CDA43802B9}
{17FB3437-BD1A-423B-B333-B2D7F775BC79} = {BF0E6BAA-C31F-4481-924B-3EE9826BEE4D}
{5F47DB55-4BFC-4832-A68F-AB36CE7431CE} = {BF0E6BAA-C31F-4481-924B-3EE9826BEE4D}
{EB8523E3-04A7-485B-960A-352204492642} = {BF0E6BAA-C31F-4481-924B-3EE9826BEE4D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {82DDE6D6-0D55-49B4-9C64-B31B4A6E729F}
Expand Down
4 changes: 3 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ let releaseProjects =
-- "src/Generator.Converter/**"
-- "src/Generator.Rewrite/**"
-- "src/SpecificationOpenGL/**"
-- "src/OpenAL/**"
-- "src/OpenAL/OpenALGenerator/**"
-- "src/OpenAL/OpenALTest/**"
-- "src/OpenAL/OpenToolkit.OpenAL.Extensions/**"


// Absolutely all test projects.
Expand Down
3 changes: 0 additions & 3 deletions src/OpenAL/OpenToolkit.OpenAL/Extensions/Creative.EFX/EFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

using System;
using System.Runtime.InteropServices;
using AdvancedDLSupport;
using OpenToolkit.Core.Extensions;
using OpenToolkit.Core.Loader;
using OpenToolkit.Mathematics;

namespace OpenToolkit.Audio.OpenAL.Extensions.Creative.EFX
Expand Down
1 change: 0 additions & 1 deletion src/OpenAL/OpenToolkit.OpenAL/OpenToolkit.OpenAL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AdvancedDLSupport" Version="3.1.0" />
<PackageReference Include="System.Buffers" Version="4.5.0" />
</ItemGroup>

Expand Down
10 changes: 10 additions & 0 deletions src/OpenAL/OpenToolkit.OpenAL/paket
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type file
id OpenToolkit.OpenAL
dependencies
framework: netcoreapp3.1
OpenToolkit.Core ~> #VERSION#
OpenToolkit.Mathematics ~> #VERSION#
files
bin\Release\netcoreapp3.1\OpenToolkit.OpenAL.dll ==> lib\netcoreapp3.1
bin\Release\netcoreapp3.1\OpenToolkit.OpenAL.xml ==> lib\netcoreapp3.1
bin\Release\netcoreapp3.1\OpenToolkit.OpenAL.pdb ==> lib\netcoreapp3.1
39 changes: 39 additions & 0 deletions src/OpenToolkit.Core/Loader/IPlatformLibraryNameContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace OpenToolkit.Core.Loader
{
/// <summary>
/// Defines a class that holds library names used on various platforms.
/// </summary>
public interface IPlatformLibraryNameContainer
{
/// <summary>
/// Gets the library name to use on Windows.
/// </summary>
string Windows { get; }

/// <summary>
/// Gets the library name to use on Linux.
/// </summary>
string Linux { get; }

/// <summary>
/// Gets the library name to use on MacOS.
/// </summary>
string MacOS { get; }

/// <summary>
/// Gets the library name to use on Android.
/// </summary>
string Android { get; }

/// <summary>
/// Gets the library name to use on iOS.
/// </summary>
string IOS { get; }

/// <summary>
/// Gets the library name to use on the current platform.
/// </summary>
/// <returns>The library name.</returns>
string GetLibraryName();
}
}
57 changes: 57 additions & 0 deletions src/OpenToolkit.Core/Loader/PlatformLibraryNameContainerBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Runtime.InteropServices;

namespace OpenToolkit.Core.Loader
{
/// <summary>
/// Base class for a class that holds library names used on various platforms.
/// </summary>
public abstract class PlatformLibraryNameContainerBase : IPlatformLibraryNameContainer
{
/// <inheritdoc/>
public abstract string Linux { get; }

/// <inheritdoc/>
public abstract string Windows { get; }

/// <inheritdoc/>
public abstract string MacOS { get; }

/// <inheritdoc/>
public abstract string Android { get; }

/// <inheritdoc/>
public abstract string IOS { get; }

/// <inheritdoc/>
public virtual string GetLibraryName()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")))
{
return Android;
}

return Linux;
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return Windows;
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")))
{
return Android;
}

return MacOS;
}

throw new NotSupportedException("The library name couldn't be resolved for the given platform.");
}
}
}

0 comments on commit 551eec6

Please sign in to comment.