From 03b34931383e701c39c653a7662a616fe21a0947 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 14 Oct 2021 16:07:22 +0700 Subject: Remove trait-specific draw logic in `iced_native` --- examples/integration_wgpu/src/main.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'examples/integration_wgpu') diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index 7ef148bc..9980acc2 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -195,26 +195,28 @@ 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.present(|backend, primitive| { + backend.present( + &mut device, + &mut staging_belt, + &mut encoder, + &view, + primitive, + &viewport, + &debug.overlay(), + ); + }); // Then we submit the work staging_belt.finish(); queue.submit(Some(encoder.finish())); // Update the mouse cursor - window.set_cursor_icon( - iced_winit::conversion::mouse_interaction( - mouse_interaction, - ), - ); + // window.set_cursor_icon( + // iced_winit::conversion::mouse_interaction( + // mouse_interaction, + // ), + // ); // And recall staging buffers local_pool -- cgit From be97a5d502df8c8b23704f5a8a0d425f4eff2215 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 16:43:18 +0700 Subject: Introduce `mouse_interaction` method to `Widget` trait --- examples/integration_wgpu/src/main.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'examples/integration_wgpu') diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index 9980acc2..c2c857d2 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -93,7 +93,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, ); -- cgit From 0aafcde0ef1533c9eeba0379de8c0082e30c7504 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 15:35:12 +0700 Subject: Remove `widget` module re-exports in `iced_native` --- examples/integration_wgpu/src/controls.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/integration_wgpu') diff --git a/examples/integration_wgpu/src/controls.rs b/examples/integration_wgpu/src/controls.rs index 414eb9ce..4f110bd2 100644 --- a/examples/integration_wgpu/src/controls.rs +++ b/examples/integration_wgpu/src/controls.rs @@ -1,8 +1,7 @@ use iced_wgpu::Renderer; -use iced_winit::{ - slider, Alignment, Color, Column, Command, Element, Length, Program, Row, - Slider, Text, -}; +use iced_winit::widget::slider::{self, Slider}; +use iced_winit::widget::{Column, Row, Text}; +use iced_winit::{Alignment, Color, Command, Element, Length, Program}; pub struct Controls { background_color: Color, -- cgit From 661cb5736ecc6e7810591216aa541db582a2fcc0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 16:36:34 +0700 Subject: Rewrite cursor icon logic for `integration_wgpu` example --- examples/integration_wgpu/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/integration_wgpu') diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index c2c857d2..e1d691f0 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -211,11 +211,11 @@ pub fn main() { queue.submit(Some(encoder.finish())); // 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 -- cgit From 9fe65ed729c75a8401765cf373345aaba93352ca Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 5 Nov 2021 15:38:27 +0700 Subject: Rename `Renderer::present` to `with_primitives` --- examples/integration_wgpu/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/integration_wgpu') diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index d1000748..35a69a7d 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -195,7 +195,7 @@ pub fn main() { } // And then iced on top - renderer.present(|backend, primitive| { + renderer.with_primitives(|backend, primitive| { backend.present( &mut device, &mut staging_belt, -- cgit