I’m trying to make a very simple menu handler and am trying to draw a button-like thingy. However, the text of the button is ALWAYS drawn behind the button. I disabled depth testing, tried to draw the text before the quad aswell as after it… what am I missing?
for (i=0; i< numButtons; i++)
{
if (buttons[i].visible)
{
glRasterPos2f( buttons[i].x + (buttons[i].w/2), buttons[i].y + (buttons[i].h/2));
glColor3f( buttons[i].r, buttons[i].g, buttons[i].b); //color for text
The raster position has it’s own color, which is taken from the current color at the point you call glRasterPos. So changing current color with glColor after glRasterPos will not affect the color used by the raster position. When calling, say, glBitmap, the color used may not the color last set by glColor, but the color that was current when glRasterPos was last called.
So in your case, assuming your text is bitmap text, the color of the button and the text will be the same.
[This message has been edited by Bob (edited 01-13-2003).]