예제 #1
0
        public void Run()
        {
            Stopwatch totalElapsedStopwatch = new Stopwatch();
            Stopwatch tickElapsedStopwatch  = new Stopwatch();

            var timeDiff  = TimeSpan.FromSeconds(0);
            var totalTime = TimeSpan.FromSeconds(0);

            totalElapsedStopwatch.Start();
            while (true)
            {
                tickElapsedStopwatch.Restart();
                tickElapsedStopwatch.Start();
                _engine.Tick(new GameTime(totalTime, timeDiff));
                tickElapsedStopwatch.Stop();
                timeDiff  = tickElapsedStopwatch.Elapsed;
                totalTime = totalElapsedStopwatch.Elapsed;
            }
        }
예제 #2
0
파일: ForgeGame.cs 프로젝트: sami016/Forge
 protected override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     _engine.Tick(gameTime);
 }