-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix your tutorial #553
Comments
I dont think the tutorial has any errors from what ive seen. Check the versions of your dependencies to make sure they match with what the guide says since both wgpu and winit have had some updates since that last change to the guide. If you are using the correct versions of the dependencies and have double checked that you followed the guide correctly, then posting what errors you've been getting would be helpful since it can help narrow down exactly what's causing it. What I believe happened here is that you used the most recent versions of wgpu and winit which has some issues when it comes to creating the surface. The way to fix it is mentioned here. Essentially, you wrap the winit window in an Arc and then the Surface should contain a 'static lifetime. If thats not the issue that you have, as mentioned before, please paste the errors you are getting to give a lead as to what is going wrong. |
I was able to make it work following this other issue #549 . Unfortunately, as I commented there, a LOT has to change to make it happen, and with |
yeah Im having a very hard time getting // .. in 'fn run()'
env_logger::init();
let event_loop = EventLoop::new().unwrap();
let window = WindowBuilder::new().build(&event_loop).unwrap();
event_loop.run(move |event, control_flow| match event {
Event::WindowEvent {
ref event,
window_id,
} if window_id == window.id() => match event {
WindowEvent::CloseRequested
| WindowEvent::KeyboardInput {
event:
KeyEvent {
state: ElementState::Pressed,
physical_key: PhysicalKey::Code(KeyCode::Escape),
..
},
..
} => control_flow.exit(),
_ => {}
},
_ => {}
});
Then, in the later revised version of pub async fn run() {
// Window setup...
let mut state = State::new(&window).await;
event_loop.run(move |event, control_flow| {
match event {
Event::WindowEvent {
ref event,
window_id,
} if window_id == state.window().id() => match event {
WindowEvent::CloseRequested
| WindowEvent::KeyboardInput {
input:
KeyboardInput {
state: ElementState::Pressed,
virtual_keycode: Some(VirtualKeyCode::Escape),
..
},
..
} => *control_flow = ControlFlow::Exit,
_ => {}
},
_ => {}
}
});
} The I may be completely wrong and may be missing dependencies, but it seems the tutorial just is impossible to follow without heavy modification. I have spent almost an hour finding workarounds for this, but |
There are breaking changes between |
It was a good tutorial (the tutorial recommended by gfx-rs themselves) for wgpu.
Now it provides code that has compiler errors and says things referencing other things that dont exist.
If you're going to update your tutorial, why would you ever deploy incomplete, spotty pages to the main branch?
The text was updated successfully, but these errors were encountered: