Ray Kelm wrote:
(No, I didn’t - Ray Kelm did. Anyway…)
Actually, I wouldn’t mind a hack that just allows multiple windows to
each be considered a “screen”. I think The only part that would
require moderate SDL changes is event handling.
From the SDL programmers point of view it would be nice to treat each
window as an sdl surface
…just like the current “screen” is handled…
and to add the sdl surface structure address
to the event structure to distinguish events originating on differenct
surfaces.
Yes, something like that would be required. It could even be done without
breaking binary compatibility with old applications. (You can’t just
extend the “real” event struct, because that would make old applications
crash when the read events.)
Then inside each SDL api you would have to add code to vector
the requested operation to the correct implementation based on surface
flags or something similar.
If we assume that all windows will have the same pixel format and run on
the same target, that wouldn’t really be necessary.
If we assume that SDL isn’t redesigned to be thread safe, and use
explicit context switching calls, nothing like that would be needed at
all, as you’ll always be operating on the currently selected context.
Just swap some of SDL’s internal variables when switching context, and
that’s it.
SDL is already structured pretty much that way. It would add some code
and probably slow down everything a little bit. Is is worth it?
I don’t think there would by any slowdown at all, except some in the
event system, as no changes to the actual blitting code would be
required. Instead, you take the full “impact” when doing an explicit
context switch - which means that there’s no cost unless you use multiple
"screens".
Either way, there are still a bunch of targets that need a redesign of
SDL’s internals for this to be possible. I don’t know exactly how much
work it would be, but I’ve been told that it’s rather sustantial. Seems
like it’s not wortwhile to do something like that before 1.3.
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Wednesday 06 March 2002 21:25, Bob Pendleton wrote:
On Mon, Mar 04, 2002 at 10:17:35PM +0100, David Olofson wrote: