Пример #1
0
        /// <summary>
        /// Function for the main idle loop.
        /// </summary>
        /// <remarks>This is used as the main loop for the application.  All drawing and logic can go in here.</remarks>
        /// <returns><b>true</b> to keep running, <b>false</b> to exit.</returns>
        private static bool Idle()
        {
            if (!_paused)
            {
                // Update the simulation at our desired frame rate.
                if (GorgonTiming.Delta < MinSimulationFPS)
                {
                    _accumulator += GorgonTiming.Delta;
                }
                else
                {
                    _accumulator += MinSimulationFPS;
                }

                while (_accumulator >= MaxSimulationFPS)
                {
                    Transform(MaxSimulationFPS);
                    _accumulator -= MaxSimulationFPS;
                }
            }

            // Begin our rendering.
            _2D.Begin();
            DrawBackground();
            _2D.End();

            if (_blur.BlurRadius == 0)
            {
                _2D.Begin();
                DrawNoBlur();
                _2D.End();
            }
            else
            {
                DrawBlurred();
            }

            _2D.Begin();
            if (_showHelp)
            {
                _2D.DrawTextSprite(_helpTextSprite);
            }

            DrawOverlay();
            _2D.End();

            GorgonExample.DrawStatsAndLogo(_2D);

            _mainScreen.Present();

            _graphics.ResetDrawCallStatistics();

            return(true);
        }