added a limit to how much skipping can be done to avoid low fps

This commit is contained in:
Rolf Martin Glomsrud 2023-02-27 03:27:17 +01:00
parent dded57b568
commit 33cd49d931

View file

@ -106,7 +106,11 @@ impl GuiVec{
(Ok(a), false) => a,
(Err(_), _)=> {f32::MAX}
};
if get_fps() < 50{
self.renderSkip /= 2;
}
next_frame().await;
self.skipped = 0;
}else{
@ -116,6 +120,8 @@ impl GuiVec{
if frames >= self.delay && !self.done{
break;
}
frames += get_frame_time()* 1000.;
}