Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated examples with set_target_fps #341

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/char_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ fn main() {

let input = Box::new(Input::new(&keys_data));

// Limit to max ~60 fps update rate
window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));
window.set_target_fps(60);
window.set_input_callback(input);

while window.is_open() && !window.is_key_down(Key::Escape) {
Expand Down
3 changes: 1 addition & 2 deletions examples/julia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ fn main() {
)
.expect("Unable to Open Window");

// Limit to max ~60 fps update rate
window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));
window.set_target_fps(60);

let range = 2.0;
let x_min = 0. - range;
Expand Down
3 changes: 1 addition & 2 deletions examples/noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ fn main() {
)
.expect("Unable to create window");

// Limit to max ~60 fps update rate
window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));
window.set_target_fps(60);

let mut buffer: Vec<u32> = Vec::with_capacity(WIDTH * HEIGHT);

Expand Down
3 changes: 1 addition & 2 deletions examples/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ fn main() {
)
.expect("Unable to create window");

// Limit to max ~60 fps update rate
window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));
window.set_target_fps(60);

let mut buffer: Vec<u32> = Vec::with_capacity(WIDTH * HEIGHT);

Expand Down
Loading