AOT: Integrate SDL_RunApp into Main
Some checks failed
CI / Linux (push) Has been cancelled

This commit is contained in:
Ethan Lee 2024-12-21 01:05:56 -05:00
parent 8daa0242a6
commit 59a6fbec87

View file

@ -10,7 +10,19 @@ namespace RogueCastle
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
#if NET
static void Main(string[] realArgs)
{
args = realArgs;
SDL.SDL_RunApp(0, IntPtr.Zero, RealMain, IntPtr.Zero);
}
static string[] args;
static int RealMain(int argc, IntPtr argv)
#else
static void Main(string[] args) static void Main(string[] args)
#endif
{ {
Environment.SetEnvironmentVariable("FNA_PLATFORM_BACKEND", "SDL3"); Environment.SetEnvironmentVariable("FNA_PLATFORM_BACKEND", "SDL3");
@ -123,6 +135,10 @@ namespace RogueCastle
// #endif // #endif
//} //}
Steamworks.Shutdown(); Steamworks.Shutdown();
#if NET
return 0;
#endif
} }
public static readonly string OSDir = GetOSDir(); public static readonly string OSDir = GetOSDir();