diff --git a/Cargo.lock b/Cargo.lock index d3672bdc..826e5440 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,12 +347,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "either" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "emigui" +name = "egui" version = "0.1.0" dependencies = [ "ahash 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -364,22 +359,22 @@ dependencies = [ ] [[package]] -name = "emigui_glium" +name = "egui_glium" version = "0.1.0" dependencies = [ "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "clipboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "emigui 0.1.0", + "egui 0.1.0", "glium 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.53 (registry+https://github.com/rust-lang/crates.io-index)", "webbrowser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "emigui_wasm" +name = "egui_wasm" version = "0.1.0" dependencies = [ - "emigui 0.1.0", + "egui 0.1.0", "js-sys 0.3.39 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.53 (registry+https://github.com/rust-lang/crates.io-index)", @@ -387,12 +382,17 @@ dependencies = [ "web-sys 0.3.39 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "example_glium" version = "0.1.0" dependencies = [ - "emigui 0.1.0", - "emigui_glium 0.1.0", + "egui 0.1.0", + "egui_glium 0.1.0", "glium 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", @@ -403,8 +403,8 @@ dependencies = [ name = "example_wasm" version = "0.1.0" dependencies = [ - "emigui 0.1.0", - "emigui_wasm 0.1.0", + "egui 0.1.0", + "egui_wasm 0.1.0", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.53 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 280ba159..c51c0bf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ - "emigui", - "emigui_glium", - "emigui_wasm", + "egui", + "egui_glium", + "egui_wasm", "example_glium", "example_wasm", ] diff --git a/README.md b/README.md index 96c8931d..2b82f51f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# Emigui -(Experimental, Modularized Immediate mode Graphical User Interface) - -An immediate mode GUI library written in Rust. For web apps or native apps. +# Egui +An immediate mode GUI library written in Rust. Works anywhere you can draw textured triangles. ## Goals: * Lightweight @@ -18,22 +16,21 @@ Loop: * Render with e.g. OpenGL ## Available backends: -Wherever you can render textured triangles you can use Emigui. +Wherever you can render textured triangles you can use Egui. -Currently two backends have been tested: -* WebAssembly (emigui_wasm) for making a web app +* WebAssembly (`egui_wasm`) 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) The same application code can thus be compiled to either into a native app or a web app. ## Demos -[Emigui feature demo](https://emilk.github.io/emigui/index.html), (partial) source: https://github.com/emilk/emigui/blob/master/emigui/src/examples/app.rs +[Egui feature demo](https://emilk.github.io/emigui/index.html), (partial) source: https://github.com/emilk/emigui/blob/master/egui/src/examples/app.rs -[Hobogo: A small game using Emigui](https://emilk.github.io/hobogo/index.html), source: https://github.com/emilk/hobogo +[Hobogo: A small game using Egui](https://emilk.github.io/hobogo/index.html), source: https://github.com/emilk/hobogo ## State -Mostly a tech demo at this point. I hope to find time to work more on this in the future. +Alpha state. It works, but is somewhat incomplete. Features: @@ -55,6 +52,11 @@ Features: ## Inspiration The one and only [Dear ImGui](https://github.com/ocornut/imgui) is a great Immediate Mode GUI for C++ which works with many backends. That library revolutionized how I think about GUI code from something I hated to do to something I now like to do. +## Name +The name of the gui library is "Egui", written like that in text and as `egui` in code and pronounced as "e-gooey". + +The library used to be called `Emigui`, which is why it is still hosted at [github.com/emilk/emigui](https://github.com/emilk/emigui). If you like, `emigui` is the collection of helper crates that surrounds `egui`, while `egui` is the actual GUI library. + ## Credits / Licenses Fonts: * Comfortaa: Open Font License, see OFT.txt diff --git a/docs/example_wasm.js b/docs/example_wasm.js index 760eedda..7ae25ea1 100644 --- a/docs/example_wasm.js +++ b/docs/example_wasm.js @@ -195,13 +195,13 @@ function _assertClass(instance, klass) { } /** * @param {State} state -* @param {string} raw_input_json +* @param {string} web_input_json * @returns {string} */ -__exports.run_gui = function(state, raw_input_json) { +__exports.run_gui = function(state, web_input_json) { try { _assertClass(state, State); - var ptr0 = passStringToWasm0(raw_input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var ptr0 = passStringToWasm0(web_input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.run_gui(8, state.ptr, ptr0, len0); var r0 = getInt32Memory0()[8 / 4 + 0]; @@ -479,14 +479,18 @@ async function init(input) { imports.wbg.__wbg_setItem_535f63295c5e7cec = handleError(function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); }); - imports.wbg.__wbg_newnoargs_8aad4a6554f38345 = function(arg0, arg1) { - var ret = new Function(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }; imports.wbg.__wbg_call_1f85aaa5836dfb23 = handleError(function(arg0, arg1) { var ret = getObject(arg0).call(getObject(arg1)); return addHeapObject(ret); }); + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + var ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newnoargs_8aad4a6554f38345 = function(arg0, arg1) { + var ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; imports.wbg.__wbg_self_c0d3a5923e013647 = handleError(function() { var ret = self.self; return addHeapObject(ret); @@ -543,10 +547,6 @@ async function init(input) { var ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - var ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbg_instanceof_Memory_ce2336191e545514 = function(arg0) { var ret = getObject(arg0) instanceof WebAssembly.Memory; return ret; diff --git a/docs/example_wasm_bg.wasm b/docs/example_wasm_bg.wasm index 2f8a126c..26385950 100644 Binary files a/docs/example_wasm_bg.wasm and b/docs/example_wasm_bg.wasm differ diff --git a/docs/index.html b/docs/index.html index b540c829..18fab35f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@
-