-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable openAL and re-add files i shouldnt have removed
- Loading branch information
1 parent
4258f07
commit 551eec6
Showing
7 changed files
with
116 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
src/OpenToolkit.Core/Loader/IPlatformLibraryNameContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
57
src/OpenToolkit.Core/Loader/PlatformLibraryNameContainerBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."); | ||
} | ||
} | ||
} |