| 340 | } |
| 341 | |
| 342 | void Engine::OnUpdate() |
| 343 | { |
| 344 | PROFILE_CPU_NAMED("Update"); |
| 345 | |
| 346 | UpdateCount++; |
| 347 | |
| 348 | // Determine if application has focus (flag used by the other parts of the engine) |
| 349 | HasFocus = (MainWindow && MainWindow->IsFocused()) || Platform::GetHasFocus(); |
| 350 | |
| 351 | // Simulate lags |
| 352 | //Platform::Sleep(100); |
| 353 | |
| 354 | MainThreadTask::RunAll(Time::Update.UnscaledDeltaTime.GetTotalSeconds()); |
| 355 | |
| 356 | // Call event |
| 357 | Update(); |
| 358 | |
| 359 | // Update services |
| 360 | EngineService::OnUpdate(); |
| 361 | |
| 362 | // Run async |
| 363 | UpdateGraph->Execute(); |
| 364 | } |
| 365 | |
| 366 | void Engine::OnLateUpdate() |
| 367 | { |
no test coverage detected