4a88954358e57ca71a18567a93df1788d78be2da
[kaka/rust-sdl-test.git] / src / main.rs
1 extern crate rand;
2 extern crate sdl2;
3 extern crate time;
4 extern crate noise;
5
6 use core::game::GameState;
7 use core::app::*;
8
9 mod boll;
10 mod common;
11 mod core;
12 mod geometry;
13 mod sprites;
14 mod teststate;
15
16 const SCREEN_WIDTH: u16 = 1280;
17 const SCREEN_HEIGHT: u16 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u16;
18
19 fn main() {
20     println!("starting...");
21     let mut app = App::new()
22         .with_resolution(SCREEN_WIDTH, SCREEN_HEIGHT)
23 //        .with_state(Box::new(ActiveState::new((SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32))))
24         .with_state(Box::new(GameState::new()))
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();
31 }