mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
limit adaptive fps to display.framerate setting
This commit is contained in:
parent
630e75c7d9
commit
b0d662f845
1 changed files with 5 additions and 9 deletions
|
|
@ -83,15 +83,11 @@ void WindowControl::nextFrame(bool waitForRefresh) {
|
|||
const auto& settings = engine.getSettings();
|
||||
auto& window = engine.getWindow();
|
||||
auto& input = engine.getInput();
|
||||
if (waitForRefresh) {
|
||||
window.setFramerate(Window::FPS_UNLIMITED);
|
||||
} else {
|
||||
window.setFramerate(
|
||||
window.isIconified() && settings.display.limitFpsIconified.get()
|
||||
? 20
|
||||
: settings.display.framerate.get()
|
||||
);
|
||||
}
|
||||
window.setFramerate(
|
||||
window.isIconified() && settings.display.limitFpsIconified.get()
|
||||
? 20
|
||||
: settings.display.framerate.get()
|
||||
);
|
||||
window.swapBuffers();
|
||||
input.pollEvents(waitForRefresh && !window.checkShouldRefresh());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue