public static void Run() { VrManager.WaitGetPoses(); double realTime = Time.RealTime; LastFrameTime = (float)(realTime - m_frameBeginTime); LastCpuFrameTime = (float)(m_cpuEndTime - m_frameBeginTime); m_frameBeginTime = realTime; Window.PresentationInterval = ((!VrManager.IsVrStarted) ? SettingsManager.PresentationInterval : 0); try { if (ExceptionManager.Error == null) { while (m_urisToHandle.Count > 0) { Uri obj = m_urisToHandle[0]; m_urisToHandle.RemoveAt(0); Program.HandleUri?.Invoke(obj); } PerformanceManager.Update(); MotdManager.Update(); MusicManager.Update(); ScreensManager.Update(); DialogsManager.Update(); } else { ExceptionManager.UpdateExceptionScreen(); } } catch (Exception e) { ExceptionManager.ReportExceptionToUser(null, e); ScreensManager.SwitchScreen("MainMenu"); } try { Display.RenderTarget = null; if (ExceptionManager.Error == null) { ScreensManager.Draw(); PerformanceManager.Draw(); ScreenCaptureManager.Run(); } else { ExceptionManager.DrawExceptionScreen(); } m_cpuEndTime = Time.RealTime; } catch (Exception e2) { ExceptionManager.ReportExceptionToUser(null, e2); ScreensManager.SwitchScreen("MainMenu"); } }