When I try to make a wgpu surface I get this error:
error[E0277]: the trait bound `Window: raw_window_handle::HasRawDisplayHandle` is not satisfied
--> src/lib.rs:34:56
|
34 | let surface = unsafe { instance.create_surface(&window) }.unwrap();
| -------------- ^^^^^^^ the trait `raw_window_handle::HasRawDisplayHandle` is not implemented for `Window`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `raw_window_handle::HasRawDisplayHandle`:
&'a T
raw_window_handle::borrowed::DisplayHandle<'_>
this my code:
let surface = unsafe { instance.create_surface(&window) }.unwrap();
i dont know how fix that, i try fix but everything is in vain.
The function
create_surface
takes an argumentwindow
which must implementHasRawWindowHandle + HasRawDisplayHandle
Your code is correct, but you are missing a/the
winit **rwh_05**
feature.Replace
winit = "0.29"
withwinit = { version = "0.29", features = ["rwh_05"]}
in theCargo.toml
file and it should work.