1
0
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:
Emil Ernerfeldt
2020-09-16 08:03:40 +02:00
committed by GitHub
parent 0ea80ae10a
commit 5856cded95
8 changed files with 67 additions and 63 deletions

View File

@@ -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);
}