123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #region File Description
- //-----------------------------------------------------------------------------
- // Program.cs
- //
- // Microsoft XNA Community Game Platform
- // Copyright (C) Microsoft Corporation. All rights reserved.
- //-----------------------------------------------------------------------------
- #endregion
- #region Using Statements
- using System;
- #if MONOMAC
- using MonoMac.Foundation;
- using MonoMac.AppKit;
- using MonoMac.ObjCRuntime;
- #elif IPHONE
- using MonoTouch.Foundation;
- using MonoTouch.UIKit;
- #endif
- #endregion
- namespace PerPixelCollision
- {
- #if MONOMAC
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- static void Main (string[] args)
- {
- NSApplication.Init ();
-
- using (var p = new NSAutoreleasePool ()) {
- NSApplication.SharedApplication.Delegate = new AppDelegate();
- NSApplication.Main(args);
- }
- }
- }
-
- class AppDelegate : NSApplicationDelegate
- {
- PerPixelCollisionGame game;
- public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
- {
- game = new PerPixelCollisionGame();
- game.Run ();
- }
-
- public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
- {
- return true;
- }
- }
- #elif IPHONE
- [Register ("AppDelegate")]
- class Program : UIApplicationDelegate
- {
- PerPixelCollisionGame game;
- public override void FinishedLaunching (UIApplication app)
- {
- // Fun begins..
- game = new PerPixelCollisionGame();
- game.Run ();
- }
- static void Main (string [] args)
- {
- UIApplication.Main (args,null,"AppDelegate");
- }
- }
- #endif
- }
|