2019-06-22 01:33:15 +10:00
|
|
|
use winit::{
|
|
|
|
event::{Event, WindowEvent},
|
|
|
|
event_loop::{ControlFlow, EventLoop},
|
|
|
|
window::WindowBuilder,
|
|
|
|
};
|
2015-05-15 23:19:33 +10:00
|
|
|
|
|
|
|
fn main() {
|
2019-02-06 02:30:33 +11:00
|
|
|
let event_loop = EventLoop::new();
|
2017-01-29 01:45:01 +11:00
|
|
|
|
2019-06-22 01:33:15 +10:00
|
|
|
let window = WindowBuilder::new()
|
|
|
|
.with_decorations(false)
|
|
|
|
.with_transparent(true)
|
|
|
|
.build(&event_loop)
|
|
|
|
.unwrap();
|
2017-01-29 01:45:01 +11:00
|
|
|
|
2015-05-15 23:19:33 +10:00
|
|
|
window.set_title("A fantastic window!");
|
|
|
|
|
2019-02-06 02:30:33 +11:00
|
|
|
event_loop.run(move |event, _, control_flow| {
|
2015-06-16 21:48:08 +10:00
|
|
|
println!("{:?}", event);
|
|
|
|
|
|
|
|
match event {
|
2019-06-22 01:33:15 +10:00
|
|
|
Event::WindowEvent {
|
|
|
|
event: WindowEvent::CloseRequested,
|
|
|
|
..
|
|
|
|
} => *control_flow = ControlFlow::Exit,
|
2019-02-06 02:30:33 +11:00
|
|
|
_ => *control_flow = ControlFlow::Wait,
|
2015-06-16 21:48:08 +10:00
|
|
|
}
|
2017-01-29 01:45:01 +11:00
|
|
|
});
|
2015-05-15 23:19:33 +10:00
|
|
|
}
|