MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / Update

Method Update

Sources/OvGame/src/OvGame/Core/Game.cpp:95–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void 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
146void OvGame::Core::Game::PostUpdate()
147{

Callers 1

RunMethod · 0.45

Calls 8

RenderCurrentSceneFunction · 0.85
GetCurrentSceneMethod · 0.80
FixedUpdateMethod · 0.80
LateUpdateMethod · 0.80
BlitToBackBufferMethod · 0.80
GetSizeMethod · 0.45
IsKeyPressedMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected