Open aevyrie opened 2 weeks ago
the issue seems to be that in Wasm, user events don't interrupt when the event loop is waiting
Retested, and edited my original report, I was wrong about some of the behavior.
Do we just need to update the example? RequestRedraw
seems to work as expected.
I updated the example to be more explicit about RequestRedraw
and WakeUp
in https://github.com/bevyengine/bevy/pull/14224
I'll try to get it working in Wasm too... but later
the issue seems to be that in Wasm, user events don't interrupt when the event loop is waiting
Let me know if this is a Winit bug, last time I checked user events should wake up the event loop correctly on Webwith Winit.
Bevy version
0.14
What you did
RequestRedraw
being sentWhat went wrong
The event loop should run continuously as long as the event is being sent. However, it does not.
Additional information
let _ = event_loop_proxy.send_event(WakeUp);
was added to the example, but the docs all refer toRequestRedraw
. Replacing the event loop proxy wakeup withRequestRedraw
appears to fix the behavior.The event loop proxy is useful when waking from another thread, but it appears it is not a direct replacement for the bevy event on all platforms.