Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Window-creation/Rust/window-creation.rust
Normal file
21
Task/Window-creation/Rust/window-creation.rust
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use winit::event::{Event, WindowEvent}; // winit 0.24
|
||||
use winit::event_loop::{ControlFlow, EventLoop};
|
||||
use winit::window::WindowBuilder;
|
||||
|
||||
fn main() {
|
||||
let event_loop = EventLoop::new();
|
||||
let _win = WindowBuilder::new()
|
||||
.with_title("Window")
|
||||
.build(&event_loop).unwrap();
|
||||
|
||||
event_loop.run(move |ev, _, flow| {
|
||||
match ev {
|
||||
Event::WindowEvent {
|
||||
event: WindowEvent::CloseRequested, ..
|
||||
} => {
|
||||
*flow = ControlFlow::Exit;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue