Renamed common to util
[kaka/rust-sdl-test.git] / src / main.rs
CommitLineData
296187ca
TW
1extern crate rand;
2extern crate sdl2;
3extern crate time;
60276654 4extern crate noise;
296187ca 5
b0566120 6use core::game::GameState;
3d049b50 7use core::app::*;
296187ca 8
296187ca 9mod boll;
953b4c96
TW
10mod core;
11mod geometry;
cdf8f998 12mod sprites;
953b4c96 13mod teststate;
5433a77f 14mod util;
296187ca 15
77034de9
TW
16const SCREEN_WIDTH: u16 = 1280;
17const SCREEN_HEIGHT: u16 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u16;
296187ca 18
296187ca
TW
19fn main() {
20 println!("starting...");
6edafdc0 21 let mut app = App::new()
77034de9 22 .with_resolution(SCREEN_WIDTH, SCREEN_HEIGHT)
b0566120
TW
23// .with_state(Box::new(ActiveState::new((SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32))))
24 .with_state(Box::new(GameState::new()))
6ba7aef1
TW
25 .with_title("SDL test")
26 .build()
27 .unwrap();
28 app.load_sprites(&[("block", "res/block.bmp"), ("mario", "res/mario-trans.png")]);
29
30 app.start();
296187ca 31}