Program.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. using System;
  10. namespace UseCustomVertexWindows
  11. {
  12. #if WINDOWS || XBOX
  13. static class Program
  14. {
  15. /// <summary>
  16. /// The main entry point for the application.
  17. /// </summary>
  18. static void Main(string[] args)
  19. {
  20. using (Game1 game = new Game1())
  21. {
  22. game.Run();
  23. }
  24. }
  25. }
  26. #endif
  27. #if MONOMAC
  28. static class Program
  29. {
  30. /// <summary>
  31. /// The main entry point for the application.
  32. /// </summary>
  33. static void Main (string[] args)
  34. {
  35. MonoMac.AppKit.NSApplication.Init ();
  36. using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
  37. MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
  38. MonoMac.AppKit.NSApplication.Main(args);
  39. }
  40. }
  41. }
  42. class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
  43. {
  44. Game1 game;
  45. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  46. {
  47. game = new Game1();
  48. game.Run();
  49. }
  50. public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
  51. {
  52. return true;
  53. }
  54. }
  55. #endif
  56. }