mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 15:20:05 -04:00
Add new crate eframe which wraps egui, epi, egui_web and egui_glium
This commit is contained in:
@@ -9,17 +9,6 @@ edition = "2018"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
egui = { version = "0.6.0", path = "../egui", features = ["serde"] }
|
||||
egui_demo_lib = { path = "../egui_demo_lib" }
|
||||
epi = { version = "0.6.0", path = "../epi", features = ["serde", "serde_json"] }
|
||||
eframe = { version = "0.6.0", path = "../eframe"}
|
||||
egui_demo_lib = { version = "0.6.0", path = "../egui_demo_lib"}
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
# For compiling natively:
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
egui_glium = { path = "../egui_glium" }
|
||||
|
||||
# For compiling to web:
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
egui_web = { path = "../egui_web" }
|
||||
js-sys = "0.3"
|
||||
wasm-bindgen = "0.2"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#![warn(clippy::all)]
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
use eframe::wasm_bindgen::{self, prelude::*};
|
||||
|
||||
/// This is the entry-point for all the web-assembly.
|
||||
/// This is called once from the HTML.
|
||||
@@ -13,6 +13,5 @@ use wasm_bindgen::prelude::*;
|
||||
#[wasm_bindgen]
|
||||
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
||||
let app = egui_demo_lib::DemoApp::default();
|
||||
egui_web::start(canvas_id, Box::new(app))?;
|
||||
Ok(())
|
||||
eframe::start_web(canvas_id, Box::new(app))
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
// When compiling natively:
|
||||
fn main() {
|
||||
let app = egui_demo_lib::DemoApp::default();
|
||||
egui_glium::run(Box::new(app));
|
||||
eframe::run_native(Box::new(app));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user