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 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. Game1 game = new Game1 ();
  43. game.Run ();
  44. }
  45. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  46. {
  47. return true;
  48. }
  49. }
  50. #else
  51. #error Unknown platform
  52. #endif
  53. }