summaryrefslogtreecommitdiffstats
path: root/graphics/src/compositor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src/compositor.rs')
-rw-r--r--graphics/src/compositor.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/graphics/src/compositor.rs b/graphics/src/compositor.rs
index 8c67cd16..86472a58 100644
--- a/graphics/src/compositor.rs
+++ b/graphics/src/compositor.rs
@@ -20,6 +20,18 @@ pub trait Compositor: Sized {
fn new<W: Window + Clone>(
settings: Settings,
compatible_window: W,
+ ) -> impl Future<Output = Result<Self, Error>> {
+ Self::with_backend(settings, compatible_window, None)
+ }
+
+ /// Creates a new [`Compositor`] with a backend preference.
+ ///
+ /// If the backend does not match the preference, it will return
+ /// [`Error::GraphicsAdapterNotFound`].
+ fn with_backend<W: Window + Clone>(
+ _settings: Settings,
+ _compatible_window: W,
+ _backend: Option<&str>,
) -> impl Future<Output = Result<Self, Error>>;
/// Creates a [`Self::Renderer`] for the [`Compositor`].
@@ -130,9 +142,10 @@ impl Compositor for () {
type Renderer = ();
type Surface = ();
- async fn new<W: Window + Clone>(
+ async fn with_backend<W: Window + Clone>(
_settings: Settings,
_compatible_window: W,
+ _preffered_backend: Option<&str>,
) -> Result<Self, Error> {
Ok(())
}