]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - SuperPolarityMac/Main.cs
Works in win, compiles in mac
[rbdr/super-polarity] / SuperPolarityMac / Main.cs
diff --git a/SuperPolarityMac/Main.cs b/SuperPolarityMac/Main.cs
new file mode 100644 (file)
index 0000000..f21bf0b
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoMac.AppKit;
+using MonoMac.Foundation;
+
+namespace SuperPolarityMac
+{
+       static class Program
+       {
+               /// <summary>
+               /// The main entry point for the application.
+               /// </summary>
+               static void Main (string[] args)
+               {
+                       NSApplication.Init ();
+                       
+                       using (var p = new NSAutoreleasePool ()) {
+                               NSApplication.SharedApplication.Delegate = new AppDelegate ();
+                               NSApplication.Main (args);
+                       }
+
+
+               }
+       }
+
+       class AppDelegate : NSApplicationDelegate
+       {
+               Game1 game;
+
+               public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+               {
+                       game = new Game1 ();
+                       game.Run ();
+               }
+
+               public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
+               {
+                       return true;
+               }
+       }
+}
+
+