Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: help needed: quick exchange of window contents (animation) Message-ID: <9009032240.AA19949@Larry.McRCIM.McGill.EDU> Date: 3 Sep 90 22:40:36 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 43 > I want to display complicated, slowly changing line drawings in an X > window. The problem is, that the screen starts flickering very much, > if I > 1) make a drawing (1 long call to XDrawSegments) > 2) flush the screen (XFlush) > 3) clear the window (XClearWindow) > 4) goto 1) > Is there a possibility to build up the new drawing somewhere in the > background while showing the old one and then switching to the new > drawing with one (quick) command? I know of three ways to do this. (1) Use the Multi-Buffering extension. This came out with R4; one hopes that most vendors have picked it up by now. If available, this is probably the best bet. (2) Use colormap and planemask tricks. If you have a visual with a mutable colormap, and a sufficient depth (from your description, I would guess you need only one bit to display your picture, meaning a depth of two would suffice), you can set the colormap to display one picture and set the planemask to make that picture read-only, draw the next, and then display it fast by changing the colormap cells. Then of course you change the planemask and draw the next picture, et cetera. (3) Draw into a pixmap and copy it onto your window in one go. You mention this but say > but I would like to avoid copying because of performance > reasons. Try it; you may find it doesn't hurt performance as much as you think it will. This method is the most universally available, but costs server-side memory, which might be scarce (eg, an X terminal). der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu