2020-09-10 11:58:30 +10:00
|
|
|
use simple_logger::SimpleLogger;
|
2019-06-22 01:33:15 +10:00
|
|
|
use winit::{
|
|
|
|
event::{Event, WindowEvent},
|
2022-04-10 11:32:02 +10:00
|
|
|
event_loop::EventLoop,
|
2019-06-22 01:33:15 +10:00
|
|
|
window::WindowBuilder,
|
|
|
|
};
|
2015-05-15 23:19:33 +10:00
|
|
|
|
|
|
|
fn main() {
|
2020-09-10 11:58:30 +10:00
|
|
|
SimpleLogger::new().init().unwrap();
|
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| {
|
2022-04-10 11:32:02 +10:00
|
|
|
control_flow.set_wait();
|
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,
|
|
|
|
..
|
2022-04-10 11:32:02 +10:00
|
|
|
} => control_flow.set_exit(),
|
2020-01-05 18:12:03 +11:00
|
|
|
_ => (),
|
2015-06-16 21:48:08 +10:00
|
|
|
}
|
2017-01-29 01:45:01 +11:00
|
|
|
});
|
2015-05-15 23:19:33 +10:00
|
|
|
}
|