| 93 | } |
| 94 | |
| 95 | void OvGame::Core::Game::Update(float p_deltaTime) |
| 96 | { |
| 97 | if (auto currentScene = m_context.sceneManager.GetCurrentScene()) |
| 98 | { |
| 99 | { |
| 100 | #ifdef _DEBUG |
| 101 | ZoneScopedN("Physics Update"); |
| 102 | #endif |
| 103 | |
| 104 | if (m_context.physicsEngine->Update(p_deltaTime)) |
| 105 | currentScene->FixedUpdate(p_deltaTime); |
| 106 | } |
| 107 | |
| 108 | { |
| 109 | #ifdef _DEBUG |
| 110 | ZoneScopedN("Scene Update"); |
| 111 | #endif |
| 112 | currentScene->Update(p_deltaTime); |
| 113 | currentScene->LateUpdate(p_deltaTime); |
| 114 | } |
| 115 | |
| 116 | { |
| 117 | #ifdef _DEBUG |
| 118 | ZoneScopedN("Audio Update"); |
| 119 | #endif |
| 120 | m_context.audioEngine->Update(); |
| 121 | } |
| 122 | |
| 123 | RenderCurrentScene(m_sceneRenderer, m_context); |
| 124 | |
| 125 | auto [windowWidth, windowHeight] = m_context.window->GetSize(); |
| 126 | m_context.framebuffer->BlitToBackBuffer(windowWidth, windowHeight); |
| 127 | } |
| 128 | |
| 129 | m_context.sceneManager.Update(); |
| 130 | |
| 131 | if (m_context.inputManager->IsKeyPressed(OvWindowing::Inputs::EKey::KEY_F12)) |
| 132 | m_showDebugInformation = !m_showDebugInformation; |
| 133 | |
| 134 | if (m_showDebugInformation) |
| 135 | { |
| 136 | m_fpsCounter.Update(p_deltaTime); |
| 137 | #ifdef _DEBUG |
| 138 | auto& frameInfoRenderFeature = m_sceneRenderer.GetFeature<OvRendering::Features::FrameInfoRenderFeature>(); |
| 139 | auto& frameInfo = frameInfoRenderFeature.GetFrameInfo(); |
| 140 | m_frameInfo.Update(frameInfo); |
| 141 | #endif |
| 142 | m_context.uiManager->Render(); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | void OvGame::Core::Game::PostUpdate() |
| 147 | { |
no test coverage detected