Separate Compositor::new from Compositor::create_renderer

This commit is contained in:
Héctor Ramón Jiménez 2023-12-02 20:49:47 +01:00
parent ea42af766f
commit b152ecda63
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 35 additions and 75 deletions

View file

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