1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Rename egui_demo to egui_demo_app to avoid confusion with egui_demo_lib

This commit is contained in:
Emil Ernerfeldt
2020-12-29 17:54:52 +01:00
parent 84414e62a3
commit 6d9cdafbc9
13 changed files with 27 additions and 29 deletions

14
egui_demo_app/Cargo.toml Normal file
View File

@@ -0,0 +1,14 @@
[package]
name = "egui_demo_app"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2018"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
eframe = { version = "0.6.0", path = "../eframe"}
egui_demo_lib = { version = "0.6.0", path = "../egui_demo_lib"}
serde = { version = "1", features = ["derive"] }

17
egui_demo_app/src/lib.rs Normal file
View File

@@ -0,0 +1,17 @@
#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn(clippy::all)]
#[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 = egui_demo_lib::DemoApp::default();
eframe::start_web(canvas_id, Box::new(app))
}

View File

@@ -0,0 +1,9 @@
#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn(clippy::all)]
// When compiling natively:
fn main() {
let app = egui_demo_lib::DemoApp::default();
eframe::run_native(Box::new(app));
}