Recently the gamedev-wg has been trying to make it easier for windowing libs and graphical libs to agree on a protocol for communication. This has resulted in the raw-window-handle crate, where the window offers up its OS window handle thingy to the graphical lib upon request and then the graphical lib is able to do its startup.
winit feature, so this can be released as a 0.3.1winit feature allow for the pub fn create_surface(&self, window: &winit::window::Window) -> Surface method, you simply _unconditionally_ have a pub fn create_surface(&self, has_handle: &impl raw_window_handle::HasRawWindowHandle) -> Surface method. Then you call for the raw window handle, match on it, and then re-dispatch to the correct actual method just like before.winit feature can eventually be removed in 0.4 EDIT: _only_ if the raw-window-handle crate ends up supporting the web platform by then (which is up in the air at this time).Tracking issue where this crate was discussed and crated if you have any questions: https://github.com/rust-gamedev/wg/issues/26
If I'm not mistaken #2915 also refers to this, this has more info though! 馃憤
Ah! indeed, missed it because it was so long ago and ossipal just published the crate a bit ago so i figured there wasn't an older issue farther back.
To remove winit feature in 0.4 raw-window-handle would need to support web platform.
I started looking at this the other night (focusing on the Vulkan backend first), but it looks like Android support will be needed in raw-window-handle (already raised here).
I will do some more work and open a draft PR at some point this week.
EDIT: Done (#2967).
Most helpful comment
I started looking at this the other night (focusing on the Vulkan backend first), but it looks like Android support will be needed in
raw-window-handle(already raised here).I will do some more work and open a draft PR at some point this week.EDIT: Done (#2967).