mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
[egui_glium] Add option not to persist app to file
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
#![deny(warnings)]
|
||||
#![warn(clippy::all)]
|
||||
|
||||
use egui_glium::storage::FileStorage;
|
||||
|
||||
fn main() {
|
||||
let title = "Egui glium demo";
|
||||
let storage = FileStorage::from_path(".egui_demo_glium.json".into());
|
||||
|
||||
// Persist app state to file:
|
||||
let storage = egui_glium::storage::FileStorage::from_path(".egui_demo_glium.json".into());
|
||||
|
||||
// Alternative: store nowhere
|
||||
// let storage = egui::app::DummyStorage::default();
|
||||
|
||||
let app: egui::DemoApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default();
|
||||
egui_glium::run(title, storage, app);
|
||||
egui_glium::run(title, Box::new(storage), app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user