Пример #1
0
        protected override void Draw(GameTime time)
        {
            if (GraphicsDevice.IsDisposed)
            {
                return;
            }

            HasRendered = true;

#if !DEBUG
            try
            {
#endif
            PerformanceMonitor.PushFrame("Render");

            GraphicsDevice.Clear(Color.Black);

            if (GameStateManager.DrawScreensaver)
            {
                ScreenSaver.Render(GraphicsDevice, DwarfTime.LastTime);
            }

            GameStateManager.Render(DwarfTime.LastTime);

            GraphicsDevice.SetRenderTarget(null);
            base.Draw(time);
            PerformanceMonitor.PopFrame();
            PerformanceMonitor.Render();

            if (ConsoleVisible)
            {
                ConsoleGui.Draw();
            }

#if !DEBUG
        }

        catch (Exception exception)
        {
            Program.CaptureException(exception);
            if (Program.ShowErrorDialog(exception.Message))
            {
                throw new HandledException(exception);
            }
        }
#endif
        }
Пример #2
0
        protected override void Draw(GameTime time)
        {
            if (GraphicsDevice.IsDisposed)
            {
                return;
            }

            HasRendered = true;
#if SHARP_RAVEN && !DEBUG
            try
            {
#endif
            PerformanceMonitor.PushFrame("Render");

            GraphicsDevice.Clear(Color.Black);

            if (GameStateManager.DrawScreensaver)
            {
                ScreenSaver.Render(GraphicsDevice, DwarfTime.LastTime);
            }

            GameStateManager.Render(DwarfTime.LastTime);

            GraphicsDevice.SetRenderTarget(null);
            base.Draw(time);
            PerformanceMonitor.PopFrame();
            PerformanceMonitor.Render();

            if (ConsoleVisible)
            {
                ConsoleGui.Draw();
            }

#if SHARP_RAVEN && !DEBUG
        }

        catch (Exception exception)
        {
            if (ravenClient != null)
            {
                ravenClient.Capture(new SentryEvent(exception));
            }
            throw;
        }
#endif
        }