View Full Version : How can I use fonts w/o changing the texture's color?

04-11-2003, 07:42 AM
I bind the texture, draw quad, set color, then draw font, and.. the texture's color is affected. Why?
I use ortho mode, the texture is bmp.
Please help! (I code in C++)

04-11-2003, 09:43 AM
perhaps you should disable GL_TEXTURE_2D before the output of that font?!....

04-11-2003, 04:24 PM
nope.. thanx, though.

04-11-2003, 04:52 PM
Which parameter do you set with glTexEnv(GL_TEXTURE_ENV_MODE, ???) ... try GL_REPLACE. Default is GL_MODULATE.

04-12-2003, 02:08 AM
"undeclared identifier"
is my opengl version outdated? Where should I download the upgrade?

04-12-2003, 03:18 AM
call: glColor3f(1.0f, 1.0f, 1.0f) before you draw your text...

...hope this solves your problem!

---------------------- http://nomad.openglforums.com

04-12-2003, 05:54 AM
the texture is in original color (YAY!), but I can't see the fonts (T_T). Also that means the fonts are always be white??
My program goes like this: main loop calls render scene function. Inside the render scene first it loads the background texture, then draw the fonts. So the BG is loaded over and over again. Cause if I just load it once, it would blink and gone. then the fonts are visible.

Or should I just make textures for the fonts? (OH MY GOD)

04-14-2003, 02:40 AM
Probably you forgot to restore the color after the first loop , and with the useage of GL_MODULATE this color will affect your texture appearance ...so you must

restore your color after rendering the font ( i.e glColor3f(1.0,1.0,1.0) .... to get white color)

or use GL_REPLACE in yout texture enviroment setting.

[This message has been edited by raverbach (edited 04-14-2003).]

04-14-2003, 02:43 AM
I can´t understand , but now you´re rendering things correct but can´t see the fonts ?

If it´s that try disabling the texture units that you´re using then render the fonts.

04-16-2003, 02:13 AM
thanks!! You're right, i forgot to change the color back to white.
I am now using LMNOpc Bitmap Font Builder. (I didn't even know that such program exists http://www.opengl.org/discussion_boards/ubb/smile.gif )
Thank you so much for your helps! Sorry if i troubled you. i'm new in programming.