summaryrefslogtreecommitdiffstats
path: root/examples/integration_opengl/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_opengl/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_opengl/src/main.rs')
-rw-r--r--examples/integration_opengl/src/main.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/integration_opengl/src/main.rs b/examples/integration_opengl/src/main.rs
index f80915d2..3b63f22e 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,
);
@@ -160,16 +159,19 @@ pub fn main() {
}
// And then iced on top
- let mouse_interaction = renderer.backend_mut().draw(
- &gl,
- &viewport,
- state.primitive(),
- &debug.overlay(),
- );
+ renderer.with_primitives(|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,
+ state.mouse_interaction(),
),
);