mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Removed OpenTK DllMap code.
Wasn't necessary anymore.
This commit is contained in:
@@ -54,6 +54,7 @@ END TEMPLATE-->
|
||||
|
||||
* Changed thread safety around `ResourceManager`'s VFS roots, removing the use of error prone reader-writer locks.
|
||||
* SDL2 log now shows log category.
|
||||
* Removed OpenTK DllMap code.
|
||||
|
||||
|
||||
## 0.85.2.0
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenToolkit.Graphics.OpenGL4;
|
||||
|
||||
namespace Robust.Client.Graphics.Clyde
|
||||
{
|
||||
@@ -21,61 +17,6 @@ namespace Robust.Client.Graphics.Clyde
|
||||
NativeLibrary.TryLoad("nvapi64.dll", out _);
|
||||
// If this fails whatever.
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NativeLibrary.SetDllImportResolver(typeof(GL).Assembly, (name, assembly, path) =>
|
||||
{
|
||||
if (OperatingSystem.IsLinux()
|
||||
&& _dllMapLinux.TryGetValue(name, out var mappedName))
|
||||
{
|
||||
return NativeLibrary.Load(mappedName);
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsMacOS()
|
||||
&& _dllMapMacOS.TryGetValue(name, out mappedName))
|
||||
{
|
||||
return NativeLibrary.Load(mappedName);
|
||||
}
|
||||
|
||||
return IntPtr.Zero;
|
||||
});
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
||||
private static readonly Dictionary<string, string> _dllMapLinux = new()
|
||||
{
|
||||
{"opengl32.dll", "libGL.so.1"},
|
||||
{"glu32.dll", "libGLU.so.1"},
|
||||
{"openal32.dll", "libopenal.so.1"},
|
||||
{"alut.dll", "libalut.so.0"},
|
||||
{"opencl.dll", "libOpenCL.so"},
|
||||
{"libX11", "libX11.so.6"},
|
||||
{"libXi", "libXi.so.6"},
|
||||
{"SDL2.dll", "libSDL2-2.0.so.0"}
|
||||
};
|
||||
|
||||
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
||||
private static readonly Dictionary<string, string> _dllMapMacOS = new()
|
||||
{
|
||||
{"opengl32.dll", "/System/Library/Frameworks/OpenGL.framework/OpenGL"},
|
||||
{"openal32.dll", "/System/Library/Frameworks/OpenAL.framework/OpenAL"},
|
||||
{"alut.dll", "/System/Library/Frameworks/OpenAL.framework/OpenAL"},
|
||||
{"libGLES.dll", "/System/Library/Frameworks/OpenGLES.framework/OpenGLES"},
|
||||
{"libGLESv1_CM.dll", "/System/Library/Frameworks/OpenGLES.framework/OpenGLES"},
|
||||
{"libGLESv2.dll", "/System/Library/Frameworks/OpenGLES.framework/OpenGLES"},
|
||||
{"opencl.dll", "/System/Library/Frameworks/OpenCL.framework/OpenCL"},
|
||||
{"SDL2.dll", "libSDL2.dylib"},
|
||||
{"libGL.so.1", "/usr/X11/lib/libGL.dylib"},
|
||||
{"libXcursor.so.1", "/usr/X11/lib/libXcursor.dylib"},
|
||||
{"libXinerama", "/usr/X11/lib/libXinerama.dylib"},
|
||||
{"libX11", "/usr/X11/lib/libX11.dylib"},
|
||||
{"libXrandr.so.2", "/usr/X11/lib/libXrandr.dylib"},
|
||||
{"libXi", "/usr/X11/lib/libXi.dylib"}
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user