Remove example_glium
Look at https://github.com/emilk/egui_template instead
This commit is contained in:
parent
8e9bce459f
commit
2fe1e99218
6 changed files with 0 additions and 97 deletions
9
Cargo.lock
generated
9
Cargo.lock
generated
|
@ -619,15 +619,6 @@ version = "1.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "example_glium"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"egui",
|
|
||||||
"egui_glium",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "example_web"
|
name = "example_web"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
@ -5,7 +5,6 @@ members = [
|
||||||
"egui_glium",
|
"egui_glium",
|
||||||
"egui_web",
|
"egui_web",
|
||||||
"egui",
|
"egui",
|
||||||
"example_glium",
|
|
||||||
"example_web",
|
"example_web",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
1
example_glium/.gitignore
vendored
1
example_glium/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.egui_example_glium.json
|
|
|
@ -1,11 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "example_glium"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
|
||||||
license = "MIT OR Apache-2.0"
|
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
egui = { path = "../egui" }
|
|
||||||
egui_glium = { path = "../egui_glium" }
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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));
|
|
||||||
}
|
|
Loading…
Reference in a new issue