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]]
|
[[package]]
|
||||||
name = "egui_wasm"
|
name = "egui_web"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"egui 0.1.2",
|
"egui 0.1.2",
|
||||||
|
@ -418,7 +418,7 @@ name = "example_wasm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"egui 0.1.2",
|
"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 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)",
|
"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)",
|
"wasm-bindgen 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
members = [
|
members = [
|
||||||
"egui",
|
"egui",
|
||||||
"egui_glium",
|
"egui_glium",
|
||||||
"egui_wasm",
|
"egui_web",
|
||||||
"example_glium",
|
"example_glium",
|
||||||
"example_wasm",
|
"example_wasm",
|
||||||
]
|
]
|
||||||
|
|
|
@ -23,7 +23,7 @@ Loop:
|
||||||
## Available backends:
|
## Available backends:
|
||||||
Wherever you can render textured triangles you can use Egui.
|
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).
|
* [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)
|
* [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]
|
[package]
|
||||||
name = "egui_wasm"
|
name = "egui_web"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
|
@ -14,4 +14,4 @@ serde_json = "1"
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
|
|
||||||
egui = { path = "../egui" }
|
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,
|
color::srgba, examples::ExampleApp, label, widgets::Separator, Align, RawInput, TextStyle,
|
||||||
*,
|
*,
|
||||||
},
|
},
|
||||||
egui_wasm::now_sec,
|
egui_web::now_sec,
|
||||||
};
|
};
|
||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
@ -32,7 +32,7 @@ pub struct Web {
|
||||||
pub struct State {
|
pub struct State {
|
||||||
example_app: ExampleApp,
|
example_app: ExampleApp,
|
||||||
ctx: Arc<Context>,
|
ctx: Arc<Context>,
|
||||||
webgl_painter: egui_wasm::webgl::Painter,
|
webgl_painter: egui_web::webgl::Painter,
|
||||||
|
|
||||||
frame_times: egui::MovementTracker<f32>,
|
frame_times: egui::MovementTracker<f32>,
|
||||||
}
|
}
|
||||||
|
@ -40,11 +40,11 @@ pub struct State {
|
||||||
impl State {
|
impl State {
|
||||||
fn new(canvas_id: &str) -> Result<State, JsValue> {
|
fn new(canvas_id: &str) -> Result<State, JsValue> {
|
||||||
let ctx = Context::new();
|
let ctx = Context::new();
|
||||||
egui_wasm::load_memory(&ctx);
|
egui_web::load_memory(&ctx);
|
||||||
Ok(State {
|
Ok(State {
|
||||||
example_app: Default::default(),
|
example_app: Default::default(),
|
||||||
ctx,
|
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),
|
frame_times: egui::MovementTracker::new(1000, 1.0),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ impl State {
|
||||||
self.ctx.pixels_per_point(),
|
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)
|
Ok(output)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue