Gfx: Please add support for the new `raw-window-handle` crate

Created on 15 Aug 2019  路  4Comments  路  Source: gfx-rs/gfx

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.

  • This would affect each backend.
  • It's a strict superset of the winit feature, so this can be released as a 0.3.1
  • Instead of having the winit 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.
  • After this the 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

DirectX-11 DirectX-12 Metal OpenGL Vulkan request contributor-friendly easy ready for work api medium

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).

All 4 comments

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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

InMath picture InMath  路  5Comments

kvark picture kvark  路  4Comments

mjadczak picture mjadczak  路  4Comments

msiglreith picture msiglreith  路  3Comments

seivan picture seivan  路  4Comments