mrk-its / bevy_webgl2

WebGL2 renderer plugin for Bevy game engine
MIT License
172 stars 46 forks source link

Bump winit to v0.25 #41

Closed gcoakes closed 3 years ago

gcoakes commented 3 years ago

winit v0.25 includes support for propagating mouse motion events in the HTML canvas to the winit window.

I've submitted a similar patch to bevy_winit. The versions will be out of sync, if both repositories don't update before the next release.

billyb2 commented 3 years ago

Hey @mrk-its, would you mind merging this?

allsey87 commented 3 years ago

@billyb2 was the following change necessary for compilation on your end? If so, perhaps this should be included in the PR.

diff --git a/src/lib.rs b/src/lib.rs
index 67ab6b1..c7d26a2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -140,7 +140,7 @@ pub fn webgl2_handle_window_created_events_system() -> impl FnMut(&mut World) {
                 let winit_windows = world.get_resource::<bevy::winit::WinitWindows>().unwrap();
                 let winit_window = winit_windows.get_window(window_id).unwrap();
                 let mut render_resource_context = WebGL2RenderResourceContext::new(device.clone());
-                render_resource_context.initialize(&winit_window);
+                render_resource_context.initialize(winit_window);
                 render_resource_context
             };
             world.insert_resource::<Box<dyn RenderResourceContext>>(Box::new(
mrk-its commented 3 years ago

Sorry for delay. Thanks!

billyb2 commented 3 years ago

Sorry for delay. Thanks!

No problem, thank you!