Text Color...
Hi you all, i tried to use text in something that i''m doing and the output wasn''t the expected, i used nehe tutorials 13 (Bitmap Fonts) to output the text and the result was:
http://www.mistermav.hpg.com.br/pic.jpg
The source is:
int DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity();
... Drawing ...
// 2D to draw the text.
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glOrtho(0, 640, 0, 480, -100, 100);
glFrontFace(GL_CCW);
glDisable(GL_DEPTH_TEST);
if (light)
{
glDisable(GL_LIGHTING);
}
glRasterPos2f(5.0f, 5.0f);
glPrint("The text goes here.");
// Back to 3D
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
return TRUE;
}
Now the problem is that i can''t change the text color, i tried a call to glColor3f() before glPrint() but the result wasn''t the expected (as i expected).
Help me if you can.
Thank you.
Not even close
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
is what you are after.
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
is what you are after.
-----------------------
0wn 0wn 0wn your goat
gently down the pw33n
what u do u mean by ''bitmap fonts'' if u mean proper bitmaps then u need to disable texturing if u mean textured fonts then of copurse texturing needs to be enabled
http://uk.geocities.com/sloppyturds/gotterdammerung.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement