public static void Main() { // Inject Fusee.Engine.Base InjectMe dependencies IO.IOImp = new Fusee.Base.Imp.Desktop.IOImp(); var fap = new Fusee.Base.Imp.Desktop.FileAssetProvider("Assets"); fap.RegisterTypeHandler( new AssetHandler { ReturnedType = typeof(Font), Decoder = (string id, object storage) => { if (!Path.GetExtension(id).Contains("ttf", StringComparison.OrdinalIgnoreCase)) { return(null); } return(new Font { _fontImp = new FontImp((Stream)storage) }); }, Checker = id => Path.GetExtension(id).Contains("ttf", StringComparison.OrdinalIgnoreCase) }); fap.RegisterTypeHandler( new AssetHandler { ReturnedType = typeof(SceneContainer), Decoder = (string id, object storage) => { if (!Path.GetExtension(id).Contains("fus", StringComparison.OrdinalIgnoreCase)) { return(null); } return(FusSceneConverter.ConvertFrom(ProtoBuf.Serializer.Deserialize <FusFile>((Stream)storage), id)); }, Checker = id => Path.GetExtension(id).Contains("fus", StringComparison.OrdinalIgnoreCase) }); AssetStorage.RegisterProvider(fap); var app = new Core.CameraExample(); // Inject Fusee.Engine InjectMe dependencies (hard coded) System.Drawing.Icon appIcon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); app.CanvasImplementor = new Fusee.Engine.Imp.Graphics.Desktop.RenderCanvasImp(appIcon); app.ContextImplementor = new Fusee.Engine.Imp.Graphics.Desktop.RenderContextImp(app.CanvasImplementor); Input.AddDriverImp(new Fusee.Engine.Imp.Graphics.Desktop.RenderCanvasInputDriverImp(app.CanvasImplementor)); Input.AddDriverImp(new Fusee.Engine.Imp.Graphics.Desktop.WindowsTouchInputDriverImp(app.CanvasImplementor)); // app.InputImplementor = new Fusee.Engine.Imp.Graphics.Desktop.InputImp(app.CanvasImplementor); // app.AudioImplementor = new Fusee.Engine.Imp.Sound.Desktop.AudioImp(); // app.NetworkImplementor = new Fusee.Engine.Imp.Network.Desktop.NetworkImp(); // app.InputDriverImplementor = new Fusee.Engine.Imp.Input.Desktop.InputDriverImp(); // app.VideoManagerImplementor = ImpFactory.CreateIVideoManagerImp(); // Start the app app.Run(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(WindowFeatures.NoTitle); if (SupportedOpenGLVersion() >= 3) { // SetContentView(new LibPaintingView(ApplicationContext, null)); // Inject Fusee.Engine.Base InjectMe dependencies IO.IOImp = new IOImp(ApplicationContext); var fap = new Fusee.Base.Imp.Android.ApkAssetProvider(ApplicationContext); fap.RegisterTypeHandler( new AssetHandler { ReturnedType = typeof(Font), Decoder = (string id, object storage) => { if (Path.GetExtension(id).Contains("ttf", System.StringComparison.OrdinalIgnoreCase)) { return(new Font { _fontImp = new FontImp((Stream)storage) }); } return(null); }, Checker = (string id) => { return(Path.GetExtension(id).Contains("ttf", System.StringComparison.OrdinalIgnoreCase)); } }); fap.RegisterTypeHandler( new AssetHandler { ReturnedType = typeof(SceneContainer), Decoder = (string id, object storage) => { if (Path.GetExtension(id).Contains("fus", System.StringComparison.OrdinalIgnoreCase)) { return(FusSceneConverter.ConvertFrom(ProtoBuf.Serializer.Deserialize <FusFile>((Stream)storage))); } return(null); }, Checker = delegate(string id) { return(Path.GetExtension(id).Contains("fus", System.StringComparison.OrdinalIgnoreCase)); } }); AssetStorage.RegisterProvider(fap); var app = new Core.CameraExample(); // Inject Fusee.Engine InjectMe dependencies (hard coded) RenderCanvasImp rci = new RenderCanvasImp(ApplicationContext, null, delegate { app.Run(); }); app.CanvasImplementor = rci; app.ContextImplementor = new RenderContextImp(rci, ApplicationContext); SetContentView(rci.View); Engine.Core.Input.AddDriverImp( new Fusee.Engine.Imp.Graphics.Android.RenderCanvasInputDriverImp(app.CanvasImplementor)); // Engine.Core.Input.AddDriverImp(new Fusee.Engine.Imp.Graphics.Android.WindowsTouchInputDriverImp(app.CanvasImplementor)); // Deleayed into rendercanvas imp....app.Run() - SEE DELEGATE ABOVE; } else { Toast.MakeText(ApplicationContext, "Hardware does not support OpenGL ES 3.0 - Aborting...", ToastLength.Long); Log.Info("@string/app_name", "Hardware does not support OpenGL ES 3.0 - Aborting..."); } }