Пример #1
0
        static void RenderEnviroment()
        {
            try
            {
                if (DXManager.DeviceLost)
                {
                    DXManager.AttemptReset();
                    Thread.Sleep(1);
                    return;
                }

                if (MirScene.ActiveScene != null)
                {
                    MirScene.ActiveScene.Draw();
                }

                DXManager.Device.Present();
            }
            catch (DeviceLostException)
            {
                //Do Nothing, Handled Elsewhere.
            }
            catch (Exception Ex)
            {
                if (Settings.LogErrors)
                {
                    SaveError(Ex.ToString());
                }
                DXManager.AttemptRecovery();
            }
        }
Пример #2
0
        private static void RenderEnvironment()
        {
            try
            {
                if (DXManager.DeviceLost)
                {
                    DXManager.AttemptReset();
                    Thread.Sleep(1);
                    return;
                }
                else
                {
                    DXManager.Device.Clear(ClearFlags.Target, Color.CornflowerBlue, 0, 0);
                    DXManager.Device.BeginScene();
                    DXManager.Sprite.Begin(SpriteFlags.AlphaBlend);
                    DXManager.SetSurface(DXManager.MainSurface);

                    if (MirScene.ActiveScene != null)
                    {
                        MirScene.ActiveScene.Draw();
                    }

                    DXManager.Sprite.End();
                    DXManager.Device.EndScene();
                    DXManager.Device.Present();
                }
            }
            catch (Direct3D9Exception ex)
            {
                DXManager.DeviceLost = true;
            }
            catch (Exception ex)
            {
                SaveError(ex.ToString());

                DXManager.AttemptRecovery();
            }
        }