Program.cs 836 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. namespace GamePadTest
  3. {
  4. static class Program
  5. {
  6. private static Game1 game;
  7. /// <summary>
  8. /// The main entry point for the application.
  9. /// </summary>
  10. static void Main (string[] args)
  11. {
  12. MonoMac.AppKit.NSApplication.Init ();
  13. using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
  14. MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate ();
  15. MonoMac.AppKit.NSApplication.Main (args);
  16. }
  17. }
  18. class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
  19. {
  20. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  21. {
  22. using (game = new Game1()) {
  23. game.Run ();
  24. }
  25. }
  26. public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
  27. {
  28. return true;
  29. }
  30. }
  31. }
  32. }