Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. using MonoMac.Foundation;
  12. using MonoMac.AppKit;
  13. using MonoMac.ObjCRuntime;
  14. #endregion
  15. namespace PerPixelCollision
  16. {
  17. static class Program
  18. {
  19. /// <summary>
  20. /// The main entry point for the application.
  21. /// </summary>
  22. static void Main (string[] args)
  23. {
  24. NSApplication.Init ();
  25. using (var p = new NSAutoreleasePool ()) {
  26. NSApplication.SharedApplication.Delegate = new AppDelegate();
  27. NSApplication.Main(args);
  28. }
  29. }
  30. }
  31. class AppDelegate : NSApplicationDelegate
  32. {
  33. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  34. {
  35. using (PerPixelCollisionGame game = new PerPixelCollisionGame()) {
  36. game.Run ();
  37. }
  38. }
  39. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  40. {
  41. return true;
  42. }
  43. }
  44. }