QuantumBadger / Speedy2D

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hangling multiple windows

d0rianb opened this issue · 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.

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?)

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)

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.

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.