Introduce feature flags to enable iced_glow
Also keep `iced_wgpu` as the default renderer for the time being.
This commit is contained in:
parent
d6bf8955db
commit
22ced3485e
8 changed files with 72 additions and 35 deletions
29
src/lib.rs
29
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue