Closed trevordblack closed 2 months ago
it goes from
Event::WindowEvent { event, .. } => match event { WindowEvent::CloseRequested => control_handle.exit(), WindowEvent::RedrawRequested => {
to
event_loop.run(move |event, _, control_flow| { *control_flow = ControlFlow::Poll; match event { Event::WindowEvent { event, .. } => match event { WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit, _ => (), }, Event::RedrawRequested(_) => { // Wait for the next available frame buffer. let frame: wgpu::SurfaceTexture = surface .get_current_texture() .expect("failed to get current texture"); // TODO: draw frame frame.present(); } Event::MainEventsCleared => { // draw repeatedly window.request_redraw(); } _ => (), }
These changes to the event code need to be highlighted
Actually, the complete code has the simpler WindowEvent code, so it's likely that listing 5 is just a mistake
it goes from
to