[SDL] Re: Multiple SDL Windows again...

Ryan C. Gordon icculus at linuxgames.com
Sun Apr 29 16:47:56 PDT 2001


> > This can't be how real GUI's do it!?!  That just sounds so wasteful to
> > me.
> 
> Wasteful or not; that *is* how most toolkits do it, as there is no other way 
> of rendering outside a window... And it's not really that bad, if implemented 
> properly. Have a look at SDL's clipping, add some window management 
> functionality to keep track of dirty areas, and you get the idea.

This isn't really how most GUIs do it.

(Generally speaking) At the windowing system level, there is an abstract
concept of a "window", which isn't nearly as resource intensive as, say,
an Xterm or Netscape's "window," which are comprised of several
windowing system windows.

Different systems call these different things: controls, components,
widgets. They are, individually, designed for piling next to and on top of
each other in large quantities. They each get individual events
(mouseovers, etc), and their rendering doesn't overwrite the graphical
contents of any other overlapping widgets.

An SDL window is much, much heavier than one of these, as it is already a
collection of widgets (titlebar, maximize button, surface, etc). Each SDL
window gets it's own events and handles it's own redraw, but in terms of a
UI toolkit, this is accidental.

Just wanted to make that distinction. See my next post about using SDL for
a ui toolkit.

--ryan.





More information about the SDL mailing list