Example #1
0
 private void Tick()
 {
     GameController.tickTimer.Restart();
     while (!stopTickerThread)
     {
         waitForNextFrame(GameController.tickTimer);
         frameDeltaTime = DeltaTime(GameController.tickTimer.Elapsed.TotalMilliseconds);
         if (GameController.DebugFrameTimings)
         {
             FrameDebugTimer.startFrameTimer();
         }
         frameDisplayed = false;
         try {
             InputController.applyInput();
             GameController.calculateFrame(frameDeltaTime);
         } catch (TaskCanceledException) {
             // TODO Do we need to handle this?
         }
         GameController.tickTimer.Restart();
         if (GameController.DebugFrameTimings)
         {
             FrameDebugTimer.stopFrameTimer();
         }
     }
 }