Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: porting unstructured graphics code to X Message-ID: <9102261216.AA12279@lightning.McRCIM.McGill.EDU> Date: 26 Feb 91 12:16:47 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 22 > I have a pile of code that needs to run under X. It all uses graphic > primitive calls (lines, dots, crosses) that are PLOT-10 like. > I'm unenthused about doing a lot of code rewrites to bundle graphics > code into repaint procedures. > Is there any easy way to port the code so that I can just draw into a > window, and *not* have to worry about redrawing from Expose events? Technically no, but close enough. You draw into both a pixmap and a window, and handle Expose events with XCopyArea() from the pixmap to the window. Of course, this carries a price: the pixmap (and a relatively slight speed penalty). On some servers, pixmaps of reasonable size are more or less free; on others, even fairly small ones are precious. You pays yer money and you takes yer choice.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu