Program.cs 1.2 KB

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