main.cs 826 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using MonoMac.AppKit;
  2. using MonoMac.Foundation;
  3. namespace Microsoft.Xna.Samples.Draw2D
  4. {
  5. class Program
  6. {
  7. static void Main (string[] args)
  8. {
  9. NSApplication.Init ();
  10. using (var p = new NSAutoreleasePool ()) {
  11. NSApplication.SharedApplication.Delegate = new AppDelegate ();
  12. // Set our Application Icon
  13. NSImage appIcon = NSImage.ImageNamed ("monogameicon.png");
  14. NSApplication.SharedApplication.ApplicationIconImage = appIcon;
  15. NSApplication.Main (args);
  16. }
  17. }
  18. }
  19. class AppDelegate : NSApplicationDelegate
  20. {
  21. private Game1 game;
  22. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  23. {
  24. game = new Game1 ();
  25. game.Run ();
  26. }
  27. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  28. {
  29. return true;
  30. }
  31. }
  32. }