   Drawing a transparent Marquee Rectangle in GL?
  All:I've been trying to wrack my head around on trying to figure out a fast way to draw a outlined region rectangle on my GL canvas without copying in the background image everytime the mouse callback is called (which would be a lot for dragging the mouse).  Right now, here's what I do: Copy in the entire image into the buffer (i.e. glDrawPixels)Draw the rectangle using GL_QUADS in outline mode.This gets rid of the in-between rectangles as the mouse is being dragged, but this is terrible on performance because my image is oftentimes 1920x1080.  Thus my dragging is slowed because the image is constantly being redrawn into the buffer first.Ideally, I'd like to just draw the rectangle without copying, but the rectangle needs to be cleared for each drag on the mouse and redraw overtop of the image without messing up the image.Anyone have any ideas?-M   
  Bump.   ;  Shouldn't you be using a texture for the image, instead of glDrawPixels?Aren't you redrawing the whole scene anyway?   ;  I'm not using a texture because the image is not being applied to any 3d object.I use glDrawPixels because I don't have the whole image when someone is rendering (off-line) so I get small chunks at a time. Without going into much detail, my program creates an 2D image on-the-fly based on streaming data (through a socket) from an off-line renderer.In answer to your second question, I don't need to redraw the entire image when I'm creating a region with the mouse.  If anything, I'd think that I just need to read pixels from the background image to cover the insides of the rectangle (assuming that the border of the rectangle is a solid color like red).   ;  Maybe you could draw the rectangle using an XOR-technique? That is:1. Draw the rectangle at current position using XOR2. Store that position3. When the position changes, redraw at last known position using XOR again4. Go to 1Don't know if you could use glLogicOp for this.   ;  I actually draw the rectangle by dragging the mouse.  How does it clean the last rectangle (in the middle of dragging) and redraw the previous as I'm drawing it?  Basically I don't want cascading rectangles based on my dragging the mouse to create a region.   ;  What I've done in the past is draw lines with a 1D texture applied.  I could then transform the texture in the U direction to create marching ants.Another way that I have done it is by drawing lines and using a line moving stipple http://msdn.microsoft.com/en-us/library/dd373930(VS.85).aspx;  I'll try your latter approach.  What do you mean by "using a line moving stipple"?  How do you do this?   ;  for example start with a bit pattern like this:1100110011001100and then transition like this:011001100110011000110011001100111001100110011001and then back to the start.  Notice the 1's move to the right   