2
0

Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. #if MONOMAC
  3. using MonoMac.Foundation;
  4. using MonoMac.AppKit;
  5. using MonoMac.ObjCRuntime;
  6. #endif
  7. namespace Robot_Rampage
  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. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  41. {
  42. using (Game1 game = new Game1 ()) {
  43. game.Run ();
  44. }
  45. }
  46. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  47. {
  48. return true;
  49. }
  50. }
  51. #else
  52. #error Unknown platform
  53. #endif
  54. }