Update READMEs
This commit is contained in:
parent
7fdd7f5952
commit
1788d5d21e
2 changed files with 13 additions and 4 deletions
|
|
@ -87,10 +87,9 @@ __view logic__:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use iced::{Button, Column, Text};
|
use iced::{Button, Column, Text};
|
||||||
use iced_wgpu::Renderer; // Iced does not include a renderer! We need to bring our own!
|
|
||||||
|
|
||||||
impl Counter {
|
impl Counter {
|
||||||
pub fn view(&mut self) -> Column<Message, Renderer> {
|
pub fn view(&mut self) -> Column<Message> {
|
||||||
// We use a column: a simple vertical layout
|
// We use a column: a simple vertical layout
|
||||||
Column::new()
|
Column::new()
|
||||||
.push(
|
.push(
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ __update logic__ and __view logic__.
|
||||||
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
[`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||||
|
|
||||||
#### Running the native version
|
#### Running the native version
|
||||||
Simply use [Cargo](https://doc.rust-lang.org/cargo/reference/manifest.html#examples)
|
Use [Cargo](https://doc.rust-lang.org/cargo/reference/manifest.html#examples)
|
||||||
to run the example:
|
to run the example:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -45,10 +45,20 @@ cargo run --example tour
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Running the web version
|
#### Running the web version
|
||||||
|
Build using the `wasm32-unknown-unknown` target and use the [`wasm-bindgen`] CLI
|
||||||
|
to generate appropriate bindings in a `tour` directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
TODO
|
cd examples
|
||||||
|
cargo build --example tour --target wasm32-unknown-unknown
|
||||||
|
wasm-bindgen ../target/wasm32-unknown-unknown/debug/examples/tour.wasm --out-dir tour --web
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Finally, serve the `examples` directory using an HTTP server, and access the
|
||||||
|
`tour.html` file.
|
||||||
|
|
||||||
|
[`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen
|
||||||
|
|
||||||
|
|
||||||
## [Coffee]
|
## [Coffee]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue