-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support RedrawRequested event #3
Comments
e08cac1 I implemented it here. |
I’m sure that will function correctly. Seems like I will have to use an if-else to either draw or update my game state. I also don’t know what kind of timing implications this will have, deferring According to rust-windowing/winit#1041 (comment) |
Eventscleared is not coming from your OS but from winit itself, just meaning that it has no more events queued up at the moment. So it should be fine to just wait for all queue d events to process before acting on the redrawrequested. Games will want to redraw every frame anyway so games don't usually bother with redraw requested. |
I was going to get back to this sooner, but while I was testing on Windows, my GPU decided to completely die. Anyway, The winit issue I linked has some very important details about exactly why they have decided to implement I wasn't able to verify any of this when I tested, before my GPU died. All I was able to get out of it was my game "freezing" while the window is resized. And this is with using the recommended strategy. I can't tell if these are just bugs or if it doesn't really matter. |
Well, if you want to process the event immediately why do you want winit_input_helper to be involved? It sounds like your current code is fine. |
Just trying to reduce line noise in the source, TBH. You're right, the current code is fine functionally. |
Maybe it would be neater if it wasn't on so many lines ;)
Unless you have any objections I might revert the changes I did for this issue because, as you have pointed out, its incorrect. |
Yeah, rustfmt is picky. 🤷♀ Feel free to revert the change. I was hoping this was something simple. But might end up being a headache that isn't worth it. Returning an enum instead of a bool or whatever. Sounds like Pandora's box. |
Changes are reverted |
Looks like this event is not currently supported: https://docs.rs/winit/0.20.0-alpha4/winit/event/enum.WindowEvent.html#variant.RedrawRequested
The crate supports everything else I need, just this one piece is out of place. See it in context, here:
https://github.com/parasyte/pixels/blob/d33c30dd08d2561cd1643001bea912a77b198c53/examples/invaders/main.rs#L51-L60
The text was updated successfully, but these errors were encountered: