limit adaptive fps to display.framerate setting
This commit is contained in:
parent
630e75c7d9
commit
b0d662f845
@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user