PistonDevelopers / piston-examples

A collection of examples using the Piston game engine
MIT License
343 stars 90 forks source link

multi_window segfaults #487

Open grinapo opened 1 year ago

grinapo commented 1 year ago

And all I have is the advice to "manually update piston": https://github.com/rust-windowing/winit/issues/2683

Since I am at the level of "run the example with cargo" this is probably within a "some months" timeframe, so maybe you want to act on it now. :-)

bvssvni commented 1 year ago

I updated glutin_window, but get the following error:

thread 'main' panicked at 'Creating EventLoop multiple times is not supported.'
bvssvni commented 1 year ago

I found the place: https://github.com/rust-windowing/winit/blob/master/src/event_loop.rs#L80-L90

Aethelflaed commented 9 months ago

Fixed link from the previous comment + excerpt:

https://github.com/rust-windowing/winit/blob/3217eaa416e7802b2dbc65bdfaa1c8a7a395cf17/src/event_loop.rs#L80-L90

/// Builds a new event loop.
///
/// ***For cross-platform compatibility, the [`EventLoop`] must be created on the main thread,
/// and only once per application.***
///
/// Attempting to create the event loop on a different thread, or multiple event loops in
/// the same application, will panic. This restriction isn't
/// strictly necessary on all platforms, but is imposed to eliminate any nasty surprises when
/// porting to platforms that require it. `EventLoopBuilderExt::any_thread` functions are exposed
/// in the relevant [`platform`] module if the target platform supports creating an event loop on
/// any thread.

Maybe we should update the README to document that multi_window might not work?