PDA

View Full Version : XOR Rubberbanding troubles...



chennes
07-06-2001, 03:22 PM
Okay, when I execute this code, it draws a rectangle XORed with the clear color (the screen is otherwise blank...) The problem is that it doesn't XOR with itself (which kind of defeats the purpose). I just end up with a big blob of XOR smeared across the screen...




//Draw the rectangle...
glColor3f(1,1,1);
glDrawBuffer(GL_FRONT);
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glOrtho(0, width(), 0, height(), -1, 1);

glRecti(x1, height() - y1, x2, height() - y2);

glDrawBuffer(GL_BACK);
glDisable(GL_COLOR_LOGIC_OP);
glPopMatrix();


Any help would be appreciated,
Chris

[EDIT - bloody code tags... I never get them right the first time http://www.opengl.org/discussion_boards/ubb/smile.gif]

[This message has been edited by chennes (edited 07-06-2001).]