Refactor winit_runner to make custom runners more usable #4537
Labels
A-App
Bevy apps and plugins
A-Windowing
Platform-agnostic interface layer to run your app in
C-Code-Quality
A section of code that is hard to understand or change
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
App runners control the main loop of Bevy apps.
Unfortunately,
winit
also needs to control the main loop of the app, and thus integrating Bevy with winit requires the use of a specializedwinit_runner
.This code is entirely monolithic, which makes it very challenging to reuse windowing functionality while using a specialized runner.
What solution would you like?
Refactor the contents of
winit_runner
andwinit_runner_with
(which frankly just looks like it shouldn't exist at this point).The code feels like it can be split up into three parts:
winit
WindowEvents
into Bevy data.What alternative(s) have you considered?
I've seen users copy-paste the code into their own runner, and make their tweaks there. This is not great, because it means any improvements or fixes we make aren't incorporated upstream.
Additional context
Discussed in the context of #4530, which will require a serious refactor anyways.
The text was updated successfully, but these errors were encountered: