Skip to content

Commit

Permalink
Use new version of iced_glutin to support glow + sctk
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Feb 7, 2023
1 parent 6e99cd2 commit bedaf84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ wgpu = ["iced_wgpu"]
# Enables the `iced_softbuffer` renderer. Conflicts with `iced_wgpu` and `iced_glow`
softbuffer = ["iced_softbuffer"]
# Enables the `iced_glow` renderer. Conflicts with `iced_wgpu` and `iced_softbuffer`
glow = ["iced_glow"]
glow = ["iced_glow", "iced_glutin"]
# Enables using system fonts
default_system_font = ["iced_wgpu?/default_system_font", "iced_glow?/default_system_font"]
# Enables a debug view in native platforms (press F12)
Expand Down
25 changes: 20 additions & 5 deletions src/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,26 @@ pub trait Application: Sized {
..crate::renderer::Settings::from_env()
};

Ok(crate::runtime::run::<
Instance<Self>,
Self::Executor,
crate::renderer::window::Compositor<Self::Theme>,
>(settings.into(), renderer_settings)?)
#[cfg(feature = "glow")]
{
let renderer_settings = iced_glutin::Settings {
gl_settings: renderer_settings,
try_opengles_first: settings.try_opengles_first
};
Ok(crate::runtime::run::<
Instance<Self>,
Self::Executor,
iced_glutin::Compositor<crate::renderer::window::Compositor<Self::Theme>>,
>(settings.into(), renderer_settings)?)
}
#[cfg(not(feature = "glow"))]
{
Ok(crate::runtime::run::<
Instance<Self>,
Self::Executor,
crate::renderer::window::Compositor<Self::Theme>,
>(settings.into(), renderer_settings)?)
}
}
}

Expand Down

0 comments on commit bedaf84

Please sign in to comment.