Skip to content

Commit

Permalink
Always request a new frame to render after the first frame has been r…
Browse files Browse the repository at this point in the history
…endered
  • Loading branch information
fredizzimo committed Dec 6, 2023
1 parent a646304 commit 7d17d67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/window/update_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ impl UpdateLoop {
self.should_render.update(window_wrapper.prepare_frame());
if self.should_render == ShouldRender::Immediately || !self.idle {
// Always draw immediately for reduced latency if we have been idling
if self.num_consecutive_rendered > 0
&& window_wrapper.vsync.uses_winit_throttling()
if self.num_consecutive_rendered == 0
|| !window_wrapper.vsync.uses_winit_throttling()
{
window_wrapper.windowed_context.window().request_redraw();
} else {
self.render(window_wrapper);
}
if window_wrapper.vsync.uses_winit_throttling() {
window_wrapper.windowed_context.window().request_redraw();
}
} else {
self.num_consecutive_rendered = 0;
self.last_dt = self.previous_frame_start.elapsed().as_secs_f32();
Expand Down

0 comments on commit 7d17d67

Please sign in to comment.