Can someone please explain why (1.0f,1.0f,1.0f) is not white?

Hi.

I am getting slightly frustrated at a seemingly simple problem. I am drawing a set of lines with the color 1.0 1.0 1.0, expecting them to be white. But they’re not. I am rendering several components with different z indexes, and the color of my lines change depending on where in my code I render them. Now I would understand why this happened, if setting my color multiplied it with some strange color settings already in my matrix, but I have checked, double checked, and triple checked that I dont. I even changed everything to push,load,render,pop, to make sure any rendering occurs on a clear matrix. Yet the color varies, depending on when I render it. Am I missing something vital, or just overlooking the obvious? I did not want to write this on a board, ashamed as I am, but at this stage, I am getting too frustrated :wink:

A stab in the dark, but have you glDisable( GL.GL_LIGHTING )?

I had not explicitly, but tried that now. To no avail, sadly. Enabling it turns my entire screen black, so I figure it was off by default :wink:
Thanks for trying though!

Ah. I had to disable Textures! That makes my color correct :wink:

But I have to explicitly enable them again afterwards? It doesnt seem to be enough to pop the current matrix (which disabled them). Why is this so?

pushmatrix and popmatrix should have no influence on the current texture-state.
use
gl.glDisable(GL.GL_TEXTURE_2D); to disable texturing and
gl.glEnable(GL.GL_TEXTURE_2D); to enable texturing.

Right. My bad. I’ve been going blind over my own stuff lately. Thanks.

You can however also push and pop state attributes: http://www.talisman.org/opengl-1.1/Reference/glPushAttrib.html