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