877d367becfe2520751991f789e777eb2ba22fa3
[kaka/rust-sdl-test.git] / src / main.rs
1 extern crate rand;
2 extern crate sdl2;
3 extern crate time;
4
5 use game::app::*;
6
7 mod game;
8 #[macro_use]
9 mod common;
10 mod boll;
11 mod sprites;
12
13 const SCREEN_WIDTH: u32 = 1280;
14 const SCREEN_HEIGHT: u32 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u32;
15
16 fn main() {
17     println!("starting...");
18     let mut app = App::new()
19         .with_resolution(SCREEN_WIDTH as u16, SCREEN_HEIGHT as u16)
20         .with_state(Box::new(ActiveState::new()))
21         .with_title("SDL test")
22         .build()
23         .unwrap();
24     app.load_sprites(&[("block", "res/block.bmp"), ("mario", "res/mario-trans.png")]);
25
26     app.start();
27 }