Improve engine responsiveness when not focused

This commit is contained in:
2024-07-17 00:23:04 +03:00
parent d879b8e064
commit 4d0dda19b9

View File

@@ -195,6 +195,12 @@ int32 Engine::Main(const Char* cmdLine)
// Use the same time for all ticks to improve synchronization
const double time = Platform::GetTimeSeconds();
// Update application (will gather data and other platform related events)
{
PROFILE_CPU_NAMED("Platform.Tick");
Platform::Tick();
}
// Update game logic
if (Time::OnBeginUpdate(time))
{
@@ -302,12 +308,6 @@ void Engine::OnUpdate()
UpdateCount++;
// Update application (will gather data and other platform related events)
{
PROFILE_CPU_NAMED("Platform.Tick");
Platform::Tick();
}
const auto mainWindow = MainWindow;
#if !USE_EDITOR