extern crate gfx4games; //License extern crate nalgebra; use gfx4games::events::MainLoop; use gfx4games::events::run; use gfx4games::graphics::context::Context; use gfx4games::rect::Rect; use nalgebra::Vector3; struct MainState { rect: Rect, } impl MainState { pub fn new() -> MainState { MainState { rect: Rect::new(-10.0, 0.0, 10., 8.), } } } impl MainLoop for MainState { fn draw(&mut self, ctx: &mut Context) { self.rect.draw(ctx); } fn update(&mut self, _ctx: &mut Context, _dt: f32) { let mut x = 0.0; x = 1.0; self.rect.moveBy(x, 0.0); } } fn main() { let mut state = MainState::new(); let mut ctx = Context::new("Simple Example".to_string(), 1280, 720); run(&mut ctx, &mut state); }