Program.cs 1.2 KB

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