Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update egui, xkbcommon, image #19

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ license = "MIT"

[dependencies]
cgmath = "0.18"
egui = "0.29"
egui_glow = "0.29"
egui_extras = { version = "0.29", optional = true }
img = { version = "0.24", default-features = false, optional = true, package = "image" }
egui = "0.30"
egui_glow = "0.30"
egui_extras = { version = "0.30", optional = true }
img = { version = "0.25", default-features = false, optional = true, package = "image" }
memoffset = "0.9"
lazy_static = { version = "1.4.0", optional = true }
log = "0.4"
xkbcommon = "0.7"
xkbcommon = "0.8"

[dependencies.smithay]
version = "0.3"
git = "https://github.com/Smithay/smithay.git"
rev = "3b0ecce"
rev = "fe31867"
default-features = false
features = ["renderer_glow", "wayland_frontend"]

Expand All @@ -34,12 +34,12 @@ jpg = ["image", "egui_extras/image", "img/jpeg"]

[dev-dependencies]
anyhow = "1.0"
egui_demo_lib = "0.29"
egui_demo_lib = "0.30"
tracing-subscriber = "0.3"

[dev-dependencies.smithay]
version = "0.3"
git = "https://github.com/Smithay/smithay.git"
rev = "3b0ecce"
rev = "fe31867"
default-features = false
features = ["backend_winit"]
14 changes: 4 additions & 10 deletions examples/integrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ fn main() -> Result<()> {
let (mut backend, mut input) =
winit::init::<GlowRenderer>().map_err(|_| anyhow::anyhow!("Winit failed to start"))?;
// create an `EguiState`. Usually this would be part of your global smithay state
let egui = EguiState::new(Rectangle::from_loc_and_size(
(0, 0),
backend.window_size().to_logical(1),
));
let egui = EguiState::new(Rectangle::from_size(backend.window_size().to_logical(1)));
// you might also need additional structs to store your ui-state, like the demo_lib does
let mut demo_ui = egui_demo_lib::DemoWindows::default();

Expand Down Expand Up @@ -164,7 +161,7 @@ fn main() -> Result<()> {
|ctx| demo_ui.ui(ctx),
backend.renderer(),
// Just render it over the whole window, but you may limit the area
Rectangle::from_loc_and_size((0, 0), size.to_logical(1)),
Rectangle::from_size(size.to_logical(1)),
// we also completely ignore the scale *everywhere* in this example, but egui is HiDPI-ready
1.0,
1.0,
Expand All @@ -176,16 +173,13 @@ fn main() -> Result<()> {
let renderer = backend.renderer();
{
let mut frame = renderer.render(size, Transform::Flipped180)?;
frame.clear(
[1.0, 1.0, 1.0, 1.0].into(),
&[Rectangle::from_loc_and_size((0, 0), size)],
)?;
frame.clear([1.0, 1.0, 1.0, 1.0].into(), &[Rectangle::from_size(size)])?;
RenderElement::<GlowRenderer>::draw(
&egui_frame,
&mut frame,
egui_frame.src(),
egui_frame.geometry(1.0.into()),
&[Rectangle::from_loc_and_size((0, 0), size)],
&[Rectangle::from_size(size)],
&[],
)?;
}
Expand Down