String output questions

I am using the following code to draw text to the screen:

outputString ( float x, float y, char *string )
{
int length;
length = strlen ( string );
glRasterPos2f ( x, y );
for (int i = 0; i < length; i++ )
glutBitmapCharacter (GLUT_BITMAP_HELVETICA_18 , string[i] );
}

And then in my code, changing the viewmode to 2d and calling the function:

outputString(0, 0, “TEXT OUTPUT TEST”);

I have two questions if anyone can help me?

1: How do I change the color of the text on the screen, with light off, it is brown and when lighting is enabled, it is a browny color (yuk). I have tried glClearColor and glColor3f but to no avail.

  1. When I change the two co-ordinates passed in, even though I beleive it to be the x,y co-ords of the text on the screen, it is always on the x=0 plane. Hmmmn.

Sorry, I meant the x=0 plane ) The up/down center.

When you draw your text and disable GL_COLOR_MATERIAL and GL_LIGHTING.

Then set your text color with glColorf.

Not sure what you mean about X plan problem??

[This message has been edited by nexusone (edited 02-02-2004).]