Program.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Program.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. #endregion
  12. namespace HoneycombRush
  13. {
  14. #if WINDOWSS || XBOX
  15. static class Program
  16. {
  17. /// <summary>
  18. /// The main entry point for the application.
  19. /// </summary>
  20. static void Main(string[] args)
  21. {
  22. using (HoneycombRush game = new HoneycombRush())
  23. {
  24. game.Run();
  25. }
  26. }
  27. }
  28. #elif MAC
  29. static class Program
  30. {
  31. /// <summary>
  32. /// The main entry point for the application.
  33. /// </summary>
  34. static void Main (string[] args)
  35. {
  36. MonoMac.AppKit.NSApplication.Init ();
  37. using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
  38. MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
  39. MonoMac.AppKit.NSApplication.Main(args);
  40. }
  41. }
  42. }
  43. class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
  44. {
  45. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  46. {
  47. using (HoneycombRush game = new HoneycombRush()){
  48. game.Run();
  49. }
  50. }
  51. public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
  52. {
  53. return true;
  54. }
  55. }
  56. #endif
  57. }