/// <summary> /// The simpliest way to launch a game. It opens a special full-screen activity /// </summary> public static void RunInActivity(Type applicationType, ApplicationOptions options = null) { UrhoEngine.Init(); UrhoEngine.RegisterSdlLauncher(_ => Application.CreateInstance(applicationType, options).Run()); var context = Android.App.Application.Context; var intent = new Intent(context, typeof(Org.Libsdl.App.UrhoActivity)); intent.AddFlags(ActivityFlags.NewTask); context.StartActivity(intent); }
/// <summary> /// Creates a view (SurfaceView) that can be added anywhere /// </summary> public static SDLSurface CreateSurface(Activity activity, Type applicationType, ApplicationOptions options = null) { UrhoEngine.Init(); UrhoEngine.RegisterSdlLauncher(contextPtr => Application.CreateInstance(applicationType, options).Run()); return(SDLActivity.CreateSurface(activity)); }