Browse Source

rename egui_wasm to egui_web

pull/9/head
Emil Ernerfeldt 4 years ago
parent
commit
8dced5896c
  1. 4
      Cargo.lock
  2. 2
      Cargo.toml
  3. 2
      README.md
  4. 0
      build_web.sh
  5. 2
      egui_web/Cargo.toml
  6. 0
      egui_web/src/lib.rs
  7. 0
      egui_web/src/webgl.rs
  8. 2
      example_wasm/Cargo.toml
  9. 10
      example_wasm/src/lib.rs

4
Cargo.lock

@ -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
Cargo.toml

@ -2,7 +2,7 @@
members = [
"egui",
"egui_glium",
"egui_wasm",
"egui_web",
"example_glium",
"example_wasm",
]

2
README.md

@ -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)

0
build_wasm.sh → build_web.sh

2
egui_wasm/Cargo.toml → egui_web/Cargo.toml

@ -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"

0
egui_wasm/src/lib.rs → egui_web/src/lib.rs

0
egui_wasm/src/webgl.rs → egui_web/src/webgl.rs

2
example_wasm/Cargo.toml

@ -14,4 +14,4 @@ serde_json = "1"
wasm-bindgen = "0.2"
egui = { path = "../egui" }
egui_wasm = { path = "../egui_wasm" }
egui_web = { path = "../egui_web" }

10
example_wasm/src/lib.rs

@ -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…
Cancel
Save