Skip to content

Commit

Permalink
Merge pull request #452 from mitchmindtree/wgpu
Browse files Browse the repository at this point in the history
WIP - Transition graphics backend from vulkano to wgpu
  • Loading branch information
mitchmindtree authored Mar 3, 2020
2 parents f6c3e8f + 8889288 commit 95c8dbd
Show file tree
Hide file tree
Showing 363 changed files with 7,385 additions and 12,665 deletions.
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

0 comments on commit 95c8dbd

Please sign in to comment.