Program.cs 846 B

123456789101112131415161718192021222324252627282930313233343536
  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. game = new Game1();
  24. game.Run ();
  25. }
  26. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  27. {
  28. return true;
  29. }
  30. }
  31. }