Skip to content

Commit

Permalink
AOT: Integrate SDL_RunApp into Main
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Dec 21, 2024
1 parent 8daa024 commit 59a6fbe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions RogueCastle/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ public static class Program
/// <summary>
/// The main entry point for the application.
/// </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)
#endif
{
Environment.SetEnvironmentVariable("FNA_PLATFORM_BACKEND", "SDL3");

Expand Down Expand Up @@ -123,6 +135,10 @@ static void Main(string[] args)
// #endif
//}
Steamworks.Shutdown();

#if NET
return 0;
#endif
}

public static readonly string OSDir = GetOSDir();
Expand Down

0 comments on commit 59a6fbe

Please sign in to comment.