summaryrefslogtreecommitdiffstats
path: root/examples/integration/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-06-05 17:36:18 +0200
committerLibravatar GitHub <noreply@github.com>2020-06-05 17:36:18 +0200
commitca6ff874a18d1027dbbcdc6059ccbc58dd2f2680 (patch)
tree61b8ad6a0c8fad3103020b7c2e6e2ab05b3e1a9e /examples/integration/src/main.rs
parent4c494c724435d05d1b46d19bf890a8aaef962b15 (diff)
parentfd3801ed38a5adbba11ede16f552cd80c0a8bb58 (diff)
downloadiced-ca6ff874a18d1027dbbcdc6059ccbc58dd2f2680.tar.gz
iced-ca6ff874a18d1027dbbcdc6059ccbc58dd2f2680.tar.bz2
iced-ca6ff874a18d1027dbbcdc6059ccbc58dd2f2680.zip
Merge pull request #387 from hatoo/add-comment
Add a comment of how to clear the display to `integration` example
Diffstat (limited to 'examples/integration/src/main.rs')
-rw-r--r--examples/integration/src/main.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs
index 6b4aa968..db8b4366 100644
--- a/examples/integration/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -154,14 +154,19 @@ pub fn main() {
&wgpu::CommandEncoderDescriptor { label: None },
);
- // We draw the scene first
let program = state.program();
- scene.draw(
- &mut encoder,
- &frame.view,
- program.background_color(),
- );
+ {
+ // We clear the frame
+ let mut render_pass = scene.clear(
+ &frame.view,
+ &mut encoder,
+ program.background_color(),
+ );
+
+ // Draw the scene
+ scene.draw(&mut render_pass);
+ }
// And then iced on top
let mouse_interaction = renderer.backend_mut().draw(