1
0
mirror of synced 2025-01-18 00:56:49 +01:00

sys: Lower down FPS to 5 when ImHex loses focus

#189
This commit is contained in:
WerWolv 2021-03-06 13:36:20 +01:00
parent 6cba868e20
commit cadd4e5c2b

View File

@ -390,7 +390,7 @@ namespace hex {
glfwSwapBuffers(this->m_window);
while (glfwGetTime() < this->m_lastFrameTime + (1 / this->m_targetFps))
while (glfwGetTime() < this->m_lastFrameTime + 1 / (ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow) ? this->m_targetFps : 5.0))
std::this_thread::sleep_for(500us);
this->m_lastFrameTime = glfwGetTime();
}