2
0

Program.cs 1.2 KB

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