12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #if MONOMAC
- using MonoMac.AppKit;
- using MonoMac.Foundation;
- #elif IPHONE
- using MonoTouch.Foundation;
- using MonoTouch.UIKit;
- #endif
- namespace Microsoft.Xna.Samples.BouncingBox
- {
- #if MONOMAC
- class Program
- {
- static void Main (string[] args)
- {
- NSApplication.Init ();
- using (var p = new NSAutoreleasePool ()) {
- NSApplication.SharedApplication.Delegate = new AppDelegate ();
- // Set our Application Icon
- NSImage appIcon = NSImage.ImageNamed ("monogameicon.png");
- NSApplication.SharedApplication.ApplicationIconImage = appIcon;
- NSApplication.Main (args);
- }
- }
- }
- class AppDelegate : NSApplicationDelegate
- {
- private Game1 game;
- public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
- {
- game = new Game1 ();
- game.Run();
- }
- public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
- {
- return true;
- }
- }
- #elif IPHONE
- [Register ("AppDelegate")]
- class Program : UIApplicationDelegate
- {
- private Game1 game;
- public override void FinishedLaunching (UIApplication app)
- {
- // Fun begins..
- game = new Game1();
- game.Run();
- }
- static void Main (string [] args)
- {
- UIApplication.Main (args,null,"AppDelegate");
- }
- }
- #endif
- }
|