Add Engine::UpdateCount to sync gameplay logic updates with game loop rather than draw frames

This commit is contained in:
Wojtek Figat
2024-04-17 13:31:12 +02:00
parent 692a61c948
commit e53ab10145
4 changed files with 14 additions and 6 deletions

View File

@@ -60,6 +60,7 @@ namespace EngineImpl
DateTime Engine::StartupTime;
bool Engine::HasFocus = false;
uint64 Engine::UpdateCount = 0;
uint64 Engine::FrameCount = 0;
Action Engine::FixedUpdate;
Action Engine::Update;
@@ -296,6 +297,8 @@ void Engine::OnUpdate()
{
PROFILE_CPU_NAMED("Update");
UpdateCount++;
// Update application (will gather data and other platform related events)
{
PROFILE_CPU_NAMED("Platform.Tick");