コード例 #1
0
ファイル: DeltaTimer.cs プロジェクト: gixslayer/darktech
 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
ファイル: DeltaTimer.cs プロジェクト: gixslayer/darktech
        public void Update()
        {
            long  currentTick = timer.CurrentTick();
            float elapsed     = (currentTick - lastTick) / timerFrequency;

            lastTick = currentTick;

            accumilator += elapsed;
        }