summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-27 05:05:13 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-27 05:05:13 +0200
commit22ced3485eb6f295faaab1e31d8d1b8d61fc422b (patch)
tree5dde16d8a4a161995800acc482c13fc8dc697639 /src/lib.rs
parentd6bf8955dbca03898e379aae376d91677bb4d223 (diff)
downloadiced-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/lib.rs')
-rw-r--r--src/lib.rs29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 58cc141d..d08b39cf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -197,6 +197,29 @@ pub mod window;
#[cfg_attr(docsrs, doc(cfg(any(feature = "tokio", feature = "async-std"))))]
pub mod time;
+#[cfg(all(
+ not(target_arch = "wasm32"),
+ not(feature = "glow"),
+ feature = "wgpu"
+))]
+use iced_winit as runtime;
+
+#[cfg(all(not(target_arch = "wasm32"), feature = "glow"))]
+use iced_glutin as runtime;
+
+#[cfg(all(
+ not(target_arch = "wasm32"),
+ not(feature = "glow"),
+ feature = "wgpu"
+))]
+use iced_wgpu as renderer;
+
+#[cfg(all(not(target_arch = "wasm32"), feature = "glow"))]
+use iced_glow as renderer;
+
+#[cfg(target_arch = "wasm32")]
+use iced_web as runtime;
+
#[doc(no_inline)]
pub use widget::*;
@@ -206,12 +229,6 @@ pub use executor::Executor;
pub use sandbox::Sandbox;
pub use settings::Settings;
-#[cfg(not(target_arch = "wasm32"))]
-use iced_glutin as runtime;
-
-#[cfg(target_arch = "wasm32")]
-use iced_web as runtime;
-
pub use runtime::{
futures, Align, Background, Color, Command, Font, HorizontalAlignment,
Length, Point, Rectangle, Size, Subscription, Vector, VerticalAlignment,