Re: Windows vertical retrace

new topic     » goto parent     » topic index » view thread      » older message » newer message

Cuvier Christian wrote:
> 
> > posted by: ags <eu at 531pi.co.nz>
> > With rapidly updating graphics in a small window on my home 
> > system with a CRT monitor the flicker is quite noticeable.  
> > On my work system with an LCD monitor the effect is not as 
> > bad but still there (particularly if the mouse pointer is 
> > over the area being drawn).
> > ...
> I once read that screen flickering  was caused by painting the same area
> several times in a rapid succession, and that efficient flicker reduction
> could be made through eliminating the extra drawing.
> 
> For instance, when you repaint a window, the window gets a WM_ERASEBKGND
> message to erase the background, then the WM_PAINT. If you paint by copying
> a whole dc or pixmap, the drawing done while processing the first message is
> redundant, causes screen flicker and slows the app down. Trap the
> WM_ERASEBKGND message and process it by just returning -1 (or w32True). Docs
> say anything nonzero does the job.
> 
> This particular aspect is not the only source of flicker, but an often
> overlooked one. Ihave seen it in action. Again, the trick is avoiding to
> paint a region and then immediately redraw something else in it.

Thanks for that.  I managed to get rid of the flicker by using the non-erasing
repaintFG procedure in win32lib (I am not doing the message loop myself). 
Additionally the redrawRect procedure supplied by Derek Parnell helped me out.

I think the main source of flicker I was having was from the background being
erased first, but it did look like genuine vertical retrace flicker so maybe the
erasing and painting did what you are saying above.

In my graphex library (which I have just submitted) I can do multiple rapid
drawing of small areas of the window and there is little or no flicker.  Updating
the whole window at once now produces no flicker at all.

Thanks for your help.
Gary

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu