• Advertisement

Archived

This topic is now archived and is closed to further replies.

Wrong Color on "Bitmap Fonts"

This topic is 5789 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

Im using NeHe's "Bitmap Fonts" example in my project, And it will change colors or become darker based on what i render before the text. How can i fix this? [edited by - slashandburn on April 18, 2002 6:07:28 PM]

Share this post


Link to post
Share on other sites
Advertisement
If you render it and before you use glColor*, then you have to call glColor3d(1,1,1) to make it original. If you render it with materials, then you need to disable lighting before rendering and then after enable it, and use glColor3d(1,1,1) as well if you used it before anywhere.
Cheers.

" Do we need us? "


Ionware Productions - Games and Game Tools Development

Share this post


Link to post
Share on other sites
This is my code, What could bewrong?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


glLoadIdentity();
glTranslatef(0,-1,-6);
glCallList(miscmesh[17]);

glLoadIdentity();
glTranslatef(0,-1,-6);
glCallList(miscmesh[19]);

glLoadIdentity();
glTranslatef(0,-1,-6);
glCallList(miscmesh[20]);

glLoadIdentity();
glTranslatef(-3.4,2,-10.0);
glCallList(rustmesh);

glColor4f(1.0f,1.0f,1.0f,0.5f);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);

glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);

glLoadIdentity();
glTranslatef(0,-1,-6);
glCallList(miscmesh[18]);

glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);


//glDisable(GL_DEPTH_TEST);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-10.0f);
glColor3f(1.0, 0.0, 0.0);
glRasterPos2f(-5.25,3.4);
glPrint("Land : ");
glPrint(data.info.name.c_str());
glRasterPos2f(-5.25,3.18);
glPrint("Fish : ");
glPrint("%3i",data.info.numberfish);
glRasterPos2f(-5.25,2.98);
glPrint("Evil : ");
glPrint("%3i",data.info.numberpred);
glRasterPos2f(-5.25,2.78);
glPrint("Info : ");
glPrint(data.info.description.c_str());

Share this post


Link to post
Share on other sites

  • Advertisement