Raster Overlay Problems

I’m having problems drawing an overlay on an image. I’m trying to draw a cross-hair according to my mouse position. I can do this but when I set the color of my crosshair lines my image is drawn with this color also. In my case I’m trying to draw the lines colored yellow but my image is then drawn with a yellow tint as well. When I don’t set the color at all, the lines are drawn as white and the image isn’t tainted. I don’t have the source code available but here’s the basic idea:

drawImage();
gl.glSetColor3f(1.0f,1.0f,0.0f);
gl.glBegin(GL.GL_LINES);
gl.glVertex2i(0,mouseY);
gl.glVertex2i(imageWidth,mouseY);
gl.glVertex2i(mouseX,0);
gl.glVertex2i(mouseX,imageHeight);
gl.glEnd();

I’m thinking that I need to ‘unset’ the color somehow but I’m not sure how to do this. Any ideas?

Hi, I think you just have to set the color to (1.0, 1.0, 1.0) rgb value to have your image “untainted”.

In fact the image is tainted since you don’t draw the blue component with (1.0f,1.0f,0.0f) triplet.