Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
 static void Main()
 {
     if (Debugger.IsAttached)
     {
         Main2();
     }
     else
     {
         try
         {
             Main2();
         }
         catch (Exception e)
         {
             Log.FatalAsException(e.ToString());
         }
     }
 }