extern crate glutin;
mod support;
use glutin::GlContext;
fn main() {
let mut events_loop = glutin::EventsLoop::new();
let window = glutin::WindowBuilder::new()
.with_title("A fantastic window!")
.with_decorations(false)
.with_transparency(true);
let context = glutin::ContextBuilder::new();
let gl_window = glutin::GlWindow::new(window, context, &events_loop).unwrap();
let _ = unsafe { gl_window.make_current() };
println!("Pixel format of the window's GL context: {:?}", gl_window.get_pixel_format());
let gl = support::load(&gl_window);
events_loop.run_forever(|event| {
println!("{:?}", event);
match event {
glutin::Event::WindowEvent { event, .. } => match event {
glutin::WindowEvent::CloseRequested => return glutin::ControlFlow::Break,
glutin::WindowEvent::Resized(w, h) => gl_window.resize(w, h),
_ => (),
},
_ => (),
}
gl.draw_frame([0.0, 0.0, 0.0, 0.0]);
let _ = gl_window.swap_buffers();
glutin::ControlFlow::Continue
});
}