Program.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. #if MONOMAC
  5. using MonoMac.AppKit;
  6. using MonoMac.Foundation;
  7. #endif
  8. namespace SpriteEffects
  9. {
  10. #if MONOMAC
  11. static class Program
  12. {
  13. /// <summary>
  14. /// The main entry point for the application.
  15. /// </summary>
  16. static void Main (string[] args)
  17. {
  18. NSApplication.Init ();
  19. using (var p = new NSAutoreleasePool ()) {
  20. NSApplication.SharedApplication.Delegate = new AppDelegate();
  21. NSApplication.Main(args);
  22. }
  23. }
  24. }
  25. class AppDelegate : NSApplicationDelegate
  26. {
  27. SpriteEffectsGame game;
  28. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  29. {
  30. game = new SpriteEffectsGame();
  31. game.Run();
  32. }
  33. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  34. {
  35. return true;
  36. }
  37. }
  38. #else
  39. static class Program
  40. {
  41. private static SpriteEffectsGame game;
  42. /// <summary>
  43. /// The main entry point for the application.
  44. /// </summary>
  45. [STAThread]
  46. static void Main()
  47. {
  48. game = new SpriteEffectsGame();
  49. game.Run();
  50. }
  51. }
  52. #endif
  53. }