Exemplo n.º 1
0
        /// <summary>Updates the time</summary>
        public void Update()
        {
            float interval = (float)stopwatch.Elapsed.TotalSeconds;

            stopwatch.Restart();
            if (_FPScountTime > FPSRefreshInterval)
            {
                FPS           = _FPScounter / _FPScountTime;
                SpinsPerFrame = _spincounter / _FPScounter;

                _FPScounter   = 0;
                _FPScountTime = 0;
                _spincounter  = 0;
            }

            _FPScounter++;
            _FPScountTime += interval;

            UpdateInterval = interval.Clamp(1f / FPS.Max(TargetFPS), 1f / MinimumFPS);
            WorldTime     += WorldInterval;
            _addTime       = 0;
        }