Skip to content

Commit

Permalink
Added fps limiter to demo.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobrand committed May 5, 2017
1 parent 5102e53 commit 43e4f0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extern crate sdl2;
use sdl2::pixels::Color;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use std::time::Duration;

pub fn main() {
let sdl_context = sdl2::init().unwrap();
Expand Down Expand Up @@ -30,6 +31,7 @@ pub fn main() {
_ => {}
}
}
::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 60));
// The rest of the game loop goes here...
}
}

0 comments on commit 43e4f0a

Please sign in to comment.