Speedy2D icon indicating copy to clipboard operation
Speedy2D copied to clipboard

Hangling multiple windows

Open d0rianb opened this issue 2 years ago • 4 comments

Is it possible for speedy2d to handle multiple windows ? I know that winit can do this but I couldn't find any reference to this in the documentation/source code. I currently can't send the WindowHandler through threads (in order that each window has its own thread) because the Send trait is not implemented by multiple library structs.

d0rianb avatar Mar 16 '22 17:03 d0rianb

It should be possible to implement this I think, although everything would be on the main thread. We could add a function to the WindowHandler to create a new window, and register a new WindowHandler for it.

It wouldn't work for the WebGL backend, so we'd need to add a way of querying support (or, maybe we could make it work using a popup?)

QuantumBadger avatar Mar 19 '22 22:03 QuantumBadger

Is there any news on this? I would really like to use multi window in a program I’m making (a church presentation program, Quantum)

LexNastin avatar Mar 18 '23 10:03 LexNastin

No news yet, but it's still something I'd like to implement. A workaround in the meantime could be to have multiple copies of the process running, which could communicate via sockets.

QuantumBadger avatar Apr 12 '23 07:04 QuantumBadger

To a user of the library, it looks like the main problem preventing this is that the program exits on closing a window. My idea on how to fix this is that WindowHandler has to implement a function that runs on window close. This will not only allow multiple windows, but it means we can do things like cleaning up temp files on last window close, for example.

Aworldc avatar Apr 16 '23 23:04 Aworldc