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:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user