Re: GTK+ back buffers?



Pete Ryland <pdr-lists@pdr.ml.org> writes:

> I'm trying to do some fast graphical stuff, and I need to implement a fast
> off-screen double buffer.  Since I also need portability with other
> platforms, the backbuffer is an "unsigned char *" and can be configured to
> be either 16 or 24 bit (or 8 bit with a certain fixed palette - not really
> applicable in X since you can't change the whole palette). 
>
> My question is this:  How do I copy the "unsigned char *" buffer to a
> format that can be flipped to a window without having to do a put_pixel
> call for each pixel in the image?

Use X pixmap.  Just "draw" to the pixmap, and gdk_window_copy_area
(XCopyArea without gtk) from the pixmap to the target window.

freecell draws its cards in this way.



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