Skip to content

Commit 8d6d245

Browse files
committed
Use new version of iced_glutin to support glow + sctk
1 parent 97d95e4 commit 8d6d245

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ wgpu = ["iced_wgpu"]
2828
# Enables the `iced_softbuffer` renderer. Conflicts with `iced_wgpu` and `iced_glow`
2929
softbuffer = ["iced_softbuffer"]
3030
# Enables the `iced_glow` renderer. Conflicts with `iced_wgpu` and `iced_softbuffer`
31-
glow = ["iced_glow"]
31+
glow = ["iced_glow", "iced_glutin"]
3232
# Enables using system fonts
3333
default_system_font = ["iced_wgpu?/default_system_font", "iced_glow?/default_system_font"]
3434
# Enables a debug view in native platforms (press F12)

src/wayland/mod.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,26 @@ pub trait Application: Sized {
144144
..crate::renderer::Settings::from_env()
145145
};
146146

147-
Ok(crate::runtime::run::<
148-
Instance<Self>,
149-
Self::Executor,
150-
crate::renderer::window::Compositor<Self::Theme>,
151-
>(settings.into(), renderer_settings)?)
147+
#[cfg(feature = "glow")]
148+
{
149+
let renderer_settings = iced_glutin::Settings {
150+
gl_settings: renderer_settings,
151+
try_opengles_first: settings.try_opengles_first
152+
};
153+
Ok(crate::runtime::run::<
154+
Instance<Self>,
155+
Self::Executor,
156+
iced_glutin::Compositor<crate::renderer::window::Compositor<Self::Theme>>,
157+
>(settings.into(), renderer_settings)?)
158+
}
159+
#[cfg(not(feature = "glow"))]
160+
{
161+
Ok(crate::runtime::run::<
162+
Instance<Self>,
163+
Self::Executor,
164+
crate::renderer::window::Compositor<Self::Theme>,
165+
>(settings.into(), renderer_settings)?)
166+
}
152167
}
153168
}
154169

0 commit comments

Comments
 (0)