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; } }
protected override void Update(GameTime gameTime) { base.Update(gameTime); _engine.Tick(gameTime); }