rename egui_wasm to egui_web
This commit is contained in:
parent
520e42c11c
commit
8dced5896c
9 changed files with 11 additions and 11 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -386,7 +386,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_wasm"
|
||||
name = "egui_web"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"egui 0.1.2",
|
||||
|
@ -418,7 +418,7 @@ name = "example_wasm"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"egui 0.1.2",
|
||||
"egui_wasm 0.1.0",
|
||||
"egui_web 0.1.0",
|
||||
"serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.56 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasm-bindgen 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
members = [
|
||||
"egui",
|
||||
"egui_glium",
|
||||
"egui_wasm",
|
||||
"egui_web",
|
||||
"example_glium",
|
||||
"example_wasm",
|
||||
]
|
||||
|
|
|
@ -23,7 +23,7 @@ Loop:
|
|||
## Available backends:
|
||||
Wherever you can render textured triangles you can use Egui.
|
||||
|
||||
* WebAssembly (`egui_wasm`) for making a web app. [Click to run](https://emilk.github.io/emigui/index.html).
|
||||
* WebAssembly (`egui_web`) for making a web app. [Click to run](https://emilk.github.io/emigui/index.html).
|
||||
* [Glium](https://github.com/glium/glium) for native apps (see example_glium).
|
||||
* [miniquad](https://github.com/not-fl3/emigui-miniquad) [web demo](https://not-fl3.github.io/miniquad-samples/emigui.html) [demo source](https://github.com/not-fl3/good-web-game/blob/master/examples/emigui.rs)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "egui_wasm"
|
||||
name = "egui_web"
|
||||
version = "0.1.0"
|
||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
|
@ -14,4 +14,4 @@ serde_json = "1"
|
|||
wasm-bindgen = "0.2"
|
||||
|
||||
egui = { path = "../egui" }
|
||||
egui_wasm = { path = "../egui_wasm" }
|
||||
egui_web = { path = "../egui_web" }
|
||||
|
|
|
@ -8,7 +8,7 @@ use {
|
|||
color::srgba, examples::ExampleApp, label, widgets::Separator, Align, RawInput, TextStyle,
|
||||
*,
|
||||
},
|
||||
egui_wasm::now_sec,
|
||||
egui_web::now_sec,
|
||||
};
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
@ -32,7 +32,7 @@ pub struct Web {
|
|||
pub struct State {
|
||||
example_app: ExampleApp,
|
||||
ctx: Arc<Context>,
|
||||
webgl_painter: egui_wasm::webgl::Painter,
|
||||
webgl_painter: egui_web::webgl::Painter,
|
||||
|
||||
frame_times: egui::MovementTracker<f32>,
|
||||
}
|
||||
|
@ -40,11 +40,11 @@ pub struct State {
|
|||
impl State {
|
||||
fn new(canvas_id: &str) -> Result<State, JsValue> {
|
||||
let ctx = Context::new();
|
||||
egui_wasm::load_memory(&ctx);
|
||||
egui_web::load_memory(&ctx);
|
||||
Ok(State {
|
||||
example_app: Default::default(),
|
||||
ctx,
|
||||
webgl_painter: egui_wasm::webgl::Painter::new(canvas_id)?,
|
||||
webgl_painter: egui_web::webgl::Painter::new(canvas_id)?,
|
||||
frame_times: egui::MovementTracker::new(1000, 1.0),
|
||||
})
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ impl State {
|
|||
self.ctx.pixels_per_point(),
|
||||
)?;
|
||||
|
||||
egui_wasm::save_memory(&self.ctx); // TODO: don't save every frame
|
||||
egui_web::save_memory(&self.ctx); // TODO: don't save every frame
|
||||
|
||||
Ok(output)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue