Allow winit event loop to be recreated on web / wasm #12562
Labels
A-Windowing
Platform-agnostic interface layer to run your app in
C-Feature
A new feature, making something new possible
D-Trivial
Nice and easy! A great choice to get started with Bevy
O-Web
Specific to web (WASM) builds
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
When using Bevy in web currently it is not possible to run bevy multiple times. This is especially important in hybrid application that use Bevy only in game or multiple bevy instances.
A similar issue was mentioned here 12195 in the bevy repo. The proposed solution there is not suited for my usecase since it makes communication between the iframe and the host application difficult to impossible.
What solution would you like?
There exists an already implemented feature in winit solving the same problem I showed. The related issue is 2897 and 2720 in the winit repo. It should be possible to use this feature similarly to how conditionally already some features of android and co are used in the bevy winit plugin.
What alternative(s) have you considered?
Currently there seems at least in the bevy side of things no other solution. It might be possible to completely shutdown wasm and load the bevy application completely from scratch. But these solution seem hacky on not like good solutions.
The text was updated successfully, but these errors were encountered: