Browse Source

Added iOS specific code to CatapultNetWars

Kenneth Pouncey 13 years ago
parent
commit
e5fc70256d
1 changed files with 12 additions and 1 deletions
  1. 12 1
      Samples/MacOS/CatapultNetWars/Screens/InstructionsScreen.cs

+ 12 - 1
Samples/MacOS/CatapultNetWars/Screens/InstructionsScreen.cs

@@ -23,6 +23,12 @@ using Microsoft.Xna.Framework.Input.Touch;
 using MonoMac.AppKit;
 using MonoMac.Foundation;
 #endif
+
+#if IOS
+using MonoTouch.UIKit;
+using MonoTouch.Foundation;
+#endif
+
 #endregion
 
 namespace CatapultGame
@@ -123,8 +129,13 @@ namespace CatapultGame
 			// Create an Autorelease Pool or we will leak objects.
 			using (var pool = new NSAutoreleasePool()) {
 				// Make sure we invoke this on the Main Thread or OpenGL will throw an error
+#if MACOS
 				MonoMac.AppKit.NSApplication.SharedApplication.BeginInvokeOnMainThread (delegate {
-
+#endif
+#if IOS
+				var invokeOnMainThredObj = new NSObject();
+				invokeOnMainThredObj.InvokeOnMainThread(delegate {
+#endif
 					gameplayScreen.LoadAssets ();
 				});
 			}