Skip to content

Commit

Permalink
Updated examples with set_target_fps (#341)
Browse files Browse the repository at this point in the history
* Solved bug in wayland implementation

* Remove unnecessary CString allocations

* Deprecate limit_update_rate

- solving Deprecate "limit_update_rate" in favor of "set_target_fps" #339

* Update examples with set_target_fps
  • Loading branch information
StefanoIncardone committed Jan 26, 2024
1 parent 294fb4d commit d814070
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
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

0 comments on commit d814070

Please sign in to comment.