Archived

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

Mr_Mav

Text Color...

Recommended Posts

Mr_Mav    122
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.

Share this post


Link to post
Share on other sites
Maximus    124
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

Share this post


Link to post
Share on other sites
zedzeek    528
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

Share this post


Link to post
Share on other sites