PDA

View Full Version : elastic line



polo
02-01-2001, 12:54 AM
excuse me for my english
how do i need for create an elastic line
"a la autocad"

merci

chennes
02-01-2001, 06:34 AM
The best way I've found avoids OpenGL entirely... you can use low-level drawing commands to draw an XOR box on the screen from the original position that the user clicked the mouse to the current cursor position. When you draw the box, first draw the last box you drew over again (the XOR function will then "erase" the old box without the expense of a full redraw), then draw the new box.

Chris

Serge K
02-01-2001, 10:19 PM
or you can draw it in OpenGL with XOR logic operation:

glEnable( GL_COLOR_LOGIC_OP );
glLogicOp( GL_XOR );

And, of course, you have to draw it into front buffer:
glDrawBuffer( GL_FRONT );