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

Method Update

Sources/OvGame/src/OvGame/Utils/FPSCounter.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void OvGame::Utils::FPSCounter::Update(float p_deltaTime)
19{
20 m_elapsed += p_deltaTime;
21
22 ++m_frames;
23
24 if (m_elapsed >= 0.1f)
25 {
26 m_text.content = std::to_string(static_cast<int>(1.f / (m_elapsed / static_cast<float>(m_frames)))) + " FPS";
27 SetPosition({ static_cast<float>(m_window.GetSize().first) - 10.0f , 10.0f });
28 SetAlignment(OvUI::Settings::EHorizontalAlignment::RIGHT, OvUI::Settings::EVerticalAlignment::TOP);
29
30 m_elapsed = 0.f;
31 m_frames = 0;
32 }
33}

Callers

nothing calls this directly

Calls 2

to_stringFunction · 0.85
GetSizeMethod · 0.45

Tested by

no test coverage detected