On Mar 7, 2007, at 9:53 AM, MacArthur, Ian ((SELEX)) ((UK)) wrote: > >> I'm using the overlay in Fl_Overlay_Window to draw on a >> background image. At each redraw I only need to add a bit >> more information and don't want to redraw the entire overlay. >> So can I restrict the overlay so it doesn't clear the >> previous state? Perhaps with clipping? >> >> The reason I want to do this is the overlay currently >> flickers during the update on some computers. Would this >> happen when there is no overlay hardware support? > > I don't know for sure - haven't tried this recently, but... Are you > sure > the overlay window is what you really need. > (...) > So... We switched to using a "plain" double window and rendered the > image and the overlay ouselves. Flicker gone. Update rates still > acceptable. Loading nowhere near as bad as I'd feared...
Fl_Overlay_Window is only useful if you have hardware overlay support on your graphics card *and* FLTK is able to actually use it. Otherwise, FLTK will simulate the overlay by double-buffering the background and single-buffering the overly, which can result in substantial flicker. The best way I found to do incremental and complex overlays on an image is to create you own off-screen buffer, copy the bitmap into it, and draw onto that. Then whenever FLTK calls "draw()" for your widget, you quickly copy from the custom off-screen buffer into the current widget. You will get absolutely no flicker and very efficient draw (until you erase something from your overlay, but event that can be optimized). Sometimes, an OpenGL window is a great alternative, even in 2D. Hardware overlays are much more likely to be supported, but even if not, you can do a lot of buffer manipulations, scaling and tweaking, etc. . ---- http://robowerk.com/ _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

