diff --git a/Cargo.toml b/Cargo.toml index 1de440d..17f596c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/examples/basic/Cargo.toml b/examples/basic/Cargo.toml index 9677f7a..f4721c1 100644 --- a/examples/basic/Cargo.toml +++ b/examples/basic/Cargo.toml @@ -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 } diff --git a/examples/icon/Cargo.toml b/examples/icon/Cargo.toml index 655b721..f454070 100644 --- a/examples/icon/Cargo.toml +++ b/examples/icon/Cargo.toml @@ -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 } diff --git a/examples/icon/src/main.rs b/examples/icon/src/main.rs index c22cc16..0b59db8 100644 --- a/examples/icon/src/main.rs +++ b/examples/icon/src/main.rs @@ -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)) @@ -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