Add methods to set ControlFlow operation
This allows downstream users to avoid importing `ControlFlow` from winit.
This commit is contained in:
parent
c57294b41a
commit
d624a3e648
27 changed files with 120 additions and 86 deletions
|
|
@ -3,7 +3,7 @@ use winit::{
|
|||
event::{
|
||||
ElementState, Event, KeyboardInput, MouseButton, StartCause, VirtualKeyCode, WindowEvent,
|
||||
},
|
||||
event_loop::{ControlFlow, EventLoop},
|
||||
event_loop::EventLoop,
|
||||
window::{Window, WindowBuilder, WindowId},
|
||||
};
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ fn main() {
|
|||
eprintln!("Switch which window is to be dragged by pressing \"x\".")
|
||||
}
|
||||
Event::WindowEvent { event, window_id } => match event {
|
||||
WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
|
||||
WindowEvent::CloseRequested => control_flow.set_exit(),
|
||||
WindowEvent::MouseInput {
|
||||
state: ElementState::Pressed,
|
||||
button: MouseButton::Left,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue