Closed myth0genesis closed 1 month ago
Yeah this needs to be corrected, they probably just haven't gotten around to updating the site yet. the relevant changes are listed below.
the closure passed into event_loop.run
only takes two arguments, eliminate the _,
and you're good to go.
The entire match arm for RedrawRequested
can be simplified to WindowEvent::RedrawRequested => {
In the state.render()
match block, replace *control_flow = ControlFlow::Exit
with control_flow.exit()
Hope this helps!
The following code block:
does not seem to match the source linked at the end of the chapter. Furthermore, when attempting to use the above code, I get an error stating the closure in
run()
is expected to take 2 arguments, not the 3 shown in the example above,WindowEvent::RedrawRequested()
throws an error stating "this pattern has 1 field, but the corresponding tuple struct has 0 fields", andErr(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit,
gives the error "failed to resolve: use of undeclared type 'ControlFlow' use of undeclared type 'ControlFlow'". Could further clarification be provided as to how this block of code is supposed to be correctly integrated into the renderer? Or was this just an error resulting from you using a different version ofwinit
than what the source uses?