From 23b897973be569e94d2c7c9696123ff72c34890f Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 7 May 2017 20:32:55 -0400 Subject: [PATCH] Remove placeholder game loop code. --- support/mod.rs | 18 ------------------ 1 file changed, 18 deletions(-) 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); } } -- 2.25.1