Last active
August 29, 2015 13:57
-
-
Save shadowmint/9382878 to your computer and use it in GitHub Desktop.
Rusts stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait GameState { | |
fn update(); | |
fn draw(); | |
fn delegate_input() {} | |
fn call_delegated_input() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustc -L../../rust-sfml/lib/ --out-dir bin src/main.rs | |
src/game_window.rs:24:14: 24:28 error: failed to find an implementation of trait game_state::GameState for ~game_state::GameState:Send | |
src/game_window.rs:24 state: ~default_state, | |
^~~~~~~~~~~~~~ | |
make: *** [demo] Error 101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate native; | |
use menu::{Menu}; | |
use game_state::{GameState}; | |
use std::io::timer; | |
mod game_menu; | |
mod game_state; | |
mod menu; | |
#[cfg(target_os="macos")] | |
#[start] | |
fn start(argc: int, argv: **u8) -> int { | |
native::start(argc, argv, main) | |
} | |
fn main() { | |
// Game Window | |
let menu = Menu::new(~"Line Dodge"); | |
let game_window = game_menu::GameWindow::new(~menu); | |
//game_window.set_game_state(~menu); | |
// | |
// Player | |
// let mut circle = match CircleShape::new() { | |
// Some(circle) => circle, | |
// None => fail!("Could not render circle.") | |
// }; | |
// circle.set_fill_color(&Color::green()); | |
// circle.set_radius(50.); | |
// | |
// while window.is_open() { | |
// handle_input(&mut window, &mut circle); | |
// window.clear(&Color::new_RGB(0,0,0)); | |
// window.display(); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment