2
0

Program.cs 1.1 KB

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