I have been experiencing an odd result when rendering with GL_COLOR_LOGIC_OP enabled.
The problem is as follows:
First I render a fairly large terrain surface in 2d. Once the surface has been drawn, I want to be able to draw a few simple lines on top of the surface without having to re-draw the surface. Using overlay planes was not an option, so I am using the following bit of code to draw the lines:
glDrawBuffer( GL_FRONT );
glEnable( GL_COLOR_LOGIC_OP );
glLogicOp( GL_COPY );
// draw a few lines
glDisable( GL_COLOR_LOGIC_OP );
glDrawBuffer( GL_BACK );
This works as expected (the lines are visible on the surface ) except when I swap between the front and back frame buffers.
I expected the lines to be drawn into the front frame buffer, thus requiring an eventual re-draw of the surface to clear those lines from that buffer. However if I swap the buffers twice, the line will no longer be visible. I do not understand why the front buffer is not modified by the line drawing. Any ideas?