gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.55k stars 918 forks source link

SDL2 implementation broken #5638

Open Khalzz opened 6 months ago

Khalzz commented 6 months ago

WGPU is not working with SDL2 binding for rust, or at least i have not been able to make it work, since the surface creation requires access to a raw_window_handle and somehow, even though the sdl2 crate haves it as a feature it does not exists or at least it doesnt work.

If somebody has tried using sdl2 with the last release i wish i could get the way you can access to the raw window handle from this.

Wumpf commented 6 months ago

That would be an issue in https://github.com/Rust-SDL2/rust-sdl2 more likely? Can you describe in a bit more detail the apis that don't work? Note that there's two ways in wgpu to create a surface by now, a safe variant and an unsafe one. Both take their own dedicated enum type which describes all the types of window handle that work with it

tasogare3710 commented 6 months ago

In any case, only SDL_SysWMinfo.{x11, wl} is bound.

https://docs.rs/sdl2-sys/latest/x86_64-pc-windows-msvc/sdl2_sys/union.SDL_SysWMinfo__bindgen_ty_1.html

https://docs.rs/sdl2-sys/latest/x86_64-pc-windows-msvc/src/sdl2_sys/opt/rustwide/target/x86_64-pc-windows-msvc/debug/build/sdl2-sys-0ce64f9730a30f98/out/sdl_bindings.rs.html#37378-37383