extern crate glfw;
#[macro_use] extern crate log;
use std::cell::Cell;
fn main() {
let mut glfw = glfw::init(Some(
glfw::Callback {
f: error_callback as fn(glfw::Error, String, &Cell<usize>),
data: Cell::new(0),
}
)).unwrap();
glfw.window_hint(glfw::WindowHint::ContextVersion(40000, 3000)); let _ = glfw.create_window(300, 300, "Hey this won't work.", glfw::WindowMode::Windowed);
let _ = glfw.create_window(300, 300, "Nope, not working.", glfw::WindowMode::Windowed);
let _ = glfw.create_window(300, 300, "Stop it! :(", glfw::WindowMode::Windowed);
}
fn error_callback(_: glfw::Error, description: String, error_count: &Cell<usize>) {
error!("GLFW error {:?}: {:?}", error_count.get(), description);
error_count.set(error_count.get() + 1);
}