MCPcopy Create free account
hub / github.com/Illation/ETEngine / Update

Method Update

Engine/source/EtCore/Util/PerformanceInfo.cpp:16–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void PerformanceInfo::Update()
17{
18 m_PrevDrawCalls = m_DrawCalls;
19 m_DrawCalls = 0;
20
21 // on the first frame there may be no scene, and therefore no context
22 // #todo: find a better way than this workaround (init default scene before first tick)
23 BaseContext const* const context = ContextManager::GetInstance()->GetActiveContext();
24 if (context != nullptr)
25 {
26 m_RegFPSTimer += context->time->DeltaTime();
27
28 if (m_RegFPSTimer > 1.f)
29 {
30 m_RegFPSTimer = 0.f;
31 m_RegularFPS = (int32)context->time->FPS();
32 }
33
34 m_FrameMS = (context->time->GetTime() - m_FrameMSStart)*1000;
35 }
36}
37void PerformanceInfo::StartFrameTimer()
38{
39 m_FrameMSStart = TIME->GetTime();

Callers

nothing calls this directly

Calls 4

GetActiveContextMethod · 0.80
DeltaTimeMethod · 0.80
FPSMethod · 0.80
GetTimeMethod · 0.80

Tested by

no test coverage detected