1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -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

@@ -6,7 +6,7 @@ use wasm_bindgen::prelude::*;
/// This is the entry-point for all the web-assembly.
#[wasm_bindgen]
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
let backend = egui_web::WebBackend::new(canvas_id, egui_web::RunMode::Reactive)?;
let backend = egui_web::WebBackend::new(canvas_id)?;
let app = Box::new(egui::DemoApp::default());
let runner = egui_web::AppRunner::new(backend, app)?;
egui_web::run(runner)?;