From 76b0b15d974fe1c100c5fe8f588b0d0e39e2f23d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 17:56:22 +0900 Subject: [PATCH 1/7] Add SDL3_mixer to Android .slnf --- SDL3-CS.Android.slnf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SDL3-CS.Android.slnf b/SDL3-CS.Android.slnf index 87feeeb..4c6d303 100644 --- a/SDL3-CS.Android.slnf +++ b/SDL3-CS.Android.slnf @@ -2,12 +2,13 @@ "solution": { "path": "SDL3-CS.sln", "projects": [ - "SDL3-CS\\SDL3-CS.csproj", - "SDL3_ttf-CS\\SDL3_ttf-CS.csproj", - "SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj", + "SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj", "SDL3-CS.Tests\\SDL3-CS.Tests.csproj", - "SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj" + "SDL3-CS\\SDL3-CS.csproj", + "SDL3_image-CS\\SDL3_image-CS.csproj", + "SDL3_mixer-CS\\SDL3_mixer-CS.csproj", + "SDL3_ttf-CS\\SDL3_ttf-CS.csproj" ] } -} +} \ No newline at end of file From 9165d3b0773ad65759cb683168bb66fdb19b8b9d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 17:56:33 +0900 Subject: [PATCH 2/7] Shortcase Android library includes --- .../SDL3-CS.Tests.Android.csproj | 44 ++----------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj b/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj index dc98933..2b792f0 100644 --- a/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj +++ b/SDL3-CS.Tests.Android/SDL3-CS.Tests.Android.csproj @@ -21,52 +21,16 @@ - + armeabi-v7a - + arm64-v8a - + x86 - - x86_64 - - - armeabi-v7a - - - arm64-v8a - - - x86 - - - x86_64 - - - armeabi-v7a - - - arm64-v8a - - - x86 - - - x86_64 - - - armeabi-v7a - - - arm64-v8a - - - x86 - - + x86_64 From 12d3f7a37f911d4f585293f184dfbce927e7a3ca Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 17:57:52 +0900 Subject: [PATCH 3/7] Add SDL3_mixer to iOS .slnf --- SDL3-CS.iOS.slnf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SDL3-CS.iOS.slnf b/SDL3-CS.iOS.slnf index 73da442..4e9f609 100644 --- a/SDL3-CS.iOS.slnf +++ b/SDL3-CS.iOS.slnf @@ -2,12 +2,13 @@ "solution": { "path": "SDL3-CS.sln", "projects": [ - "SDL3-CS\\SDL3-CS.csproj", - "SDL3_ttf-CS\\SDL3_ttf-CS.csproj", - "SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj", + "SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj", "SDL3-CS.Tests\\SDL3-CS.Tests.csproj", - "SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj" + "SDL3-CS\\SDL3-CS.csproj", + "SDL3_image-CS\\SDL3_image-CS.csproj", + "SDL3_mixer-CS\\SDL3_mixer-CS.csproj", + "SDL3_ttf-CS\\SDL3_ttf-CS.csproj" ] } -} +} \ No newline at end of file From 11604347e127bab8bc7f7046266de7da8600a079 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 19:19:56 +0900 Subject: [PATCH 4/7] Add other libraries to iOS build --- SDL3-CS.Tests.iOS/Main.cs | 3 +++ SDL3-CS.Tests.iOS/SDL3-CS.Tests.iOS.csproj | 3 +++ 2 files changed, 6 insertions(+) diff --git a/SDL3-CS.Tests.iOS/Main.cs b/SDL3-CS.Tests.iOS/Main.cs index a1a8eb1..cf18b8a 100644 --- a/SDL3-CS.Tests.iOS/Main.cs +++ b/SDL3-CS.Tests.iOS/Main.cs @@ -7,6 +7,9 @@ public class Program public static unsafe void Main(string[] args) { NativeLibrary.SetDllImportResolver(typeof(SDL3).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3.framework/SDL3", assembly, path)); + NativeLibrary.SetDllImportResolver(typeof(SDL3_image).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_image.framework/SDL3_image", assembly, path)); + NativeLibrary.SetDllImportResolver(typeof(SDL3_ttf).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_ttf.framework/SDL3_ttf", assembly, path)); + NativeLibrary.SetDllImportResolver(typeof(SDL3_mixer).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_mixer.framework/SDL3_mixer", assembly, path)); SDL3.SDL_RunApp(0, null, &main, IntPtr.Zero); } diff --git a/SDL3-CS.Tests.iOS/SDL3-CS.Tests.iOS.csproj b/SDL3-CS.Tests.iOS/SDL3-CS.Tests.iOS.csproj index 9c23c76..78b0ba0 100644 --- a/SDL3-CS.Tests.iOS/SDL3-CS.Tests.iOS.csproj +++ b/SDL3-CS.Tests.iOS/SDL3-CS.Tests.iOS.csproj @@ -21,6 +21,9 @@ + + + From 6fc5f872edf8c4b71a77c20fadd86eb60e7b927b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 19:21:55 +0900 Subject: [PATCH 5/7] Fix runtime crash due to missing AOT module --- SDL3-CS/JetBrainsAnnotations.cs | 29 +++++++++++++++++++++++++++++ SDL3-CS/SDL3-CS.csproj | 4 ---- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 SDL3-CS/JetBrainsAnnotations.cs diff --git a/SDL3-CS/JetBrainsAnnotations.cs b/SDL3-CS/JetBrainsAnnotations.cs new file mode 100644 index 0000000..72d6be2 --- /dev/null +++ b/SDL3-CS/JetBrainsAnnotations.cs @@ -0,0 +1,29 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; + +// https://github.com/JetBrains/JetBrains.Annotations/blob/988289d09aad925b22a5321c075a735cb9597e59/src/Annotations.cs +namespace JetBrains.Annotations +{ + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Parameter)] + internal sealed class MustDisposeResourceAttribute : Attribute + { + public MustDisposeResourceAttribute() + { + Value = true; + } + + public MustDisposeResourceAttribute(bool value) + { + Value = value; + } + + /// + /// When set to false, disposing of the resource is not obligatory. + /// The main use-case for explicit [MustDisposeResource(false)] annotation + /// is to loosen the annotation for inheritors. + /// + public bool Value { get; } + } +} diff --git a/SDL3-CS/SDL3-CS.csproj b/SDL3-CS/SDL3-CS.csproj index 3fa7652..cae31a2 100644 --- a/SDL3-CS/SDL3-CS.csproj +++ b/SDL3-CS/SDL3-CS.csproj @@ -32,10 +32,6 @@ - - all - - all From a9ec26bcbd78da8ae9be52c508dfb3c85fb73877 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 19:28:52 +0900 Subject: [PATCH 6/7] Add SDL3_mixer to Desktop .slnf --- SDL3-CS.Desktop.slnf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SDL3-CS.Desktop.slnf b/SDL3-CS.Desktop.slnf index 70fda20..d33a587 100644 --- a/SDL3-CS.Desktop.slnf +++ b/SDL3-CS.Desktop.slnf @@ -2,12 +2,13 @@ "solution": { "path": "SDL3-CS.sln", "projects": [ - "SDL3-CS\\SDL3-CS.csproj", - "SDL3_ttf-CS\\SDL3_ttf-CS.csproj", - "SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj", + "SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj", "SDL3-CS.Tests\\SDL3-CS.Tests.csproj", - "SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj" + "SDL3-CS\\SDL3-CS.csproj", + "SDL3_image-CS\\SDL3_image-CS.csproj", + "SDL3_mixer-CS\\SDL3_mixer-CS.csproj", + "SDL3_ttf-CS\\SDL3_ttf-CS.csproj" ] } -} +} \ No newline at end of file From 7078b56bccebe28f0e31fea834096bd7fefa70f9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Aug 2025 19:35:30 +0900 Subject: [PATCH 7/7] Improve lib resolving for desktop project --- .../SDL3-CS.Tests.Desktop.csproj | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/SDL3-CS.Tests.Desktop/SDL3-CS.Tests.Desktop.csproj b/SDL3-CS.Tests.Desktop/SDL3-CS.Tests.Desktop.csproj index 481a9d4..4729db5 100644 --- a/SDL3-CS.Tests.Desktop/SDL3-CS.Tests.Desktop.csproj +++ b/SDL3-CS.Tests.Desktop/SDL3-CS.Tests.Desktop.csproj @@ -17,21 +17,12 @@ - $([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) - - - $(RuntimeIdentifier)\SDL3.dll - $(RuntimeIdentifier)\libSDL3.so - $(RuntimeIdentifier)\libSDL3.dylib - - - win-$(SDLArch.ToLower())\SDL3.dll - linux-$(SDLArch.ToLower())\libSDL3.so - osx-$(SDLArch.ToLower())\libSDL3.dylib + $(NETCoreSdkRuntimeIdentifier) + $(RuntimeIdentifier) - + PreserveNewest