Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

msparkles
Copy link
Contributor

No description provided.

Copy link
Member

@LPGhatguy LPGhatguy left a 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.

crates/bootstrap/src/lib.rs Show resolved Hide resolved
crates/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
crates/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
crates/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@LPGhatguy LPGhatguy left a 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/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 45 to 47
Event::WindowEvent { event, .. } => {
if graphics.handle_event(&mut yak, &event, event_loop) {
return;
Copy link
Member

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.

Copy link
Contributor Author

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/demo/src/main.rs Outdated Show resolved Hide resolved
crates/demo/src/main.rs Outdated Show resolved Hide resolved
crates/yakui-app/src/lib.rs Outdated Show resolved Hide resolved
state: &mut yakui_core::Yakui,
event: &WinitEvent<T>,
) -> bool {
pub fn handle_event(&mut self, state: &mut yakui_core::Yakui, event: &WindowEvent) -> bool {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

crates/bootstrap/src/lib.rs Show resolved Hide resolved
@msparkles msparkles requested a review from LPGhatguy May 15, 2024 02:56
@LPGhatguy LPGhatguy mentioned this pull request Jun 14, 2024
@msparkles
Copy link
Contributor Author

msparkles commented Jun 30, 2024

Moving to #178 in courtesy of #151
image

We just realized this was from automancy's branch, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants