diff options
| author | 2021-11-10 19:20:16 -0300 | |
|---|---|---|
| committer | 2022-01-19 17:40:17 -0300 | |
| commit | 46fb27b104fda99640cca625934ababeca8fd19a (patch) | |
| tree | 4907fd2020c169f2d57de9ba72e4074e87939707 | |
| parent | 01f67a2c1f36a90e45f0ff21266bc41152f0c8d5 (diff) | |
| download | iced-46fb27b104fda99640cca625934ababeca8fd19a.tar.gz iced-46fb27b104fda99640cca625934ababeca8fd19a.tar.bz2 iced-46fb27b104fda99640cca625934ababeca8fd19a.zip | |
Update documentation for built-in renderers
| -rw-r--r-- | ECOSYSTEM.md | 2 | ||||
| -rw-r--r-- | README.md | 35 | ||||
| -rw-r--r-- | docker/README.md | 17 | ||||
| -rw-r--r-- | glow/README.md | 51 | 
4 files changed, 102 insertions, 3 deletions
| diff --git a/ECOSYSTEM.md b/ECOSYSTEM.md index 82303130..fb0bd56d 100644 --- a/ECOSYSTEM.md +++ b/ECOSYSTEM.md @@ -45,7 +45,7 @@ The widgets of a _graphical_ user interface produce some primitives that eventua  Currently, there are two different official renderers:  - [`iced_wgpu`] is powered by [`wgpu`] and supports Vulkan, DirectX 12, and Metal. -- [`iced_glow`] is powered by [`glow`] and supports OpenGL 3.3+. +- [`iced_glow`] is powered by [`glow`] and supports OpenGL 2.1+ and OpenGL ES 2.0+.  Additionally, the [`iced_graphics`] subcrate contains a bunch of backend-agnostic types that can be leveraged to build renderers. Both of the renderers rely on the graphical foundations provided by this crate. @@ -34,7 +34,9 @@ Inspired by [Elm].    * First-class support for async actions (use futures!)    * [Modular ecosystem] split into reusable parts:      * A [renderer-agnostic native runtime] enabling integration with existing systems -    * A [built-in renderer] supporting Vulkan, Metal, DX11, and DX12 +    * Two [built-in renderers] leveraging [`wgpu`] and [`glow`] +      * [`iced_wgpu`] supporting Vulkan, Metal and DX12 +      * [`iced_glow`] supporting OpenGL 2.1+ and OpenGL ES 2.0+      * A [windowing shell]      * A [web runtime] leveraging the DOM @@ -49,7 +51,10 @@ __iced is currently experimental software.__ [Take a look at the roadmap],  [Modular ecosystem]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md  [renderer-agnostic native runtime]: https://github.com/hecrj/iced/tree/master/native  [`wgpu`]: https://github.com/gfx-rs/wgpu-rs -[built-in renderer]: https://github.com/hecrj/iced/tree/master/wgpu +[`glow`]: https://github.com/grovesNL/glow +[`iced_wgpu`]: https://github.com/hecrj/iced/tree/master/wgpu +[`iced_glow`]: https://github.com/hecrj/iced/tree/master/glow +[built-in renderers]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md#Renderers  [windowing shell]: https://github.com/hecrj/iced/tree/master/winit  [`dodrio`]: https://github.com/fitzgen/dodrio  [web runtime]: https://github.com/hecrj/iced/tree/master/web @@ -195,6 +200,32 @@ end-user-oriented GUI library, while keeping [the ecosystem] modular:  [`ggez`]: https://github.com/ggez/ggez  [the ecosystem]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md +## Common problems + +1. `Error: GraphicsAdapterNotFound` +    +   This occurs when the selected [built-in renderer] is not able to create a context. +    +   Often this will occur while using [`iced_wgpu`] as the renderer without +   supported hardware (needs Vulkan, Metal or DX12). In this case, you could try using the +   [`iced_glow`] renderer: + +   First, check if it works with +   ```console +   $ cargo run --features "iced/glow iced/glow_canvas" --package game_of_life +   ``` + +   and then use it in your project with +   ```toml +   iced = { version = "0.3", default-features = false, features = ["glow"] } +   ``` + +   **NOTE:** Chances are you have hardware that supports at least OpenGL 2.1 or OpenGL ES 2.0, +   but if you don't, right now there's no software fallback, so it means your hardware +   doesn't support Iced. + +[built-in renderer]: https://github.com/hecrj/iced/blob/master/ECOSYSTEM.md#Renderers +  ## Contributing / Feedback  Contributions are greatly appreciated! If you want to contribute, please  read our [contributing guidelines] for more details. diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..cfb4bab1 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,17 @@ +## Build +To use `cross` to compile for Raspberry Pi you first need to build the docker image. +Use these commands to build the images needed. + +**NOTE:** Run these commands inside the `docker` folder. This is needed since `docker` +uses surrounding directories as "context" for building the image, which means it'll +copy the entire `target` directory. + +### Raspberry Pi 2/3/4 (32 bits) +``` +$ docker build -t iced-rs/armv7 -f Dockerfile.armv7-unknown-linux-gnueabihf . +``` + +### Raspberry Pi 3/4 (64 bits) +``` +$ docker build -t iced-rs/aarch64 -f Dockerfile.aarch64-unknown-linux-gnu . +```
\ No newline at end of file diff --git a/glow/README.md b/glow/README.md new file mode 100644 index 00000000..c6b7245e --- /dev/null +++ b/glow/README.md @@ -0,0 +1,51 @@ +# `iced_glow` +[][documentation] +[](https://crates.io/crates/iced_glow) +[](https://github.com/hecrj/iced/blob/master/LICENSE) +[](https://iced.zulipchat.com) + +`iced_glow` is a [`glow`] renderer for [`iced_native`]. This renderer supports OpenGL 3.0+ and OpenGL ES 2.0. + +This is renderer is mostly used as a fallback for hardware that doesn't support [`wgpu`] (Vulkan, Metal or DX12). + +Currently, `iced_glow` supports the following primitives: +- Text, which is rendered using [`glow_glyph`]. No shaping at all. +- Quads or rectangles, with rounded borders and a solid background color. +- Clip areas, useful to implement scrollables or hide overflowing content. +- Meshes of triangles, useful to draw geometry freely. + +<p align="center"> +  <img alt="The native target" src="../docs/graphs/native.png" width="80%"> +</p> + +[documentation]: https://docs.rs/iced_glow +[`iced_native`]: ../native +[`glow`]: https://github.com/grovesNL/glow +[`wgpu`]: https://github.com/gfx-rs/wgpu +[`glow_glyph`]: https://github.com/hecrj/glow_glyph + +## Installation +Add `iced_glow` as a dependency in your `Cargo.toml`: + +```toml +iced_glow = "0.2" +``` + +__Iced moves fast and the `master` branch can contain breaking changes!__ If +you want to learn about a specific release, check out [the release list]. + +[the release list]: https://github.com/hecrj/iced/releases + +## Current limitations + +The current implementation is quite naive, it uses: + +- A different pipeline/shader for each primitive +- A very simplistic layer model: every `Clip` primitive will generate new layers +- _Many_ render passes instead of preparing everything upfront +- A glyph cache that is trimmed incorrectly when there are multiple layers (a [`glyph_brush`] limitation) + +Some of these issues are already being worked on! If you want to help, [get in touch!] + +[get in touch!]: ../CONTRIBUTING.md +[`glyph_brush`]: https://github.com/alexheretic/glyph-brush | 
