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 to winit 0.30 #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update to winit 0.30 #61

wants to merge 1 commit into from

Conversation

stefnotch
Copy link

@stefnotch stefnotch commented May 6, 2024

Overhauls the public API to support winit 0.30

One thing to note is that I moved the "update" logic from AboutToWait to RedrawRequested.
This isn't optimal, as it doesn't call update if there is no redrawing. So a hello world app that never triggers a redraw would also not respond to quit events and such.

Using AboutToWait comes with a different issue https://docs.rs/winit/latest/winit/application/trait.ApplicationHandler.html#method.about_to_wait

I'm not entirely sure what the best option here is.

@stefnotch
Copy link
Author

Maybe I should trigger a request redraw whenever a potentially relevant event happens?
After all, winit will take all those redraw requests and only schedule as many as actually needed.

@hakolao
Copy link

hakolao commented Jun 4, 2024

Is there a way to make this without having to wrap under application handler? Just updating state with events... Kind of like it used to be. Is there something preventing that?

I'm not too fond of the winit's new api, but also i've not yet attempted to update my libs so haven't formed a full opinion.

@stefnotch
Copy link
Author

stefnotch commented Jun 4, 2024

Yes, that's possible. The downside would be that it'd be the user's responsibility to call a winit-input-helper method in 3 places: window_event, in device_event and in suspended.

But I suppose even with that downside, such an API would be worthwhile to have.

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.

2 participants