Re: Backing store?



Luke Scharf <luke vt edu> writes:

Havoc Pennington wrote:

Luke Scharf <luke vt edu> writes:
Can I use <gdkxx.h> to enable backing store for a drawingarea->window?
If so, how can I do it?

X doesn't have any backing store concept. What do you mean by backing
store? The only way to get this is to use a pixmap manually as in the
"scribble" example in the tutorial.

The origional code has something that looks like this:

   SetWindowAttributes attribs;
   Window wnd;
   attribs.backing_store = Always;
   wnd = XCreateWindow(display, DefaultRootWindow(display),
              0, 0, width, height, 0, 8, InputOutput, visual,
              CWBackingStore | CWBackPixel, &attribs);

Is there any way to cause this to happen in GTK/GDK?

The backing store here, is backing store that saves the obscured
regions of the window. That is, if another window is put in front of
the window and remove it, you _might_ not get an expose event.  But
you might. X is not required to honor the backing_store hint here. So,
you really can't rely on the X backing store for anything. If the
original code didn't handle exposes, it was incorrect code. 

And from my experience, I have a pretty hard time believing:

 "The origional xlib code is simpler and about twice as fast as 
  my double-buffering code"

Or, if it is true that it was twice as fast, that that speed
difference was at all relevant. On any halfway modern machine, X can
copy from a double-buffer pixmap to the screen in no time at all.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]