diff options
author | 2020-05-27 05:05:13 +0200 | |
---|---|---|
committer | 2020-05-27 05:05:13 +0200 | |
commit | 22ced3485eb6f295faaab1e31d8d1b8d61fc422b (patch) | |
tree | 5dde16d8a4a161995800acc482c13fc8dc697639 /src/application.rs | |
parent | d6bf8955dbca03898e379aae376d91677bb4d223 (diff) | |
download | iced-22ced3485eb6f295faaab1e31d8d1b8d61fc422b.tar.gz iced-22ced3485eb6f295faaab1e31d8d1b8d61fc422b.tar.bz2 iced-22ced3485eb6f295faaab1e31d8d1b8d61fc422b.zip |
Introduce feature flags to enable `iced_glow`
Also keep `iced_wgpu` as the default renderer for the time being.
Diffstat (limited to 'src/application.rs')
-rw-r--r-- | src/application.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/application.rs b/src/application.rs index b6f2227e..19cab7da 100644 --- a/src/application.rs +++ b/src/application.rs @@ -188,21 +188,21 @@ pub trait Application: Sized { { #[cfg(not(target_arch = "wasm32"))] { - let glow_settings = iced_glow::Settings { + let renderer_settings = crate::renderer::Settings { default_font: settings.default_font, antialiasing: if settings.antialiasing { - Some(iced_glow::settings::Antialiasing::MSAAx4) + Some(crate::renderer::settings::Antialiasing::MSAAx4) } else { None }, - ..iced_glow::Settings::default() + ..crate::renderer::Settings::default() }; - iced_glutin::application::run::< + crate::runtime::application::run::< Instance<Self>, Self::Executor, - iced_glow::window::Compositor, - >(settings.into(), glow_settings); + crate::renderer::window::Compositor, + >(settings.into(), renderer_settings); } #[cfg(target_arch = "wasm32")] @@ -213,11 +213,11 @@ pub trait Application: Sized { struct Instance<A: Application>(A); #[cfg(not(target_arch = "wasm32"))] -impl<A> iced_glutin::Program for Instance<A> +impl<A> iced_winit::Program for Instance<A> where A: Application, { - type Renderer = iced_glow::Renderer; + type Renderer = crate::renderer::Renderer; type Message = A::Message; fn update(&mut self, message: Self::Message) -> Command<Self::Message> { @@ -230,7 +230,7 @@ where } #[cfg(not(target_arch = "wasm32"))] -impl<A> iced_glutin::Application for Instance<A> +impl<A> crate::runtime::Application for Instance<A> where A: Application, { @@ -246,10 +246,10 @@ where self.0.title() } - fn mode(&self) -> iced_glutin::Mode { + fn mode(&self) -> iced_winit::Mode { match self.0.mode() { - window::Mode::Windowed => iced_glutin::Mode::Windowed, - window::Mode::Fullscreen => iced_glutin::Mode::Fullscreen, + window::Mode::Windowed => iced_winit::Mode::Windowed, + window::Mode::Fullscreen => iced_winit::Mode::Fullscreen, } } |