Program.cs 874 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using MonoMac.AppKit;
  2. using MonoMac.Foundation;
  3. using MonoMac.CoreGraphics;
  4. using System.Runtime.InteropServices;
  5. namespace MonoTest
  6. {
  7. class Program
  8. {
  9. static void Main (string [] args)
  10. {
  11. NSApplication.Init ();
  12. using (var p = new NSAutoreleasePool ()) {
  13. NSApplication.SharedApplication.Delegate = new AppDelegate();
  14. NSApplication.Main(args);
  15. }
  16. }
  17. }
  18. class AppDelegate : NSApplicationDelegate
  19. {
  20. Game1 game;
  21. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  22. {
  23. using (game = new Game1()) {
  24. game.Run ();
  25. }
  26. }
  27. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  28. {
  29. return true;
  30. }
  31. }
  32. }