Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Transition graphics backend from vulkano to wgpu #452

Merged
merged 56 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
414fd10
WIP - Transition graphics backend from vulkano to winit
mitchmindtree Feb 16, 2020
25cc306
Update `ui` module for wgpu graphics overhaul. Fix initial window dims.
mitchmindtree Feb 17, 2020
22a22f2
Recreate swap chain and frame render data on Resized event
mitchmindtree Feb 17, 2020
040e976
Update draw.rs module for wgpu graphics overhaul
mitchmindtree Feb 18, 2020
20be540
Clear up some warning. Add shader compilation notes.
mitchmindtree Feb 18, 2020
1ebe5bd
Fix bug where window-specific view functions would not be called
mitchmindtree Feb 20, 2020
c46c054
Add a `SamplerBuilder` type, simplifying `Sampler` creation
mitchmindtree Feb 20, 2020
dc2cdc8
Add new `Texture` and `TextureBuilder` types.
mitchmindtree Feb 21, 2020
e5ce268
Add an inner map tracking active wgpu adapters and devices
mitchmindtree Feb 22, 2020
4fd08af
Run default cargo fmt across repo
mitchmindtree Feb 22, 2020
6125407
Re-add the depth test texture to the Draw API
mitchmindtree Feb 22, 2020
ad0584e
Ensure Draw API depth texture matches output attachment sample count
mitchmindtree Feb 22, 2020
1d1f788
Expose and update methods relevant to the winit 0.19 -> 0.21 update
mitchmindtree Feb 22, 2020
76fa524
Update examples for WindowBuilder::size rename. Run cargo fmt.
mitchmindtree Feb 22, 2020
d157039
Remove use of strong_count in favour of upgrade
mitchmindtree Feb 23, 2020
b1d2def
Fix DPI related issues with app.mouse
mitchmindtree Feb 23, 2020
ea77901
Update vk triangle examples under new examples/wgpu directory
mitchmindtree Feb 23, 2020
cc9280c
Track window DPI state, avoid calling into platform where possible.
mitchmindtree Feb 23, 2020
c535d05
Cargo fmt run
mitchmindtree Feb 23, 2020
d01c0ee
Default HighPerformance power preference. Simplify loop modes.
mitchmindtree Feb 23, 2020
537088a
Insert some extra updates in Wait moe for GUI animations to finish
mitchmindtree Feb 23, 2020
f10b3aa
Address keyboard modifiers state warning
mitchmindtree Feb 23, 2020
d2e0bea
Include the ui and wgpu modules in the prelude
mitchmindtree Feb 24, 2020
b2f8b91
Add wgpu_teapot example to replace old vk_teapot example
mitchmindtree Feb 24, 2020
6330a39
Remove vulkan triangle and teapot examples that have been ported
mitchmindtree Feb 24, 2020
629a472
Port vk_teapot_camera to new wgpu_teapot_camera example
mitchmindtree Feb 24, 2020
51516ad
Add a new wgpu_compute_shader example
mitchmindtree Feb 26, 2020
f07065e
Remove redundant vk_compute_shader example
mitchmindtree Feb 26, 2020
456caf4
Add `wgpu_image.rs` example, replacing `vk_image.rs`
mitchmindtree Feb 26, 2020
4806f53
Add a module for loading images into wgpu textures
mitchmindtree Feb 27, 2020
eb49821
Fix formatting of the wgpu_compute_shader example
mitchmindtree Feb 27, 2020
618ed2c
Simplify wgpu_image example with new constructor. Fix formatting.
mitchmindtree Feb 27, 2020
8d8ef8e
Add API for loading a texture array from sequence of image buffers
mitchmindtree Feb 27, 2020
dfda860
Add wgpu_image_sequence example. Re-organise image assets.
mitchmindtree Feb 27, 2020
a7fd71d
Remove redundant vk_image_sequence example
mitchmindtree Feb 27, 2020
871b21e
wgpu image example formatting
mitchmindtree Feb 27, 2020
18e07dd
Add some missing vertex layout decorations
mitchmindtree Feb 27, 2020
013b5bf
Fix wgpu swapchain texture life time
kvark Feb 28, 2020
f85ad13
Merge pull request #1 from kvark/wgpu
mitchmindtree Feb 28, 2020
276ab6d
Add more details about poll to compute shader example
mitchmindtree Feb 29, 2020
92da8bf
Store and expose texture in frame, not just texture view
mitchmindtree Feb 29, 2020
206479e
All for submission of `Frame` prior to the end of `view`
mitchmindtree Feb 29, 2020
f86bab6
`Texture` reading and `Frame` capture. FormatConverter -> Reshaper.
mitchmindtree Feb 29, 2020
c474b9d
Remove remaining references to vulkan, vulkano and vk
mitchmindtree Mar 2, 2020
306b5e2
Update wgpu module docs
mitchmindtree Mar 2, 2020
ebd8148
Poll all active devices within the App on `RedrawEventsCleared`
mitchmindtree Mar 2, 2020
f035233
Update CHANGELOG for wgpu and winit 0.21 overhaul
mitchmindtree Mar 2, 2020
9c94f05
Don't poll devices on RedrawEventsCleared - causes glitching on macOS
mitchmindtree Mar 2, 2020
8f0239c
Add manual msaa resolve to TextureReshaper. Solves validation error.
mitchmindtree Mar 2, 2020
ebac345
Merge branch 'wgpu_texture_reshaper_msaa' into wgpu
mitchmindtree Mar 2, 2020
d03d647
Add `.size(w, h)` and `.run()` builder methods to `nannou::sketch`
mitchmindtree Mar 2, 2020
1279d2f
Make capture examples sync by default. Add threaded option to capture.
mitchmindtree Mar 2, 2020
be542b5
Remove unnecessary poll in compute example to improve macOS performance
mitchmindtree Mar 3, 2020
1f8f96c
Switch back to crates.io for conrod deps
mitchmindtree Mar 3, 2020
09f7276
Final tweaks to docs and comments following final review
mitchmindtree Mar 3, 2020
8889288
Fix integer underflow panic in game of life wrap around example
mitchmindtree Mar 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
capture_hi_res/
simple_capture/
target/
**/*.rs.bk
Cargo.lock
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Unreleased

- Transition from `vulkano` to `wgpu` for all graphics handling!
- Fixes llooooooooooottss of macOS bugs.
- The `draw` and `ui` APIs now render via wgpu.
- Replace `vk` module with `wgpu` module.
- Replace `examples/vulkan` with `examples/wgpu`.
- Big step towards enabling web target.
- Add `wgpu::TextureBuilder` to simplify texture building process.
- Add `wgpu::TextureReshaper` for writing a texture to another of differing
size, format and sample_count.
- Add `wgpu::TextureCapturer` for reading textures onto CPU as images.
- Update to `winit` 0.21. Another big step towards enabling web target. Also
includes an overhaul of the application loop which should be significantly
simpler.
- Update `view` function API to take `Frame` by value rather than by reference.
For example, rather than:
```rust
fn view(app: &App, model: &Model, frame: &Frame) {}
```
the `view` function signature now must look like:
```rust
fn view(app: &App, model: &Model, frame: Frame) {}
```
This was necessary to enable ergonomic texture capturing.
- `frame.submit()` can now be used to submit the frame to the GPU before the end
of the `view` function.
- `nannou::sketch` now returns a `SketchBuilder`. This allows for specifying the
sketch `.size(w, h)`, but now requires that `.run()` is called (or the sketch
won't do anything!).
- A `.size(w, h)` builder has been added to the `app::Builder` type that allows
for specifying a default window size.
- Add `window.capture_frame(path)` method for capturing the next frame to an
image file at the given file path.
- Add a `simple_capture.rs` example.
- Add a `capture_hi_res.rs` example.
- `sketch`'s now need a call to `.run()` to do anything.
- `sktech`'s now support a `.size(width, height)` builder method for setting
window size.
- The `app::Builder` now also supports a `.size(width, height)` method for
specifying the default window width and height.
- `LoopMode`s have been simplified:
- `Wait` no longer requires `update_following_event` or `update_interval`
- `NTimes` no longer requires `update_interval`
- `Refresh` no longer requires `minimum_update_interval` or `windows`

# Version 0.12.0 (2019-11-03)

- Update vulkano dependencies to 0.16 in order to address `metal` related bug on
Expand Down
74 changes: 29 additions & 45 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ default = ["notosans"]

[dependencies]
cgmath = { version = "0.17", features = ["serde"] }
conrod_core = "0.68"
conrod_winit = "0.68"
conrod_vulkano = "0.68"
conrod_core = "0.69"
conrod_wgpu = "0.69"
conrod_winit = "0.69"
daggy = "0.6"
find_folder = "0.3"
image = "0.22"
image = "0.23"
lyon = "0.14"
noise = "0.6"
notosans = { version = "0.1", optional = true }
Expand All @@ -31,28 +31,27 @@ rusttype = "0.8"
serde = "1"
serde_derive = "1"
serde_json = "1"
threadpool = "1"
toml = "0.5"
vulkano = "0.16"
vulkano-win = "0.16"
vulkano-shaders = "0.16"
walkdir = "2"
winit = "0.19"
wgpu = "0.4"
winit = "0.21"

[dev-dependencies]
audrey = "0.2"
futures = "0.3"
nannou_audio = "0.2"
nannou_laser = "0.3"
nannou_osc = "0.1"
shade_runner = "0.3"

[target.'cfg(target_os = "macos")'.dependencies]
moltenvk_deps = "0.1"

# --------------- Nannou Examples
[[example]]
name = "all_functions"
path = "examples/all_functions.rs"
[[example]]
name = "capture_hi_res"
path = "examples/capture_hi_res.rs"
[[example]]
name = "loop_mode"
path = "examples/loop_mode.rs"
[[example]]
Expand All @@ -74,6 +73,9 @@ path = "examples/simple_audio.rs"
name = "simple_audio_file"
path = "examples/simple_audio_file.rs"
[[example]]
name = "simple_capture"
path = "examples/simple_capture.rs"
[[example]]
name = "simple_draw"
path = "examples/simple_draw.rs"
[[example]]
Expand Down Expand Up @@ -130,46 +132,28 @@ path = "examples/basics/6_functions.rs"
name = "7_modules"
path = "examples/basics/7_modules/7_modules.rs"

# --------------- Vulkan Examples
[[example]]
name = "vk_triangle"
path = "examples/vulkan/vk_triangle.rs"
[[example]]
name = "vk_triangle_raw_frame"
path = "examples/vulkan/vk_triangle_raw_frame.rs"
[[example]]
name = "vk_teapot"
path = "examples/vulkan/vk_teapot.rs"
[[example]]
name = "vk_quad_warp"
path = "examples/vulkan/vk_quad_warp/vk_quad_warp.rs"
[[example]]
name = "vk_teapot_camera"
path = "examples/vulkan/vk_teapot_camera.rs"
[[example]]
name = "vk_image"
path = "examples/vulkan/vk_image.rs"
# --------------- WGPU Examples
[[example]]
name = "vk_images"
path = "examples/vulkan/vk_images.rs"
name = "wgpu_compute_shader"
path = "examples/wgpu/wgpu_compute_shader/wgpu_compute_shader.rs"
[[example]]
name = "vk_image_sequence"
path = "examples/vulkan/vk_image_sequence.rs"
name = "wgpu_image"
path = "examples/wgpu/wgpu_image/wgpu_image.rs"
[[example]]
name = "vk_compute_shader_rendering"
path = "examples/vulkan/vk_compute_shader_rendering.rs"
name = "wgpu_image_sequence"
path = "examples/wgpu/wgpu_image_sequence/wgpu_image_sequence.rs"
[[example]]
name = "vk_compute_shader"
path = "examples/vulkan/vk_compute_shader.rs"
name = "wgpu_teapot"
path = "examples/wgpu/wgpu_teapot/wgpu_teapot.rs"
[[example]]
name = "vk_shader_include"
path = "examples/vulkan/vk_shader_include/mod.rs"
name = "wgpu_teapot_camera"
path = "examples/wgpu/wgpu_teapot_camera/wgpu_teapot_camera.rs"
[[example]]
name = "vk_debug"
path = "examples/vulkan/vk_debug.rs"
name = "wgpu_triangle"
path = "examples/wgpu/wgpu_triangle/wgpu_triangle.rs"
[[example]]
name = "vk_hotload"
path = "examples/vulkan/vk_hotload.rs"
name = "wgpu_triangle_raw_frame"
path = "examples/wgpu/wgpu_triangle_raw_frame/wgpu_triangle_raw_frame.rs"

# --------------- Generative Design
[[example]]
Expand Down
Binary file removed assets/images/Nannou.png
Binary file not shown.
Binary file added assets/images/nannou.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed assets/images/sequence/frame_00_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_01_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_02_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_03_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_04_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_05_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_06_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_07_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_08_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_09_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_10_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_11_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_12_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_13_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_14_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_15_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_16_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_17_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_18_delay-0.1s.png
Binary file not shown.
Binary file removed assets/images/sequence/frame_19_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_20_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_21_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_22_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_23_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_24_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_25_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_26_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_27_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_28_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_29_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_30_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_31_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_32_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_33_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_34_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_35_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_36_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_37_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_38_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_39_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_40_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_41_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_42_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_43_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_44_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_45_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_46_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_47_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_48_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_49_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_50_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_51_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_52_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_53_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_54_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_55_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_56_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_57_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_58_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_59_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_60_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_61_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_62_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_63_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_64_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_65_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_66_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_67_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_68_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_69_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_70_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_71_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_72_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_73_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_74_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_75_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_76_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_77_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_78_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_79_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_80_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_81_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_82_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_83_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_84_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_85_delay-0.1s.png
Diff not rendered.
Binary file removed assets/images/sequence/frame_86_delay-0.1s.png
Diff not rendered.
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
| | | |
| --- |:---:|:---:|
| [<img src="https://i.imgur.com/GP6zlSR.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_draw.rs) simple_draw| [<img src="https://i.imgur.com/ly3Uk3g.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_mesh.rs) simple_mesh | [<img src="https://i.imgur.com/lm4RI4N.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_polyline.rs) simple_polyline | [<img src="https://i.imgur.com/kPn91tW.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_polygon.rs) simple_polygon
| [<img src="https://i.imgur.com/gaiWHZX.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_ui.rs) simple_ui| [<img src="https://imgur.com/GU0cr1w.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/vk_triangle.rs) vk_triangle| [<img src="https://imgur.com/7MdNC7L.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/vk_images.rs) vk_images| [<img src="https://imgur.com/VNaJQPT.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/vk_compute_shader.rs) vk_compute_shader
| [<img src="https://imgur.com/vUt1aFb.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/vk_image_sequence.rs) vk_image_sequence| [<img src="https://imgur.com/NFw36vk.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/vk_image_sequence.rs) vk_teapot | [<img src="https://i.imgur.com/4TtL8kP.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/generative_design/color/p_1_0_01.rs) p_1_0_01 |[<img src="https://imgur.com/fnzIylM.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/generative_design/color/p_1_2_3_02.rs) p_1_2_3_02
| [<img src="https://i.imgur.com/gaiWHZX.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/simple_ui.rs) simple_ui| [<img src="https://imgur.com/GU0cr1w.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/wgpu_triangle.rs) wgpu_triangle| [<img src="https://imgur.com/7MdNC7L.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/wgpu_images.rs) wgpu_images| [<img src="https://imgur.com/VNaJQPT.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/wgpu_compute_shader.rs) wgpu_compute_shader
| [<img src="https://imgur.com/vUt1aFb.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/wgpu_image_sequence.rs) wgpu_image_sequence| [<img src="https://imgur.com/NFw36vk.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/vulkan/wgpu_image_sequence.rs) wgpu_teapot | [<img src="https://i.imgur.com/4TtL8kP.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/generative_design/color/p_1_0_01.rs) p_1_0_01 |[<img src="https://imgur.com/fnzIylM.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/generative_design/color/p_1_2_3_02.rs) p_1_2_3_02
[<img src="https://imgur.com/pByxWWP.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_01_vectors/1_2_bouncingball_vectors_object.rs) 1_2_bouncingball_vectors_object | [<img src="https://imgur.com/Gvari1e.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_01_vectors/1_9_motion101_acceleration.rs) 1_9_motion101_acceleration | [<img src="https://imgur.com/DLxXfNp.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_01_vectors/1_11_motion101_acceleration_array.rs) 1_11_motion101_acceleration_array | [<img src="https://imgur.com/HKNvhbv.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_1_forces.rs) 2_1_forces
| [<img src="https://imgur.com/IBfwRgm.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_2_forces_many.rs) 2_2_forces_many | [<img src="https://imgur.com/MtJYrZC.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_4_forces_friction.rs) 2_4_forces_friction | [<img src="https://imgur.com/qcvsgdO.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_5_fluid_resistance.rs) 2_5_fluid_resistance | [<img src="https://imgur.com/pfdEq7F.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_6_attraction.rs) 2_6_attraction
| [<img src="https://imgur.com/MIsYEOQ.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_7_attraction_many.rs) 2_7_attraction_many | [<img src="https://imgur.com/EQzoWuo.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_8_mutual_attraction.rs) 2_8_mutual_attraction | [<img src="https://imgur.com/DPtlAbL.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_10_exercise_attract_repel.rs) 2_10_exercise_attract_repel | [<img src="https://imgur.com/il1FVb8.gif" width="220" Height="165">](https://github.com/nannou-org/nannou/blob/master/examples/nature_of_code/chp_02_forces/2_forces_many_mutual_boundaries.rs) 2_forces_many_mutual_boundaries
Expand Down
12 changes: 6 additions & 6 deletions examples/all_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Model {}

fn model(app: &App) -> Model {
app.new_window()
.dimensions(720, 720)
.size(720, 720)
.event(window_event)
.raw_event(raw_window_event)
.key_pressed(key_pressed)
Expand Down Expand Up @@ -42,19 +42,19 @@ fn event(_app: &App, _model: &mut Model, event: Event) {
match event {
Event::WindowEvent {
id: _,
raw: _,
//raw: _,
simple: _,
} => {}
Event::DeviceEvent(_device_id, _event) => {}
Event::Update(_dt) => {}
Event::Awakened => {}
Event::Suspended(_b) => {}
Event::Suspended => {}
Event::Resumed => {}
}
}

fn update(_app: &App, _model: &mut Model, _update: Update) {}

fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(SKYBLUE);
}

Expand All @@ -81,7 +81,7 @@ fn window_event(_app: &App, _model: &mut Model, event: WindowEvent) {
}
}

fn raw_window_event(_app: &App, _model: &mut Model, _event: nannou::winit::WindowEvent) {}
fn raw_window_event(_app: &App, _model: &mut Model, _event: &nannou::winit::event::WindowEvent) {}

fn key_pressed(_app: &App, _model: &mut Model, _key: Key) {}

Expand Down
2 changes: 1 addition & 1 deletion examples/basics/1_nannou_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ fn event(_app: &App, _model: &mut Model, event: WindowEvent) {
}

// Put your drawing code, called once per frame, per window.
fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(DIMGRAY);
}
6 changes: 3 additions & 3 deletions examples/basics/2_variables_window_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ fn model(app: &App) -> Model {
println!("c = {}", c);
println!("message = {}", message);

// Construct and define the size of our window using `.dimensions(width, height)`.
app.new_window().dimensions(640, 480).build().unwrap();
// Construct and define the size of our window using `.size(width, height)`.
app.new_window().size(640, 480).build().unwrap();

Model
}

fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(DIMGRAY);
}
2 changes: 1 addition & 1 deletion examples/basics/3_variable_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ fn event(_app: &App, model: &mut Model, event: WindowEvent) {
}
}

fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(DIMGRAY);
}
2 changes: 1 addition & 1 deletion examples/basics/4_conditionals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main() {
nannou::sketch(view);
}

fn view(app: &App, frame: &Frame) {
fn view(app: &App, frame: Frame) {
// Prepare to draw.
let draw = app.draw();

Expand Down
2 changes: 1 addition & 1 deletion examples/basics/5_loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ fn model(_app: &App) -> Model {
Model
}

fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(DIMGRAY);
}
2 changes: 1 addition & 1 deletion examples/basics/6_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ fn event(_app: &App, _model: &mut Model, event: WindowEvent) {
}
}

fn view(_app: &App, _model: &Model, frame: &Frame) {
fn view(_app: &App, _model: &Model, frame: Frame) {
frame.clear(DIMGRAY);
}
2 changes: 1 addition & 1 deletion examples/basics/7_modules/7_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn update(app: &App, model: &mut Model, _update: Update) {
model.ball.position = pt2(app.mouse.x, app.mouse.y);
}

fn view(app: &App, model: &Model, frame: &Frame) {
fn view(app: &App, model: &Model, frame: Frame) {
// Begin drawing.
let draw = app.draw();
// Draw dark gray for the background
Expand Down
Loading