Program.cs 942 B

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