View Full Version : elastic line
excuse me for my english
how do i need for create an elastic line
"a la autocad"
02-01-2001, 05: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.
02-01-2001, 09: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 );
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.