mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Allow creating a surface by passing a metal layer.
This is useful if you're using `SDL2` ```rust let canvas = window.into_canvas().build().unwrap(); let metal_layer = unsafe { sdl2::sys::SDL_RenderGetMetalLayer(canvas.raw()) }; let surface = instance.create_surface_with_metal_layer(metal_layer); ```
This commit is contained in:
parent
fef27e46d3
commit
d63d367ec0
@ -242,6 +242,13 @@ impl Instance {
|
||||
id: wgn::wgpu_instance_create_surface_from_winit(self.id, window),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "metal")]
|
||||
pub fn create_surface_with_metal_layer(&self, window: *mut std::ffi::c_void) -> Surface {
|
||||
Surface {
|
||||
id: wgn::wgpu_instance_create_surface_from_macos_layer(self.id, window),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Adapter {
|
||||
|
Loading…
Reference in New Issue
Block a user