summaryrefslogtreecommitdiffstats
path: root/examples/integration_wgpu/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-11-07 15:15:33 +0700
committerLibravatar GitHub <noreply@github.com>2021-11-07 15:15:33 +0700
commiteafad00af2a9bae9f3ed8124e2a6f6e59ee5d253 (patch)
tree76413948c9c9723075189d51d4c2e02c0f8fdd23 /examples/integration_wgpu/src/main.rs
parent61c747b53589d98f477fea95f85d2ea5349666d3 (diff)
parent07b5097bc92ced376d09115d787ff1d2ebe00836 (diff)
downloadiced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.gz
iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.bz2
iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.zip
Merge pull request #1110 from iced-rs/remove-renderer-traits
Reduce the surface of the `Renderer` APIs
Diffstat (limited to 'examples/integration_wgpu/src/main.rs')
-rw-r--r--examples/integration_wgpu/src/main.rs31
1 files changed, 16 insertions, 15 deletions
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs
index bf36c7a5..35a69a7d 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration_wgpu/src/main.rs
@@ -94,7 +94,6 @@ pub fn main() {
let mut state = program::State::new(
controls,
viewport.logical_size(),
- conversion::cursor_position(cursor_position, viewport.scale_factor()),
&mut renderer,
&mut debug,
);
@@ -196,15 +195,17 @@ pub fn main() {
}
// And then iced on top
- let mouse_interaction = renderer.backend_mut().draw(
- &mut device,
- &mut staging_belt,
- &mut encoder,
- &view,
- &viewport,
- state.primitive(),
- &debug.overlay(),
- );
+ renderer.with_primitives(|backend, primitive| {
+ backend.present(
+ &mut device,
+ &mut staging_belt,
+ &mut encoder,
+ &view,
+ primitive,
+ &viewport,
+ &debug.overlay(),
+ );
+ });
// Then we submit the work
staging_belt.finish();
@@ -212,11 +213,11 @@ pub fn main() {
frame.present();
// Update the mouse cursor
- window.set_cursor_icon(
- iced_winit::conversion::mouse_interaction(
- mouse_interaction,
- ),
- );
+ window.set_cursor_icon(
+ iced_winit::conversion::mouse_interaction(
+ state.mouse_interaction(),
+ ),
+ );
// And recall staging buffers
local_pool