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

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));
}