From: Andy Little (andy_at_[hidden])
Date: 2004-09-23 09:38:34
"Reece Dunn" <msclrhd_at_[hidden]> wrote in message
> Matt S Trentini wrote:
> >John Torjo wrote:
> >Any object that allocates a handle under Windows (pens, brushes, dc's,
> >consume those resources and if you've got a graphically intense GUI using
> >greedy GUI library (ie one that holds it's handles for a long duration)
> >that limit isn't too hard to break.
> Wouldn't you process the pen objects, etc. when handling the drawing
> Instead of storing a pen handle for each line (which IMHO is overkill),
> would do something like:
I'd hope to keep the idea of acquiring and releasing system resources at a
lower level. It then becomes the ( abstracted) output-devices job to acquire
and release resources efficiently. For instance when drawing a 'stream' of
lines, the stream might note a change in line colour, width,or style and
only then see the need to change the 'pen', possibly with a cache, where
resources that havent been used for a while are released.
A similar approach might be applicable to GUI objects in general. Keep them
as dumb as possible, until they are 'activated', and then dumb them down
again if they dont appear to be being used.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk