Re: Drawing antialiased shapes with alpha transparency



Hi!

El Sat, Jan 08, 2005 at 10:56:18PM +0100, Samuel Abels escribio:
> 
> Is there a way to obtain a Gdk::Window's buffer? Or rather, what is the
> best way to obtain an RGB(A) buffer that I can draw to directly.

A Gdk::Window don't have any buffer. Each time the windowing system
(X or Win32) needs the image, it sends an "expose" event to the
application.

So, you should only draw your own buffer at the "expose" event.
If you do only one drawing operation per pixel, you should get no
flicker at all (ie., the image transitions from old to new in one
pass). Flicker is not dependent on the speed of the drawing if
you follow this rule.

Whenever your buffer changes and you want to update the displayed
image, you need to force an expose, using queue_draw() or
queue_draw_area().

If you need more speed, you should use something like SDL or Xv.

        Daniel.




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