sdl2_window
sdl2_window copied to clipboard
Support multiple windows
SDL2 doesn't delineate events between windows in the video subsystem, so when one Sdl2Window gets the event pump for polling events, it will capture events from all existing SDL2 Windows.
I see. This becomes problematic when WindowSettings is the only thing passed to the constructor.
I guess some sharing mechanism is required to make this work. Perhaps we should have a way of passing in custom information to WindowSettings?
WindowSettings<T = ()>
I think the only way to handle this is to add an additional event pump layer in front of SDL's that the calling code has to set up and poll, and send those events into each window manually. It wouldn't be possible to toss a window on each thread and have them handle their own event polling with the constraints of the SDL event system, even though it allows for polling on threads other than the main one.