2020-08-21 16:53:43 +00:00
|
|
|
//! Example of how to use Egui
|
2020-11-17 22:24:14 +00:00
|
|
|
#![forbid(unsafe_code)]
|
2020-08-05 17:45:39 +00:00
|
|
|
#![deny(warnings)]
|
|
|
|
#![warn(clippy::all)]
|
|
|
|
|
2020-11-17 22:24:14 +00:00
|
|
|
mod example_app;
|
|
|
|
use example_app::ExampleApp;
|
2020-07-22 16:01:27 +00:00
|
|
|
|
2019-03-12 21:59:55 +00:00
|
|
|
fn main() {
|
2020-07-23 10:01:48 +00:00
|
|
|
let title = "My Egui Window";
|
2020-10-19 18:25:05 +00:00
|
|
|
|
|
|
|
// Persist app state to file:
|
2020-12-10 17:35:48 +00:00
|
|
|
let storage = egui_glium::storage::FileStorage::from_path(".egui_example_glium.json");
|
2020-10-19 18:25:05 +00:00
|
|
|
|
|
|
|
// Alternative: store nowhere
|
|
|
|
// let storage = egui::app::DummyStorage::default();
|
|
|
|
|
2020-11-17 22:24:14 +00:00
|
|
|
// Restore `example_app` from file, or create new `ExampleApp`:
|
|
|
|
let app: ExampleApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default();
|
|
|
|
|
2020-10-19 18:25:05 +00:00
|
|
|
egui_glium::run(title, Box::new(storage), app);
|
2020-05-17 10:26:17 +00:00
|
|
|
}
|