Reintroduce backend selection through ICED_BACKEND env var
This commit is contained in:
parent
441e9237cd
commit
4f5b63f1f4
8 changed files with 196 additions and 83 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue