Reputation: 43872
In various locations, I've seen the term "rubberbanding" used when referring to graphics drawing. In such cases, people have seemed to recommending doing drawing using XOR, and I've gotten the impression that the term refers to a particular drawing technique used to avoid redrawing the entire frame.
However, I haven't been able to find anything that defines exactly what the term "rubberbanding" means. Just in a general sense, without discussing implementation details too heavily, what is the meaning of the term "rubberbanding" and what is its purpose?
Upvotes: 3
Views: 1546
Reputation: 2516
There's two meanings. Using XOR is how you implement rubber banding on a 1970s or 1980s era GUI, when the computers weren't fast enough to redraw the entire screen at interactive rates. (Except for a few heroic/insane assembly language efforts.)
As a user interaction technique, rubber banding was being able to draw a line by pressing the mouse button down at the start point and then dragging to the end point, with a continuously updating line as if there was a "rubber band" stretched between the two.
It became widespread after the first MacPaint and MacDraw came out in 1984. It seems obvious to us today, but at the time most CAD programs worked by 1. click on the start point, 2. move and click on the end point, 3. the computer draws a line between the two.
Upvotes: 2
Reputation: 1862
It's a very old technique for drawing a shape without clearing the screen. If you want to draw a moving rectangle, the idea is to draw only the difference between the previous frame and the new one (adding the new parts, erasing the old ones, leaving the common part untouched).
The XOR trick is that if you draw something with it, it sets your color to the framebuffer. If you draw with it a second time over the same area, it removes your color.
As far as I know this has not been used in interactive rendering since the 90s (at least on PC-like platforms).
Upvotes: 6