I''m using textured font to draw text over my background scene. I use a black and white texture with anti-aliased characters and an alpha channel to make the black part transparent. It works fine but i''d like to be able to change the text color without having to load anything else (ie replace the white of the character by another color). Of course the text should still be blended correctly with the background. Is there a simple way to do this?
provided u have the alpha channel of the etxture setup well use glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glDisable( GL_LIGHTING ) glColor4f(1,0,0, 1) // for red glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA. GL_ONE_MINUS_SRC_ALPHA )