Skip to content
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

Incompatible with wgpu 1.9.0+ #1376

Open
jordan4ibanez opened this issue Mar 6, 2024 · 2 comments · May be fixed by #1385
Open

Incompatible with wgpu 1.9.0+ #1376

jordan4ibanez opened this issue Mar 6, 2024 · 2 comments · May be fixed by #1385

Comments

@jordan4ibanez
Copy link

jordan4ibanez commented Mar 6, 2024

the trait bound `sdl2::video::Window: HasWindowHandle` is not satisfied
the following other types implement trait `HasWindowHandle`:
  Box<H>
  wgpu::raw_window_handle::WindowHandle<'_>
  Rc<H>
  Arc<H>
  &H
  &mut H
required for `&sdl2::video::Window` to implement `HasWindowHandle`
required for `&sdl2::video::Window` to implement `wgpu::WindowHandle`
required for `SurfaceTarget<'_>` to implement `From<&sdl2::video::Window>`
required for `&sdl2::video::Window` to implement `Into<SurfaceTarget<'_>>`

This leaves it stuck back in versions before wgpu 1.9.0.

This is the minimal reproducible environment:

///
/// Attempts to link the SDL2 window into wgpu to create a surface.
///
pub fn link_wgpu_to_sdl2<'a>(
  instance: &'a wgpu::Instance,
  window: &'a sdl2::video::Window,
) -> Result<wgpu::Surface<'a>, wgpu::CreateSurfaceError> {
  unsafe { instance.create_surface(window) }
}
@daniel-lacour
Copy link

Glad to know I wasn't the only one dealing with this.

@jordan4ibanez
Copy link
Author

Yeah, this was quiet frustrating. I looked into it a while back and for the life of me cannot figure out what changes are needed to make it work.

@Noahnoah55 Noahnoah55 linked a pull request Apr 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants