(winit: &mut WinitEventLoop, state: &mut StrataState, output: &Output)
| 130 | } |
| 131 | |
| 132 | pub fn winit_dispatch(winit: &mut WinitEventLoop, state: &mut StrataState, output: &Output) { |
| 133 | // process winit events |
| 134 | let res = winit.dispatch_new_events(|event| { |
| 135 | match event { |
| 136 | WinitEvent::Resized { size, .. } => { |
| 137 | output.change_current_state(Some(Mode { size, refresh: 60_000 }), None, None, None); |
| 138 | } |
| 139 | WinitEvent::Input(event) => { |
| 140 | if let Err(e) = state.process_input_event(event) { |
| 141 | panic!("{:#?}", e); |
| 142 | } |
| 143 | } |
| 144 | _ => (), |
| 145 | } |
| 146 | }); |
| 147 | |
| 148 | if let PumpStatus::Exit(_) = res { |
| 149 | state.comp.borrow().loop_signal.stop(); |
| 150 | } else { |
| 151 | state.comp.borrow_mut().winit_update(); |
| 152 | } |
| 153 | } |
no test coverage detected