Text color problem

i’m puting a bitmap text into my project and I’m unable to correctly change the color of it
code:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glOrtho(-1.0f,1.0f,-1.0f,1.0f,1.0f,-1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3f(1.0f,1.0f,1.0f);
glRasterPos3f(-0.8f,0.8f,0.0f);
while(*p!=’\0’) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,*p++);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
gluPerspective(60,ratio,0,200);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3f doesn=t work correctly -i’ve got only dark green and black color

Make sure your rasterpos is called after your color in your actual code.

rasterpos is called after glcolor as you can see in code(just copy and paste) and it’s working but only those 2 colors

But dorbie is right

The raster position attributes, just like vertex attributes (color, fog coord, tex coords) ‘latch’ into place when the glRasterPos call is issued. Calling glColor after glRasterPos has no effect (except, of course, for subsequent glRasterPos/glVertex calls).

It’s working now but i’ve got a problem with white color i think it should be 1,1,1 but i always get green-my last texture before i do bitmap operations is green could that be somehow connected to that?

Pixel transfers (glDrawPixels/glBitmap) are affected by the complete fragment processing stuff, ie textures, fog, blending, alpha test. Texturing and fog probably have little utility in most cases, but that’s how it is.

So you need to (temporarily) disable what you don’t need.

Thanks a lot with disabled texture_2d it’s working fine