Program.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // PeerToPeerGame.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 Microsoft.Xna.Framework;
  12. using Microsoft.Xna.Framework.GamerServices;
  13. using Microsoft.Xna.Framework.Graphics;
  14. using Microsoft.Xna.Framework.Input;
  15. using Microsoft.Xna.Framework.Net;
  16. using MonoMac.Foundation;
  17. using MonoMac.AppKit;
  18. using MonoMac.ObjCRuntime;
  19. #endregion
  20. namespace PeerToPeer
  21. {
  22. #region Entry Point
  23. static class Program
  24. {
  25. /// <summary>
  26. /// The main entry point for the application.
  27. /// </summary>
  28. static void Main (string[] args)
  29. {
  30. NSApplication.Init ();
  31. using (var p = new NSAutoreleasePool ()) {
  32. NSApplication.SharedApplication.Delegate = new AppDelegate();
  33. NSApplication.Main(args);
  34. }
  35. }
  36. }
  37. class AppDelegate : NSApplicationDelegate
  38. {
  39. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  40. {
  41. using (PeerToPeerGame game = new PeerToPeerGame ()) {
  42. game.Run ();
  43. }
  44. }
  45. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  46. {
  47. return true;
  48. }
  49. }
  50. #endregion
  51. }