• Advertisement
Sign in to follow this  

bitmapped font changes color ! why ?

This topic is 4729 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Two problems with my fonts: 1. they come out as blue initially although I set them to green as you can see 2. then whenever I draw the textured cube at the bottom here the fonts are green. So how can I make them green when they are meant to be and for them to keep the color without changing ? Font Class functions: ====================== //set color void SetRGB(float red, float green, float blue) { r = red; g = green; b = blue; //print function I've misseds bits to to make it smaller CFont::Print(...) { glColor4f(r, g, b, a); glLoadIdentity(); glTranslatef(0.0f, 0.0f, -1.0f); glRasterPos3f(xpos, ypos, zpos); glListBase(callList-32); //was callList-32 glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); } GUI === font->SetRGB(0.0, 1.0, 0.0); //GREEN font->SetPos3D(-1.6f, 1.1f, -2.0f); font->Print("Rockets:%d",rocketsRemaining); Cube Draw (simplified to show just one quad- the other quads are teh same) ===== glPushMatrix(); glEnable(GL_TEXTURE_2D); //draw it !! glPushMatrix(); glBindTexture(GL_TEXTURE_2D, m_laserright); glBegin(GL_QUADS); glNormal3f(0.0, 0.0, 1.0); glTexCoord2f(0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f); // front face glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); glTexCoord2f(0.0f, 1.0f);glVertex3f(0.0f, 1.0f, 0.0f); glEnd(); glDisable(GL_TEXTURE_2D); glPopMatrix();

Share this post


Link to post
Share on other sites
Advertisement
you should make the color white before drawing texture just put glColor3f(1,1,1); before drawing the quad.
EDIT : i forget the font problem :P ,make sure your list doesn't call glColor before drawing the font

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement