diff options
author | 2020-05-21 04:54:26 +0200 | |
---|---|---|
committer | 2020-05-21 04:57:00 +0200 | |
commit | d54f17c6aa1cc90d97c63781e7d06af1b919ef0c (patch) | |
tree | b195e3d5de0ed93e59e1833f5e2fd9feed3b347e /examples/integration/src/scene.rs | |
parent | ae5e2c6c734894d71b2034a498a858b7997c5d3d (diff) | |
download | iced-d54f17c6aa1cc90d97c63781e7d06af1b919ef0c.tar.gz iced-d54f17c6aa1cc90d97c63781e7d06af1b919ef0c.tar.bz2 iced-d54f17c6aa1cc90d97c63781e7d06af1b919ef0c.zip |
Simplify `integration` example with `Program`
Diffstat (limited to '')
-rw-r--r-- | examples/integration/src/scene.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/integration/src/scene.rs b/examples/integration/src/scene.rs index 22c6812a..b79a7ff4 100644 --- a/examples/integration/src/scene.rs +++ b/examples/integration/src/scene.rs @@ -2,7 +2,6 @@ use iced_wgpu::wgpu; use iced_winit::Color; pub struct Scene { - pub background_color: Color, pipeline: wgpu::RenderPipeline, bind_group: wgpu::BindGroup, } @@ -12,7 +11,6 @@ impl Scene { let (pipeline, bind_group) = build_pipeline(device); Scene { - background_color: Color::BLACK, pipeline, bind_group, } @@ -22,6 +20,7 @@ impl Scene { &self, encoder: &mut wgpu::CommandEncoder, target: &wgpu::TextureView, + background_color: Color, ) { let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { @@ -32,8 +31,7 @@ impl Scene { load_op: wgpu::LoadOp::Clear, store_op: wgpu::StoreOp::Store, clear_color: { - let [r, g, b, a] = - self.background_color.into_linear(); + let [r, g, b, a] = background_color.into_linear(); wgpu::Color { r: r as f64, |