From: Bernie Innocenti Date: Mon, 8 May 2017 00:32:55 +0000 (-0400) Subject: Remove placeholder game loop code. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=23b897973be569e94d2c7c9696123ff72c34890f;p=mandelwow.git Remove placeholder game loop code. --- diff --git a/support/mod.rs b/support/mod.rs index 8996e55..b71f50d 100644 --- a/support/mod.rs +++ b/support/mod.rs @@ -3,8 +3,6 @@ extern crate genmesh; extern crate obj; -use std::thread; -use std::time::{Duration, Instant}; use glium::{self, Display}; use glium::vertex::VertexBufferAny; @@ -17,27 +15,11 @@ pub enum Action { } pub fn start_loop(mut callback: F) where F: FnMut() -> Action { - let mut accumulator = Duration::new(0, 0); - let mut previous_clock = Instant::now(); - loop { match callback() { Action::Stop => break, Action::Continue => () }; - - let now = Instant::now(); - accumulator += now - previous_clock; - previous_clock = now; - - let fixed_time_stamp = Duration::new(0, 16666667); - while accumulator >= fixed_time_stamp { - accumulator -= fixed_time_stamp; - - // if you have a game, update the state here - } - - thread::sleep(fixed_time_stamp - accumulator); } }