mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
refactor RunMode: move it from backend to the demo App (#23)
This simplifies the egui_glium and egui_web backends substantially, reduces the scope of RunMode to a single file, and removes duplicated code. Basically: this is how I should have written it from the beginning.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#![deny(warnings)]
|
||||
#![warn(clippy::all)]
|
||||
|
||||
use egui_glium::{storage::FileStorage, RunMode};
|
||||
use egui_glium::storage::FileStorage;
|
||||
|
||||
fn main() {
|
||||
let title = "Egui glium demo";
|
||||
let storage = FileStorage::from_path(".egui_demo_glium.json".into());
|
||||
let app: egui::DemoApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default();
|
||||
egui_glium::run(title, RunMode::Reactive, storage, app);
|
||||
egui_glium::run(title, storage, app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user