2
0

Program.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using MonoMac.Foundation;
  3. using MonoMac.AppKit;
  4. using MonoMac.ObjCRuntime;
  5. namespace Gemstone_Hunter
  6. {
  7. #if WINDOWS || XBOX
  8. static class Program
  9. {
  10. /// <summary>
  11. /// The main entry point for the application.
  12. /// </summary>
  13. static void Main(string[] args)
  14. {
  15. using (Game1 game = new Game1())
  16. {
  17. game.Run();
  18. }
  19. }
  20. }
  21. #else
  22. static class Program
  23. {
  24. /// <summary>
  25. /// The main entry point for the application.
  26. /// </summary>
  27. static void Main (string[] args)
  28. {
  29. NSApplication.Init ();
  30. using (var p = new NSAutoreleasePool ()) {
  31. NSApplication.SharedApplication.Delegate = new AppDelegate();
  32. NSApplication.Main(args);
  33. }
  34. }
  35. }
  36. class AppDelegate : NSApplicationDelegate
  37. {
  38. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  39. {
  40. using (Game1 game = new Game1 ()) {
  41. game.Run ();
  42. }
  43. }
  44. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  45. {
  46. return true;
  47. }
  48. }
  49. #endif
  50. }