glColor3f isn't working!!!

Hi all!! I have a Vertex struct that has a member selected that is a bool and that surely is set to true! When my draw function will do it, it clears the color buffer bit, and tests if the bool is true, if so then calls glColor3f(1, 0, 0); //red
else glColor3f(1, 1, 1); //white
Then in the same take, draw glvertex3d() passing the coordinates of the vertex…
Resuming, the pixel is drawn white, the method glColor3f(red) is called!! Detail: it has 4 windows and in each it performs the same drawing in different views… Thanks for the help in advance!!! I hope you comprehend my English, cause it’s bad!!

Maybe you have a texture unit enabled w/o a texture bound to it or texture object 0. Try to disable all texture units.

Another explanation may be that lighting is on and glColorMaterial hasn’t been used to allow material edits by colors.

I don’t perform any enablings/disblings of texturing or lighting anyway… I use the default of GLUT… I remember another thing: I can’t test now cause I’m not on my PC: I call glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
Then, specifying glColor3f(1, 0, 0) and so on, would it be a mess? Would I rearrange any one of the parts and it would do it?? Thanks in advance!!

It’s better if you post some code snippet from the rendering function, your description is very confusing, or maybe it’s because I’m just off from work. No offense. :slight_smile:

That’s it!!! It’s done!!! When I generate one click with the mouse, it generates an event, and set the vertex selected = true. But when mouse button is released, it generates selected = false. I didn’t understood it, cause I debug it and selected was true… but adding a “if (state == GLUT_UP) return;” to my mouse function did it!!! This topic is over!!! Thanks!!! PS.: it has nothing to do with glColor3f and all…

Oh joy.

Originally posted by knackered:
Oh joy.
Tis the season to be jolly… Fala lala la… Ah forget it…

Originally posted by pedrodx
I have a Vertex struct that has a member selected that is a bool and that surely is set to true!
Obviously it wasn’t - try using your debugger in future.