From e07402105e279a5509d814acf3cc5a5d32115a76 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 8 Mar 2023 11:51:09 +0300 Subject: [PATCH] Bump projects to .NET 6 and add `DllImport` resolver for iOS --- SDL2-CS.csproj | 2 +- src/SDL2.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SDL2-CS.csproj b/SDL2-CS.csproj index a4a92d4..2577901 100644 --- a/SDL2-CS.csproj +++ b/SDL2-CS.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + net6.0 Library true SDL2# diff --git a/src/SDL2.cs b/src/SDL2.cs index b165b04..3dbc40f 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -37,6 +37,12 @@ namespace SDL2 { public static class SDL { + static SDL() + { + if (OperatingSystem.IsIOS()) + NativeLibrary.SetDllImportResolver(typeof(SDL).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL2.framework/SDL2", assembly, path)); + } + #region SDL2# Variables private const string nativeLibName = "SDL2";