Vsync instead of fps + print display modes
[kaka/rust-sdl-test.git] / src / main.rs
index fdd36da..217918c 100644 (file)
@@ -28,7 +28,12 @@ const NS_PER_FRAME: u32 = 1_000_000_000 / FPS;
 
 fn main() {
     println!("starting...");
-    let mut app = App::new();
+    let mut app = App::new()
+       .with_resolution(SCREEN_WIDTH as u16, SCREEN_HEIGHT as u16)
+       .with_state(Box::new(ActiveState::new()))
+       .with_title("SDL test")
+       .build()
+       .unwrap();
     app.load_sprites(&[
         ("block", "res/block.bmp"),
         ("mario", "res/mario-trans.png"),