Hiya, bit of a problem with colouring my fonts in my scene, they draw correctly (That is on top of everything) but the problem is they are black, despite the presence of a glColor3f statement with 1.0f, 0.0f, 0.0f as paramaters. I''ve pasted the drawGLScene code below so you can see, if you''d care to look

int DrawGLScene(GLvoid)
{
/* Movement Variables */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear screen in color selected in InitGL() function
glMatrixMode(GL_MODELVIEW); // Set Matrix To ModelView
glLoadIdentity(); // Resets Co-Ordinate system.
glBindTexture(GL_TEXTURE_2D, bmptexture[0]); // Bind Space Texture
DrawSpace(); // Draw the Space Texture
glEnable(GL_LIGHTING); // Enable Lighting (Turn it ON)
CameraView(x_cam, y_cam, z_cam, roll_cam, pitch_cam, heading_cam); // Start Position
glTranslatef(0.0f, 0.0f,-25.0f); // Translate 25 units into the screen
for (loop=0; loop<10; loop++)
{
glPushMatrix(); // Store Current Position
Light_1_Setup(); // Set Light Position Relative To Scene (Otherwise Light will move with viewport transformation)
glEnable(GL_LIGHT1); // Enable Light1.
// glColor3f(0.0f, 0.0f, 1.0f); // Alter To Change Color Of Scene (or Planet) 1 , 1 , 1 is default
// Auto loaded by scene
// glPolygonMode( GL_FRONT, GL_LINE ); // Sets Back Polygons to Line Mode
// glPolygonMode( GL_BACK, GL_LINE ); // Sets Front Polygons to Line Mode
// glDisable(GL_TEXTURE_2D);
glRotatef(planet[loop].selfmove, 0.0f, 1.0f, 0.0f);
glTranslatef(planet[loop].distance, 0.0f, 0.0f);
glRotatef(planet[loop].bodymove, 0.0f, 1.0f, 0.0f);
glRotatef(-90, 1.0f, 0.0f, 0.0f); // Rotates so Spheres are Drawn the correct way up
if (planet[loop].atmos_phere != 0)
{
glEnable(GL_BLEND);
glDepthMask( GL_FALSE ); // Turn Depth Buffer Writes OFF
glBindTexture(GL_TEXTURE_2D, bmptexture[planet[loop].atmos_texid]);
DrawSphere(planet[loop].radius + 0.05f, 32, 32);
glDepthMask( GL_TRUE ); // Turn Depth Buffer Writes ON
glDisable(GL_BLEND);
}
glBindTexture(GL_TEXTURE_2D, bmptexture[planet[loop].texture]); // Select Texture[0]
DrawSphere(planet[loop].radius, planet[loop].sub_x, planet[loop].sub_y);
if (planet[loop].name == "Saturn") // Draws Saturns Rings
{
glBindTexture(GL_TEXTURE_2D, bmptexture[planet[loop].texture]);
glEnable(GL_BLEND);
DrawCylinder(1.5f, 1.5f, 0.05f, 32, 32);
DrawDisc(planet[loop].radius + 0.05f, 1.5f, 32, 32);
glDisable(GL_BLEND);
}
glPopMatrix();
/* Start Draw Particle Here */
glPushMatrix(); // Store The Current Matrix Settings
glDisable(GL_LIGHTING); // Disables Lighting
glEnable(GL_BLEND); // Blend The Particles
glDepthMask(GL_FALSE); // Disable Depth Buffer Writes
DrawSunRing(); // Calls Draw Sun Ring Function
// DrawParticle();
glColor3f(1.0f, 1.0f, 1.0f); // Reset Scene Color
glDisable(GL_BLEND); // Disable Blending
glDepthMask(GL_TRUE); // Enable Depth Buffer Writes
glEnable(GL_LIGHTING); // Enable Lighting
glPopMatrix(); // Restore The Matrix Settings
/* End Draw Particle Here */
planet[loop].bodymove = planet[loop].bodymove + planet[loop].bodyrot;
planet[loop].selfmove = planet[loop].selfmove + planet[loop].selfrot;
if ( planet[loop].selfmove > 360)
{
planet[loop].selfmove = 0.0f;
}
}
glDisable(GL_LIGHTING); // Disable Lighting (Turn it OFF)
// ** Font Drawn To Screen Here **
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glTranslatef(0.0f, 0.0f,-25.0f);
glRasterPos2f(0.0f, 0.0f);
glColor3f(1.0f, 0.0f, 1.0f);
glPrint("Blah Blah Blah Blah");
glColor3f(1.0f, 1.0f, 1.0f);
glEnable(GL_DEPTH_TEST);
return TRUE;
}
Some stuff is commented out because its a direct C&P job

Sorry about that, I hope you can understand it . Also, the code for the font printing is from NeHe''s tutorial 13

Any help much appericated.
Plates.