pub fn handle_event(&mut self, event: Event<'_, GlutinThreadEvent>, window_target: &EventLoopWindowTarget<GlutinThreadEvent>, control_flow: &mut ControlFlow) {
        use Event::*;

        if *control_flow != ControlFlow::Exit {
            *control_flow = ControlFlow::Wait;
        }

        match event {
            NewEvents(_cause)                       => { }
            WindowEvent { window_id, event }        => { self.handle_window_event(window_id, event); }
            DeviceEvent { device_id: _, event: _ }  => { }
            UserEvent(thread_event)                 => { self.handle_thread_event(thread_event, window_target); }
            Suspended                               => { }
            Resumed                                 => { }
            RedrawRequested(window_id)              => { self.request_redraw(window_id); }
            
            MainEventsCleared                       => {
                // Glutin doesn't always respond to ControlFlow::Exit requests, setting it after the other events have cleared is an attempt
                // to make it exit more reliably (only partially successful).
                if self.will_exit {
                    *control_flow = ControlFlow::Exit;
                }
            }
            RedrawEventsCleared                     => { }
            LoopDestroyed                           => { }
        }
    }
///
/// Handles an event from the rest of the process and updates the state
///
Handles an event from the rest of the process and updates the state
Handles an event from the rest of the process and updates the state
pub fn handle_event(&mut self, event: Event<'_, GlutinThreadEvent>, window_target: &EventLoopWindowTarget<GlutinThreadEvent>, control_flow: &mut ControlFlow) {
        use Event::*;
        if *control_flow != ControlFlow::Exit {
            *control_flow = ControlFlow::Wait;
        }
        match event {
            NewEvents(_cause)                       => { }
            WindowEvent { window_id, event }        => { self.handle_window_event(window_id, event); }
            DeviceEvent { device_id: _, event: _ }  => { }
            UserEvent(thread_event)                 => { self.handle_thread_event(thread_event, window_target); }
            Suspended                               => { }
            Resumed                                 => { }
            RedrawRequested(window_id)              => { self.request_redraw(window_id); }
            MainEventsCleared                       => {
                // Glutin doesn't always respond to ControlFlow::Exit requests, setting it after the other events have cleared is an attempt
                // to make it exit more reliably (only partially successful).
                if self.will_exit {
                    *control_flow = ControlFlow::Exit;
                }
            }
            RedrawEventsCleared                     => { }
            LoopDestroyed                           => { }
        }
    }
pub fn handle_event ( & mut self , event : Event < ' _ , GlutinThreadEvent > , window_target : & EventLoopWindowTarget < GlutinThreadEvent > , control_flow : & mut ControlFlow ) { use Event :: * ; if * control_flow != ControlFlow :: Exit { * control_flow = ControlFlow :: Wait ; } match event { NewEvents ( _cause ) => { } WindowEvent { window_id , event } => { self . handle_window_event ( window_id , event ) ; } DeviceEvent { device_id : _ , event : _ } => { } UserEvent ( thread_event ) => { self . handle_thread_event ( thread_event , window_target ) ; } Suspended => { } Resumed => { } RedrawRequested ( window_id ) => { self . request_redraw ( window_id ) ; } MainEventsCleared => { // Glutin doesn't always respond to ControlFlow::Exit requests, setting it after the other events have cleared is an attempt // to make it exit more reliably (only partially successful). if self . will_exit { * control_flow = ControlFlow :: Exit ; } } RedrawEventsCleared => { } LoopDestroyed => { } } }
Handles an event from the rest of the process and updates the state
Handles an event from the rest of the process and updates the state
&mut self
event
Event<'_, GlutinThreadEvent>
window_target
&EventLoopWindowTarget<GlutinThreadEvent>
control_flow
&mut ControlFlow