public static void WebPlayer_Message(EngineApp.WebPlayerMessages message, IntPtr data) { try { switch (message) { case EngineApp.WebPlayerMessages.Init: unsafe { EngineApp.WebPlayerInitData *initData = (EngineApp.WebPlayerInitData *)data; if (!VirtualFileSystem.Init("user:Logs/WebPlayer.log", false, initData->ExecutableDirectoryPath, null, null)) { return; } Log.DumpToFile(string.Format("WebPlayer {0}\r\n", EngineVersionInformation.Version)); //set render settings //RendererWorld.InitializationOptions.MaxPixelShadersVersion = RendererWorld.MaxPixelShadersVersions.PS0; //RendererWorld.InitializationOptions.MaxVertexShadersVersion = RendererWorld.MaxVertexShadersVersions.VS0; //RendererWorld.InitializationOptions.FullSceneAntialiasing = 0; //RendererWorld.InitializationOptions.FilteringMode = RendererWorld.FilteringModes.Trilinear; EngineApp.Init(new GameEngineApp()); EngineApp.WebPlayer_Message(message, data); EngineConsole.Init(); EngineApp.Instance.Config.RegisterClassParameters(typeof(GameEngineApp)); EngineApp.Instance.Create(); } break; case EngineApp.WebPlayerMessages.Shutdown: EngineApp.WebPlayer_Message(message, data); EngineApp.Shutdown(); Log.DumpToFile("Program END\r\n"); VirtualFileSystem.Shutdown(); break; case EngineApp.WebPlayerMessages.WindowMessage: EngineApp.WebPlayer_Message(message, data); break; } } catch (Exception e) { Log.FatalAsException(e.ToString()); } }
static void Main2() { //initialize file sytem of the engine if (!VirtualFileSystem.Init("user:Logs/Game.log", true, null, null, null, null)) { return; } //configure general settings EngineApp.ConfigName = "user:Configs/Game.config"; if (PlatformInfo.Platform == PlatformInfo.Platforms.Windows) { EngineApp.UseDirectInputForMouseRelativeMode = true; } EngineApp.AllowJoysticksAndCustomInputDevices = true; EngineApp.AllowWriteEngineConfigFile = true; EngineApp.AllowChangeVideoMode = true; //Change Floating Point Model for FPU math calculations. Default is Strict53Bits. //FloatingPointModel.Model = FloatingPointModel.Models.Strict53Bits; //init engine application EngineApp.Init(new GameEngineApp()); //enable support field and properties serialization for GameEngineApp class. EngineApp.Instance.Config.RegisterClassParameters(typeof(GameEngineApp)); //update window EngineApp.Instance.WindowTitle = "Game"; if (PlatformInfo.Platform == PlatformInfo.Platforms.Windows) { EngineApp.Instance.Icon = Game.Properties.Resources.Logo; } //create game console EngineConsole.Init(); //EngineApp.Instance.SuspendWorkingWhenApplicationIsNotActive = false; //create and run application loop. if (EngineApp.Instance.Create()) { EngineApp.Instance.Run(); } EngineApp.Shutdown(); Log.DumpToFile("Program END\r\n"); VirtualFileSystem.Shutdown(); if (needRestartApplication) { Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location, ""); } }
static void Main2() { if (!VirtualFileSystem.Init("user:Logs/Game.log", true, null, null, null)) { return; } Log.DumpToFile(string.Format("Game {0}\r\n", EngineVersionInformation.Version)); EngineApp.ConfigName = "user:Configs/Game.config"; EngineApp.UseSystemMouseDeviceForRelativeMode = true; EngineApp.AllowJoysticksAndCustomInputDevices = true; EngineApp.AllowWriteEngineConfigFile = true; EngineApp.AllowChangeVideoMode = true; EngineApp.Init(new GameEngineApp()); EngineApp.Instance.WindowTitle = "Game"; if (PlatformInfo.Platform == PlatformInfo.Platforms.Windows) { EngineApp.Instance.Icon = Game.Properties.Resources.Logo; } EngineConsole.Init(); EngineApp.Instance.Config.RegisterClassParameters(typeof(GameEngineApp)); if (EngineApp.Instance.Create()) { EngineApp.Instance.Run(); } EngineApp.Shutdown(); Log.DumpToFile("Program END\r\n"); VirtualFileSystem.Shutdown(); }