Provide compatible_surface in iced_wgpu::Compositor

This commit is contained in:
Héctor Ramón 2021-05-05 14:33:03 +07:00
parent 6b4bf34bf9
commit 3840b75bea
4 changed files with 25 additions and 8 deletions

View file

@ -17,7 +17,10 @@ pub trait Compositor: Sized {
type SwapChain;
/// Creates a new [`Compositor`].
fn new(settings: Self::Settings) -> Result<(Self, Self::Renderer), Error>;
fn new<W: HasRawWindowHandle>(
settings: Self::Settings,
compatible_window: Option<&W>,
) -> Result<(Self, Self::Renderer), Error>;
/// Crates a new [`Surface`] for the given window.
///