| 14 | } |
| 15 | |
| 16 | void 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 | } |
| 37 | void PerformanceInfo::StartFrameTimer() |
| 38 | { |
| 39 | m_FrameMSStart = TIME->GetTime(); |
nothing calls this directly
no test coverage detected