Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!ai-lab!tmb From: tmb@wheaties.ai.mit.edu (Thomas M. Breuel) Newsgroups: comp.windows.x Subject: RE: Fast, infinitely undoable graphics. Message-ID: <2483@rice-chex.ai.mit.edu> Date: 18 May 89 01:49:43 GMT Organization: MIT AI Lab, Cambridge, MA Lines: 34 In-reply-to: MSACKS@IBM.COM's message of 9 May 89 14:08:45 GMT Fast Infinitely Undoable Graphics... Problem: An application requires the capability to display complex pictures ( > 1000 graphic primitives such as lines, polygons, text etc. ) in such a way that an arbitrary number of individual graphic primitives may be chronologically and quickly undone, one by one, all the way to the very first primitive drawn. The undoing process must occur with the same rapidity as the drawing process and be visible to the end user. In short we are faced with the problem that graphic operations while additive are not subtractive. [... some solutions ...] There is yet another solution to your problem, in fact one which lets you undo graphics in arbitray order. Essentially you want to count for each pixel how often it has been drawn. Well, this is relatively straightforward to do with BITBLT: (1) allocate a number of bitmaps (say 10) on the server (2) when you draw a new item, draw it inside its own clean bitmap (3) consider the 10 bitmaps on the server bits of a counter; add "1" to the counter wherever your new item want to draw. You can do this using perhaps 4*10 BITBLT operations (you need another temporary bitmap for the carries). (4) OR together the 10 bitmaps and display the result If you want to undo, you subtract rather than add. On an Amiga, talking to the BLIT directly, this takes perhaps 100ms; a LIFE game that someone hacked up some time ago worked this way. I don't know how well X11 would deal with this. Thomas.