Skip to content

Instantly share code, notes, and snippets.

@SiegeLord
Created August 25, 2013 23:56
Show Gist options
  • Select an option

  • Save SiegeLord/6337053 to your computer and use it in GitHub Desktop.

Select an option

Save SiegeLord/6337053 to your computer and use it in GitHub Desktop.
Using Allegro from Rust
#[start]
fn start(argc: int, argv: **u8, crate_map: *u8) -> int
{
allegro::run(argc, argv, crate_map, main)
}
fn main()
{
let mut disp = allegro::Display::new(800, 600).unwrap();
let bmp = ~allegro::Bitmap::new(256, 256).unwrap();
disp.clear_to_color(allegro::Color::map_rgb_f(0.0, 0.0, 0.0));
disp.set_target_bitmap(bmp);
disp.clear_to_color(allegro::Color::map_rgb_f(0.0, 0.0, 1.0));
let bmp = disp.clear_target_bitmap().unwrap();
disp.draw_bitmap(bmp, 100.0, 100.0, 0);
disp.flip();
allegro::rest(2.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment