mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
Add new crate eframe which wraps egui, epi, egui_web and egui_glium
This commit is contained in:
@@ -9,9 +9,8 @@ edition = "2018"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
egui = { path = "../egui", features = ["serde"] }
|
||||
eframe = { path = "../eframe" }
|
||||
egui_web = { path = "../egui_web" }
|
||||
epi = { version = "0.6.0", path = "../epi", features = ["serde", "serde_json"] }
|
||||
image = { version = "0.23", default_features = false, features = ["jpeg", "png"] }
|
||||
js-sys = "0.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use eframe::{egui, epi};
|
||||
use egui_web::fetch::Response;
|
||||
use std::sync::mpsc::Receiver;
|
||||
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
|
||||
mod example_app;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use eframe::wasm_bindgen::{self, prelude::*};
|
||||
|
||||
/// This is the entry-point for all the web-assembly.
|
||||
/// This is called once from the HTML.
|
||||
/// It loads the app, installs some callbacks, then returns.
|
||||
/// You can add more callbacks like this if you want to call in to your code.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[wasm_bindgen]
|
||||
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
||||
let app = example_app::ExampleApp::default();
|
||||
egui_web::start(canvas_id, Box::new(app))?;
|
||||
Ok(())
|
||||
eframe::start_web(canvas_id, Box::new(app))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user