Added single step for simulation and play mode

+ Added ManualStepTime to GameTime
This commit is contained in:
Simon Lübeß
2023-07-20 23:21:21 +02:00
parent 5f27b8001a
commit cc7fb7311f
5 changed files with 99 additions and 6 deletions
+12 -1
View File
@@ -48,7 +48,7 @@ namespace GlitchyEngine
let sw = append Stopwatch(startNow);
_stopwatch = sw;
}
/**
* Starts or continues the internal timer.
*/
@@ -98,5 +98,16 @@ namespace GlitchyEngine
_frameCount++;
}
/**
* Tells the timer that a frame has passed and updates the counters according to the given time step.
*/
public void ManualStepFrame(float deltaTimeSeconds)
{
_frameTime = TimeSpan.FromSeconds(deltaTimeSeconds);
_totalTime += _frameTime;
_frameCount++;
}
}
}