Re: Windows vertical retrace
- Posted by Cuvier Christian <christian.cuvier at insee.fr> Jun 22, 2006
- 582 views
> Subject: Windows vertical retrace > > > posted by: ags <eu at 531pi.co.nz> > > Hi All > > After a quick google it seems to me that there is no way to > detect the vertical retrace on the windows desktop (ie > 'non-exclusive' mode). > > 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). > > So what do other systems do about this? Flash objects in web > pages don't seem to suffer from this and other windowed games > seem to get around the problem. How are they doing this? > How can we do this in Euphoria, particularly with win32lib? > > Gary > > 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. HTH CChris