PDA

View Full Version : Problem: Opengl Fonts and Bitmap



06-14-2004, 04:19 AM
Hi, i started programming a game in Opengl and designed a background Image image in bmp format. I used this bmp as a texture to set it as background and then wanted to display a font as intro. But always when i want to draw fonts in a specific color, the background changes color as well and the font is not visible, cause the whole screen is colored.

Can anybody please help me or show me a sample code?

:(

ZbuffeR
06-14-2004, 09:05 AM
This will be easy. Just remember that OpenGL is essentially a statefull machine. That is, if you set a color to green, it wil stay green until you explicitely set it to something different, like white.

So :
glColor3f(1.0f,1.0f,1.0f);
<draw background>
glColor3f(0.0f,1.0f,0.0f);
<draw text>

If it does not help, please be more specific : how do draw your background and text (maybe show some code) ?