diff --git a/Cargo.lock b/Cargo.lock index 09fbe77a..815fdca7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,15 +619,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "example_glium" -version = "0.1.0" -dependencies = [ - "egui", - "egui_glium", - "serde", -] - [[package]] name = "example_web" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 7fc2f767..8c5c44d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ members = [ "egui_glium", "egui_web", "egui", - "example_glium", "example_web", ] diff --git a/example_glium/.gitignore b/example_glium/.gitignore deleted file mode 100644 index 0cb09d2b..00000000 --- a/example_glium/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.egui_example_glium.json diff --git a/example_glium/Cargo.toml b/example_glium/Cargo.toml deleted file mode 100644 index a989b6ac..00000000 --- a/example_glium/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "example_glium" -version = "0.1.0" -authors = ["Emil Ernerfeldt "] -license = "MIT OR Apache-2.0" -edition = "2018" - -[dependencies] -egui = { path = "../egui" } -egui_glium = { path = "../egui_glium" } -serde = { version = "1", features = ["derive"] } diff --git a/example_glium/src/example_app.rs b/example_glium/src/example_app.rs deleted file mode 100644 index 7d22b4eb..00000000 --- a/example_glium/src/example_app.rs +++ /dev/null @@ -1,55 +0,0 @@ -/// We derive Deserialize/Serialize so we can persist app state on shutdown. -#[derive(serde::Deserialize, serde::Serialize)] -pub struct ExampleApp { - name: String, - age: u32, -} - -impl Default for ExampleApp { - fn default() -> Self { - Self { - name: "Arthur".to_owned(), - age: 42, - } - } -} - -impl egui::app::App for ExampleApp { - fn name(&self) -> &str { - "Egui Example" - } - - /// Called each time the UI needs repainting, which may be many times per second. - /// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`. - fn ui(&mut self, ctx: &egui::CtxRef, integration_context: &mut egui::app::IntegrationContext) { - let ExampleApp { name, age } = self; - - // Example used in `README.md`. - egui::CentralPanel::default().show(ctx, |ui| { - ui.heading("My Egui Application"); - - ui.horizontal(|ui| { - ui.label("Your name: "); - ui.text_edit_singleline(name); - }); - - ui.add(egui::Slider::u32(age, 0..=120).text("age")); - if ui.button("Click each year").clicked { - *age += 1; - } - - ui.label(format!("Hello '{}', age {}", name, age)); - - ui.advance_cursor(16.0); - if ui.button("Quit").clicked { - integration_context.output.quit = true; - } - }); - - integration_context.output.window_size = Some(ctx.used_size()); // resize the window to be just the size we need it to be - } - - fn on_exit(&mut self, storage: &mut dyn egui::app::Storage) { - egui::app::set_value(storage, egui::app::APP_KEY, self); - } -} diff --git a/example_glium/src/main.rs b/example_glium/src/main.rs deleted file mode 100644 index e94c9f28..00000000 --- a/example_glium/src/main.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! Example of how to use Egui -#![forbid(unsafe_code)] -#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds -#![warn(clippy::all)] - -mod example_app; -use example_app::ExampleApp; - -fn main() { - // Persist app state to file: - let storage = egui_glium::storage::FileStorage::from_path(".egui_example_glium.json"); - - // Alternative: store nowhere - // let storage = egui::app::DummyStorage::default(); - - // Restore `example_app` from file, or create new `ExampleApp`: - let app: ExampleApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default(); - - egui_glium::run(Box::new(storage), Box::new(app)); -}