Make the custom dll import resolver optional
This commit is contained in:
parent
9fe148d874
commit
0b6ff007c7
1 changed files with 0 additions and 12 deletions
|
|
@ -24,18 +24,6 @@ public static unsafe partial class Raylib
|
|||
public const float DEG2RAD = MathF.PI / 180.0f;
|
||||
public const float RAD2DEG = 180.0f / MathF.PI;
|
||||
|
||||
static Raylib()
|
||||
{
|
||||
// On WebAssembly (browser) the native library is statically linked into the main
|
||||
// module, and P/Invokes are resolved by the runtime's built-in static-linking table.
|
||||
// A custom resolver would override that and fail (there is no library to load), so we
|
||||
// only install it on platforms where raylib is a separate dynamic library.
|
||||
if (!OperatingSystem.IsBrowser())
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), ResolveDllImport);
|
||||
}
|
||||
}
|
||||
|
||||
public static IntPtr ResolveDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
|
||||
{
|
||||
IntPtr handle = IntPtr.Zero;
|
||||
|
|
|
|||
Loading…
Reference in a new issue