-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update winit to 0.30 #152
update winit to 0.30 #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Staying on top of the latest winit version is important to me.
I've left a few comments about the changes to the bootstrap crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working through the feedback so far! I've got a few more comments as part of the migration.
crates/demo/src/main.rs
Outdated
Event::WindowEvent { event, .. } => { | ||
if graphics.handle_event(&mut yak, &event, event_loop) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we preserve the original structure of the code here? The hope is that handle_event
runs before your match block and helps filter out events. It should be able to accept the Event
type just like before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the comment on DeviceEvent
crates/yakui-winit/src/lib.rs
Outdated
state: &mut yakui_core::Yakui, | ||
event: &WinitEvent<T>, | ||
) -> bool { | ||
pub fn handle_event(&mut self, state: &mut yakui_core::Yakui, event: &WindowEvent) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should preserve yakui's ability to handle winit's Event
type to make it easier for users still using the old event loop style to integrate. Additionally, we probably do want to leave the door open to handle DeviceEvent
without silently missing out on functionality.
A good way to solve this might be with an AsWinitEvent
trait that we implement for Event
, DeviceEvent
, and WindowEvent
. I'm not sure what the exact shape it should take is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were more thinking of having a separate function for device events if and when it's needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LPGhatguy Do you have any strong opinions on this? At least working with the newer changes to winit, they seem to want to rather separate the two events
No description provided.