当我尝试制作 wgpu 表面时,出现此错误:
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<'_>
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
let surface = unsafe { instance.create_surface(&window) }.unwrap();
我不知道如何解决这个问题,我尝试修复但一切都是徒劳的。