mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Update docs to reflect that wgpu is the default renderer (#7719)
I missed a few parts when merging * https://github.com/emilk/egui/pull/7615
This commit is contained in:
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@@ -89,7 +89,7 @@ jobs:
|
|||||||
run: cargo clippy -p egui_demo_app --lib --target wasm32-unknown-unknown --all-features
|
run: cargo clippy -p egui_demo_app --lib --target wasm32-unknown-unknown --all-features
|
||||||
|
|
||||||
- name: clippy wasm32 eframe
|
- name: clippy wasm32 eframe
|
||||||
run: cargo clippy -p eframe --lib --no-default-features --features glow,persistence --target wasm32-unknown-unknown
|
run: cargo clippy -p eframe --lib --no-default-features --features wgpu,persistence --target wasm32-unknown-unknown
|
||||||
|
|
||||||
- name: wasm-bindgen
|
- name: wasm-bindgen
|
||||||
uses: jetli/wasm-bindgen-action@v0.1.0
|
uses: jetli/wasm-bindgen-action@v0.1.0
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Also see [`CONTRIBUTING.md`](CONTRIBUTING.md) for what to do before opening a PR
|
|||||||
|
|
||||||
|
|
||||||
## Crate overview
|
## Crate overview
|
||||||
The crates in this repository are: `egui, emath, epaint, epaint_default_fonts, egui_extras, egui-winit, egui_glow, egui_demo_lib, egui_demo_app`.
|
The crates in this repository are: `egui, emath, epaint, epaint_default_fonts, egui_extras, egui-winit, egui_glow, egui-wgpu, egui_demo_lib, egui_demo_app`.
|
||||||
|
|
||||||
### `egui`: The main GUI library.
|
### `egui`: The main GUI library.
|
||||||
Example code: `if ui.button("Click me").clicked() { … }`
|
Example code: `if ui.button("Click me").clicked() { … }`
|
||||||
@@ -37,6 +37,9 @@ The library translates winit events to egui, handled copy/paste, updates the cur
|
|||||||
### `egui_glow`
|
### `egui_glow`
|
||||||
Puts an egui app inside a native window on your laptop. Paints the triangles that egui outputs using [glow](https://github.com/grovesNL/glow).
|
Puts an egui app inside a native window on your laptop. Paints the triangles that egui outputs using [glow](https://github.com/grovesNL/glow).
|
||||||
|
|
||||||
|
### `egui-wgpu`
|
||||||
|
Paints the triangles that egui outputs using [wgpu](https://github.com/grovesNL/wgpu).
|
||||||
|
|
||||||
### `eframe`
|
### `eframe`
|
||||||
`eframe` is the official `egui` framework, built so you can compile the same app for either web or native.
|
`eframe` is the official `egui` framework, built so you can compile the same app for either web or native.
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ If you have questions, use [GitHub Discussions](https://github.com/emilk/egui/di
|
|||||||
|
|
||||||
To test the demo app locally, run `cargo run --release -p egui_demo_app`.
|
To test the demo app locally, run `cargo run --release -p egui_demo_app`.
|
||||||
|
|
||||||
The native backend is [`egui_glow`](https://github.com/emilk/egui/tree/main/crates/egui_glow) (using [`glow`](https://crates.io/crates/glow)) and should work out-of-the-box on Mac and Windows, but on Linux you need to first run:
|
The native backend is [`egui-wgpu`](https://github.com/emilk/egui/tree/main/crates/egui-wgpu) (using [`wgpu`](https://crates.io/crates/wgpu)) and should work out-of-the-box on Mac and Windows, but on Linux you need to first run:
|
||||||
|
|
||||||
`sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev`
|
`sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev`
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ For how to use `egui`, see [the egui docs](https://docs.rs/egui).
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
`eframe` uses [`egui_glow`](https://github.com/emilk/egui/tree/main/crates/egui_glow) for rendering, and on native it uses [`egui-winit`](https://github.com/emilk/egui/tree/main/crates/egui-winit).
|
`eframe` defaults to using [wgpu](https://crates.io/crates/wgpu) for rendering (with an option to change to [glow](https://crates.io/crates/glow)), and on native it uses [`egui-winit`](https://github.com/emilk/egui/tree/main/crates/egui-winit).
|
||||||
|
|
||||||
To use on Linux, first run:
|
To use on Linux, first run:
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev lib
|
|||||||
|
|
||||||
You need to either use `edition = "2024"`, or set `resolver = "2"` in the `[workspace]` section of your to-level `Cargo.toml`. See [this link](https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html) for more info.
|
You need to either use `edition = "2024"`, or set `resolver = "2"` in the `[workspace]` section of your to-level `Cargo.toml`. See [this link](https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html) for more info.
|
||||||
|
|
||||||
You can opt-in to the using [`egui-wgpu`](https://github.com/emilk/egui/tree/main/crates/egui-wgpu) for rendering by enabling the `wgpu` feature and setting `NativeOptions::renderer` to `Renderer::Wgpu`.
|
You can opt-in to the using [`egui_glow`](https://github.com/emilk/egui/tree/main/crates/egui_glow) for rendering by enabling the `glow` feature and setting `NativeOptions::renderer` to `Renderer::Glow`.
|
||||||
|
|
||||||
## Alternatives
|
## Alternatives
|
||||||
`eframe` is not the only way to write an app using `egui`! You can also try [`egui-miniquad`](https://github.com/not-fl3/egui-miniquad), [`bevy_egui`](https://github.com/mvlabat/bevy_egui), [`egui_sdl2_gl`](https://github.com/ArjunNair/egui_sdl2_gl), and others.
|
`eframe` is not the only way to write an app using `egui`! You can also try [`egui-miniquad`](https://github.com/not-fl3/egui-miniquad), [`bevy_egui`](https://github.com/mvlabat/bevy_egui), [`egui_sdl2_gl`](https://github.com/ArjunNair/egui_sdl2_gl), and others.
|
||||||
@@ -35,7 +35,7 @@ You can also use `egui_glow` and [`winit`](https://github.com/rust-windowing/win
|
|||||||
|
|
||||||
|
|
||||||
## Limitations when running egui on the web
|
## Limitations when running egui on the web
|
||||||
`eframe` uses WebGL (via [`glow`](https://crates.io/crates/glow)) and Wasm, and almost nothing else from the web tech stack. This has some benefits, but also produces some challenges and serious downsides.
|
`eframe` and egui compiles to Wasm using either WebGPU (when available) or WebGL2 for rendering, and almost nothing else from the web tech stack. This has some benefits, but also produces some challenges and serious downsides.
|
||||||
|
|
||||||
* Rendering: Getting pixel-perfect rendering right on the web is very difficult.
|
* Rendering: Getting pixel-perfect rendering right on the web is very difficult.
|
||||||
* Search: you cannot search an egui web page like you would a normal web page.
|
* Search: you cannot search an egui web page like you would a normal web page.
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CRATE_NAME="egui_demo_app"
|
CRATE_NAME="egui_demo_app"
|
||||||
FEATURES="glow,http,persistence"
|
FEATURES="wgpu,http,persistence"
|
||||||
|
|
||||||
echo "Building rust…"
|
echo "Building rust…"
|
||||||
BUILD=debug # debug builds are faster
|
BUILD=debug # debug builds are faster
|
||||||
|
|||||||
Reference in New Issue
Block a user