Re: drawables and refresh rates



On Fri, 2004-12-03 at 04:43, Andrew E. Makeev wrote:
> Rob Benton wrote:
> 
> > Andrew E. Makeev wrote:
> >
> >> Before to answer you, we need to know how do you "draw" your circles? 
> >> The common way is to use expose_event to redraw only those parts of 
> >> the drawing area that actually were changed. In this case I never 
> >> seen any flickering in my applications even on Celeron 300Mhz.
> >>
> >
> > Right now I'm using 2 methods.  Method A handles the expose event of 
> > the Gtk::DrawingArea which then calls method B.  Method B is also 
> > connected to the value changed signal of both the Gtk::HScale widgets.
> >

I do something like:

Method A handles expose events, and redraws exposed rectangle from
internal pixmap.

Method B connected to value changed signal, draws to internal pixmap,
calls queue_draw() which eventually triggers Method A.

You can add efficiency by keeping track of the bounding box of what you
redraw, and only trigger expose events for those rectangles.

Regards,
Carl




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