extern crate glium;
|
|
extern crate glutin;
|
|
extern crate textium;
|
|
|
|
use glium::Surface;
|
|
|
|
fn main() {
|
|
let mut events_loop = glutin::EventsLoop::new();
|
|
let window = glutin::WindowBuilder::new()
|
|
.with_title("Hello, world!")
|
|
.with_dimensions(1024, 768);
|
|
|
|
let context = glutin::ContextBuilder::new().with_vsync(true);
|
|
let display = glium::Display::new(window, context, &events_loop).unwrap();
|
|
|
|
let mut closed = false;
|
|
while !closed {
|
|
let mut frame = display.draw();
|
|
frame.clear_color(0., 0., 1., 1.);
|
|
frame.finish().unwrap();
|
|
|
|
events_loop.poll_events(|ev| {
|
|
match ev {
|
|
glutin::Event::WindowEvent { event, .. } => match event {
|
|
glutin::WindowEvent::Closed => closed = true,
|
|
_ => (),
|
|
},
|
|
_ => (),
|
|
}
|
|
});
|
|
}
|
|
}
|