Any good examples of conversions from "run" to "run_app"? #4075
Replies: 2 comments
-
I've now found and read the redesign at #3367 It looks like Winit is being converted from a library to a framework. (Users call a library. A framework calls you. Libraries are subordinates. Frameworks are bosses.) Applications using Winit are supposed to be restructured to look like this:
That's a huge change. Nowhere did someone come right out and say "Winit is becoming a framework". [This changelog entry ](https://docs.rs/winit/latest/winit/changelog/index.html#deprecated does hint at that, but did not make it clear how drastic a change was being contemplated. This is a big problem if there's already another framework in place, one that uses Winit as a library. Now we have two event loops, both of which want to be in charge. I'm still using Rend3, which has its own incompatible framework system. If I have to redesign that and everything I have that uses it, I'm looking at a month of wasted effort, at least. Everybody who had another event loop now has a big problem. Some people were talking about forking Winit at 0.29 to avoid this. Did that happen? |
Beta Was this translation helpful? Give feedback.
-
How this is different to what we had in 0.29? You simply was passing callback and winit was running and taking all the control, now you pass a state instead of With the except of async. |
Beta Was this translation helpful? Give feedback.
-
Ref: https://docs.rs/winit/0.30.8/winit/event_loop/struct.EventLoop.html#method.run_app
This looks like a tough conversion. I have to fix about four event loops in different programs, all written by others. This is in an area known for per-platform troubles, and hard to test. Is there any safe way to convert old event loops easily
Is it possible to emulate the old interface?
Beta Was this translation helpful? Give feedback.
All reactions