Skip to content

Commit

Permalink
fix fps
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Dec 8, 2023
1 parent 87e5890 commit 5ba0768
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/framework/core/adaptativeframecounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ bool AdaptativeFrameCounter::update()
const auto maxFps = m_targetFps == 0 ? m_maxFps : std::clamp<uint16_t>(m_targetFps, 1, std::max<uint16_t>(m_maxFps, m_targetFps));
if (maxFps > 0) {
const int32_t sleepPeriod = (getMaxPeriod(maxFps) - 1000) - m_timer.elapsed_micros();
if (sleepPeriod > 0) stdext::microsleep(std::min<int32_t>(sleepPeriod, DrawPool::FPS10));
if (sleepPeriod > 0)
stdext::microsleep(std::min<int32_t>(sleepPeriod, DrawPool::FPS10 * 1000));
}

m_timer.restart();
Expand Down

0 comments on commit 5ba0768

Please sign in to comment.