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