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_opengl/src/main.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'examples/integration_opengl/src/main.rs') diff --git a/examples/integration_opengl/src/main.rs b/examples/integration_opengl/src/main.rs index f80915d2..bab6331e 100644 --- a/examples/integration_opengl/src/main.rs +++ b/examples/integration_opengl/src/main.rs @@ -160,18 +160,22 @@ pub fn main() { } // And then iced on top - let mouse_interaction = renderer.backend_mut().draw( - &gl, - &viewport, - state.primitive(), - &debug.overlay(), - ); + renderer.present(|backend, primitive| { + backend.present( + &gl, + primitive, + &viewport, + &debug.overlay(), + ); + }); + // Update the mouse cursor - windowed_context.window().set_cursor_icon( - iced_winit::conversion::mouse_interaction( - mouse_interaction, - ), - ); + // TODO + // windowed_context.window().set_cursor_icon( + // iced_winit::conversion::mouse_interaction( + // mouse_interaction, + // ), + // ); windowed_context.swap_buffers().unwrap(); } -- 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_opengl/src/main.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'examples/integration_opengl/src/main.rs') diff --git a/examples/integration_opengl/src/main.rs b/examples/integration_opengl/src/main.rs index bab6331e..ef79b889 100644 --- a/examples/integration_opengl/src/main.rs +++ b/examples/integration_opengl/src/main.rs @@ -68,7 +68,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 844fecd602cc338ca1338a1289e5552100d4d3d5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 16:35:16 +0700 Subject: Rewrite cursor icon logic for `integration_opengl` example --- examples/integration_opengl/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'examples/integration_opengl/src/main.rs') diff --git a/examples/integration_opengl/src/main.rs b/examples/integration_opengl/src/main.rs index ef79b889..f0ff2076 100644 --- a/examples/integration_opengl/src/main.rs +++ b/examples/integration_opengl/src/main.rs @@ -169,12 +169,11 @@ pub fn main() { }); // Update the mouse cursor - // TODO - // windowed_context.window().set_cursor_icon( - // iced_winit::conversion::mouse_interaction( - // mouse_interaction, - // ), - // ); + windowed_context.window().set_cursor_icon( + iced_winit::conversion::mouse_interaction( + state.mouse_interaction(), + ), + ); windowed_context.swap_buffers().unwrap(); } -- 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_opengl/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/integration_opengl/src/main.rs') diff --git a/examples/integration_opengl/src/main.rs b/examples/integration_opengl/src/main.rs index f0ff2076..3b63f22e 100644 --- a/examples/integration_opengl/src/main.rs +++ b/examples/integration_opengl/src/main.rs @@ -159,7 +159,7 @@ pub fn main() { } // And then iced on top - renderer.present(|backend, primitive| { + renderer.with_primitives(|backend, primitive| { backend.present( &gl, primitive, -- cgit