limit adaptive fps to display.framerate setting

This commit is contained in:
MihailRis 2025-11-10 00:34:01 +03:00
parent 630e75c7d9
commit b0d662f845

View File

@ -83,15 +83,11 @@ void WindowControl::nextFrame(bool waitForRefresh) {
const auto& settings = engine.getSettings(); const auto& settings = engine.getSettings();
auto& window = engine.getWindow(); auto& window = engine.getWindow();
auto& input = engine.getInput(); auto& input = engine.getInput();
if (waitForRefresh) { window.setFramerate(
window.setFramerate(Window::FPS_UNLIMITED); window.isIconified() && settings.display.limitFpsIconified.get()
} else { ? 20
window.setFramerate( : settings.display.framerate.get()
window.isIconified() && settings.display.limitFpsIconified.get() );
? 20
: settings.display.framerate.get()
);
}
window.swapBuffers(); window.swapBuffers();
input.pollEvents(waitForRefresh && !window.checkShouldRefresh()); input.pollEvents(waitForRefresh && !window.checkShouldRefresh());
} }