pub fn new(title: String, res: (usize, usize), rate: u64) -> Game {
		let mut window = Window::new(&title, res.0, res.1, WindowOptions::default())
			.expect("Couldn't init window");
		window.limit_update_rate(Some(std::time::Duration::from_micros(1000000 / rate)));
		let buf = vec![0; res.0 * res.1];
		Game {
			state: HashMap::default(),
			window: window,
			res,
			fb: buf,
			tick: Box::new(|_| {}),
			draw: Box::new(|_, _, _| {}),
			plugins: vec![],
		}
	}
/// Build a new game structure. This creates an empty window.
Build a new game structure. This creates an empty window.
Build a new game structure . This creates an empty window .
pub fn new(title: String, res: (usize, usize), rate: u64) -> Game {
		let mut window = Window::new(&title, res.0, res.1, WindowOptions::default())
			.expect("Couldn't init window");
		window.limit_update_rate(Some(std::time::Duration::from_micros(1000000 / rate)));
		let buf = vec![0; res.0 * res.1];
		Game {
			state: HashMap::default(),
			window: window,
			res,
			fb: buf,
			tick: Box::new(|_| {}),
			draw: Box::new(|_, _, _| {}),
			plugins: vec![],
		}
	}
pub fn new ( title : String , res : ( usize , usize ) , rate : u64 ) -> Game { let mut window = Window :: new ( & title , res . 0 , res . 1 , WindowOptions :: default ( ) ) . expect ( " " ) ; window . limit_update_rate ( Some ( std :: time :: Duration :: from_micros ( 1000000 / rate ) ) ) ; let buf = vec ! [ 0 res 0 res 1 ] ; Game { state : HashMap :: default ( ) , window : window , res , fb : buf , tick : Box :: new ( | _ | { } ) , draw : Box :: new ( | _ , _ , _ | { } ) , plugins : vec ! [ ] , } }
Build a new game structure.
Build a new game structure .
title
String
res
(usize, usize)
rate
u64
title
String
res
(usize, usize)
rate
u64