protected override void Draw(GameTime gameTime) { #if DEBUG StatisticsProfiler.BeginDraw(gameTime); #endif Graphics.GraphicsDevice.Clear(Color.Black); GraphicsDevice.RasterizerState = RasterizerState.CullNone; foreach (Process process in ProcessManager.Processes) { RenderProcess renderProcess = process as RenderProcess; if (renderProcess != null) { renderProcess.Render((float)gameTime.ElapsedGameTime.TotalSeconds * CVars.Get <float>("debug_update_time_scale") * (CVars.Get <bool>("debug_pause_game_updates") ? 0 : 1)); } } #if DEBUG StatisticsProfiler.EndDraw(); #endif base.Draw(gameTime); }
public GameManager() { CVars.Initialize(); ProcessManager = new ProcessManager(); Graphics = new GraphicsDeviceManager(this); Graphics.GraphicsProfile = GraphicsProfile.HiDef; Graphics.PreferMultiSampling = false; Content.RootDirectory = "Content"; Graphics.PreferredBackBufferWidth = CVars.Get <int>("initial_window_width"); Graphics.PreferredBackBufferHeight = CVars.Get <int>("initial_window_height"); Window.AllowUserResizing = true; Window.ClientSizeChanged += Window_ClientSizeChanged; IsFixedTimeStep = CVars.Get <bool>("update_xna_fixed"); #if DEBUG StatisticsProfiler = new StatisticsProfiler(); #endif Console.WriteLine(typeof(UIWidgetsReader).AssemblyQualifiedName); }
protected override void Update(GameTime gameTime) { #if DEBUG StatisticsProfiler.BeginUpdate(gameTime); #endif if (!CVars.Get <bool>("debug_pause_game_updates")) { Update((float)gameTime.ElapsedGameTime.TotalSeconds * CVars.Get <float>("debug_update_time_scale")); } #if DEBUG StatisticsProfiler.EndUpdate(); #endif base.Update(gameTime); }