Skip to content

Commit

Permalink
fix examples and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
coderedart committed Mar 24, 2024
1 parent 76c251d commit d313d8a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 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 @@ egui = { version = "0.26", default-features = false }
bytemuck = { version = "1", default-features = false }
tracing = { version = "0.1", default-features = false }
raw-window-handle = { version = "0.6" }
egui_overlay = { version = "0.8", path = "." }
egui_overlay = { version = "0.8", path = ".", default-features = false}
egui_render_three_d = { version = "0.8", path = "crates/egui_render_three_d" }
egui_render_wgpu = { version = "0.8", path = "crates/egui_render_wgpu" }
egui_window_glfw_passthrough = { version = "0.8", path = "crates/egui_window_glfw_passthrough" }
Expand Down
7 changes: 4 additions & 3 deletions examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ description = "A basic example that shows how we can use egui_overlay crate"
publish = false

[features]
three_d = ["dep:egui_render_three_d"]
wgpu = ["dep:egui_render_wgpu"]
default = ["three_d"]
three_d = ["dep:egui_render_three_d", "egui_overlay/three_d"]
wgpu = ["dep:egui_render_wgpu", "egui_overlay/wgpu"]

[dependencies]
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
egui = { workspace = true }
egui_overlay = { workspace = true }
egui_overlay = { workspace = true, default-features = false, features = ["egui_default", "glfw_default"]}
egui_window_glfw_passthrough = { workspace = true }
egui_render_three_d = { workspace = true, optional = true }
egui_render_wgpu = { workspace = true, optional = true }
10 changes: 7 additions & 3 deletions examples/icon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ description = "shows how we can set a window icon"
publish = false

[features]
three_d = ["dep:egui_render_three_d"]
wgpu = ["dep:egui_render_wgpu"]
default = ["three_d"]
three_d = ["dep:egui_render_three_d", "egui_overlay/three_d"]
wgpu = ["dep:egui_render_wgpu", "egui_overlay/wgpu"]

[dependencies]
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
egui = { workspace = true }
egui_overlay = { workspace = true }
egui_overlay = { workspace = true, default-features = false, features = [
"egui_default",
"glfw_default",
] }
egui_window_glfw_passthrough = { workspace = true, features = ["image"] }
egui_render_three_d = { workspace = true, optional = true }
egui_render_wgpu = { workspace = true, optional = true }
Expand Down
7 changes: 3 additions & 4 deletions examples/icon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ impl EguiOverlay for HelloWorld {
let icon = image::load_from_memory(ICON_BYTES).unwrap().to_rgba8();
{
// if you enable `image` feature of glfw-passthrough crate, you can just use this
glfw_backend.window.set_icon(vec![icon]);
// glfw_backend.window.set_icon(vec![icon]);

// alternative api if you have raw pixels, or don't want to enable image feature of glfw (maybe it pulls an older version of image crate or some other reason)
/*
// alternative api
// useful when you don't want to enable image feature of glfw (maybe it pulls an older version of image crate leading to duplicate image crates in your dependency tree)
let pixels = icon
.pixels()
.map(|pixel| u32::from_le_bytes(pixel.0))
Expand All @@ -51,7 +51,6 @@ impl EguiOverlay for HelloWorld {
pixels,
};
glfw_backend.window.set_icon_from_pixels(vec![icon]);
*/
}
}
// just some controls to show how you can use glfw_backend
Expand Down

0 comments on commit d313d8a

Please sign in to comment.