From: seebs@... (Peter Seebach) Date: 2007-07-28T04:44:36+09:00 Subject: Re: How to pass arguments by reference in a function In message <026a01c7d085$106a05c0$6442a8c0@musicbox>, "Bill Kelly" writes: >Incidentally, I do recall one interesting use of this XOR swap >technique. >I believe this is how GUI menus were drawn on the screen on the >Amiga. When you'd click the mouse to get a menu, the system >would allocate off-screen bitmap memory, and render the menu >into the off-screen bitmap. Then it would XOR-swap the off-screen >rendered menu, with the location on the screen where the menu >would be displayed. Thus preserving the pixels from the screen >that would be obscured by the menu, so that the pixels could >be restored when the menu was dismissed. Interesting. There were a few different ways; you could request automatic backing store, or you could do it yourself and get notifications, but it was mostly transparent. >Pretty neat trick, since it avoided allocating an extra buffer >to store the obscured screen pixels. (And it was fast, because >the Amiga bitmap blitter supported logical raster op's including >XOR, etc.) Except it does allocate a buffer, really. I don't recall the details anymore. -s