Fixed another FPS issue

This commit is contained in:
grayson committed 2021-09-08 02:21:15 -05:00
1 parent 2d3b3653ff
commit 70318b28fd
1 file changed
+2 -2
+2 -2
View File
@@ -278,11 +278,10 @@ namespace nf {
m_renderer->doFrame(m_currentState->getCamera(), m_deltaTime);
if (m_stateChange)
doStateChange();
}
m_fpsClock2 = std::chrono::steady_clock::now();
m_fpsDuration = m_fpsClock2 - m_fpsClock1;
if (m_fpsDuration.count() >= 0.2) {
m_FPS = (int)(1.0 / m_deltaTime);
m_FPS = (int)std::round(1.0 / m_deltaTime);
static int i = 0;
i++;
if (i % 5 == 0)
@@ -290,6 +289,7 @@ namespace nf {
m_fpsClock1 = std::chrono::steady_clock::now();
}
}
}
m_currentState->onExit();
m_currentState->cleanup();
delete m_renderer;