Skip to content

Commit

Permalink
Merge pull request #29 from aevyrie/release-v0.9.1
Browse files Browse the repository at this point in the history
Release v0.9.1
  • Loading branch information
aevyrie authored Nov 14, 2022
2 parents 9641e3d + 61e6e83 commit caa3c5f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 199 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_framepace"
version = "0.9.0"
version = "0.9.1"
edition = "2021"
resolver = "2"
description = "Frame pacing and frame limiting for Bevy"
Expand Down
176 changes: 0 additions & 176 deletions docs/LICENSE-APACHE

This file was deleted.

19 changes: 0 additions & 19 deletions docs/LICENSE-MIT

This file was deleted.

10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@ fn detect_frametime(winit: NonSend<WinitWindows>, windows: Res<Windows>) -> Opti
let monitor = winit
.get_window(windows.get_primary()?.id())?
.current_monitor()?;
bevy::winit::get_best_videomode(&monitor).refresh_rate_millihertz() as f32 / 1000.0

// We need to subtract 0.5 because winit only reads framerate to the nearest 1 hertz. To
// prevent frames building up, adding latency, we need to use the most conservative possible
// refresh rate that could round up to the integer value reported by winit.
bevy::winit::get_best_videomode(&monitor).refresh_rate_millihertz() as f64 / 1000.0 - 0.5
};
#[cfg(target_arch = "wasm32")]
let best_framerate = 60.0;
let best_framerate = 59.5;

let best_frametime = Duration::from_secs_f32(1.0 / best_framerate);
let best_frametime = Duration::from_secs_f64(1.0 / best_framerate);
Some(best_frametime)
}

Expand Down

0 comments on commit caa3c5f

Please sign in to comment.