Program.cs 1.1 KB

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