diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-06-13 23:46:58 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-06-13 23:46:58 -0400 |
commit | 8e6c8bdfb4924bc671dd37e47d473ea803880825 (patch) | |
tree | 3101c14fdbe9cc791ea170aacae82786473d5669 /src/lib.rs | |
parent | 4fb57de0201eaecdafffdcc285e7dc3ef9d4f6d8 (diff) | |
download | exuberant-hacks-8e6c8bdfb4924bc671dd37e47d473ea803880825.tar.gz exuberant-hacks-8e6c8bdfb4924bc671dd37e47d473ea803880825.zip |
change API to pass time as arg to draw_frame
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4,6 +4,7 @@ extern crate glium; extern crate image; extern crate getopts; +extern crate time; use std::env; use std::process::exit; @@ -14,7 +15,7 @@ use glium::{DisplayBuild, Display}; pub mod util; pub trait ExuberantHack { - fn draw_frame(&mut self) -> Result<(), String>; + fn draw_frame(&mut self, t: f64) -> Result<(), String>; fn get_display(&self) -> &Display; } @@ -30,7 +31,7 @@ pub fn print_usage(opts: &Options) { pub fn run(hack: &mut ExuberantHack, conf: &Matches) { loop { - hack.draw_frame().ok(); + hack.draw_frame(time::precise_time_s()).ok(); for ev in hack.get_display().poll_events() { match ev { glium::glutin::Event::Closed => return, |