예제 #1
0
 public DeltaTimer(ITimer timer, float timestep)
 {
     this.Timestep       = timestep;
     this.timer          = timer;
     this.timerFrequency = (float)timer.TicksPerSecond;
     this.lastTick       = timer.CurrentTick();
     this.accumilator    = 0f;
 }
예제 #2
0
        public void Update()
        {
            long  currentTick = timer.CurrentTick();
            float elapsed     = (currentTick - lastTick) / timerFrequency;

            lastTick = currentTick;

            accumilator += elapsed;
        }