Nehe Lesson 13
Hi People, I triyed to run the code of Nehe Lesson 13 (Bitmap Fonts) and I got a problem.
Everything worked fine until I Put a Image on the Screen....
The Text disapeared!
To tell the truth, the text is always there (i think), but I can''t see it because it''s the same color of the BACKGROUND.
So, my question is: Why the Image change the color of my text? And how I could solve this problem?
I don''t know what to do... I tryed to change the color with glColor3f, etc but the text always stay with the stronggest color of the image.
That''s all! thanks a lot guys!!!
Greetings
I had the same problem -> see my post fonts & textures for details.
You can find it here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=76257
But I think you have to disable texture mapping, print the text you want and then enable it again.
Edited by - Spooky on January 25, 2002 3:36:19 AM
I had the same problem -> see my post fonts & textures for details.
You can find it here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=76257
But I think you have to disable texture mapping, print the text you want and then enable it again.
Edited by - Spooky on January 25, 2002 3:36:19 AM
Hello Spooky
Fernando: you could go to the link that Spooky posted. There's a *bit* of a discussion about this lesson.
Also, just try the thing below.
you say that setting glColor3f does not change solve the problem. IMO, you have to call glColor3f BEFORE glRasterPos, eg :
...
glColor3f( /*the color of the text*/ );
glRasterPos2i( /*the position of the text*/ );
glPrint( /*the text!*/ );
...
That's the way to go.
If you're doing like that :
...
glRasterPos2i( /*the position of the text*/ );
glColor3f( /*the color of the text*/ );
glPrint( /*the text!*/ );
...
Then there's a problem.
Edited by - vincoof on January 25, 2002 4:28:47 AM

Fernando: you could go to the link that Spooky posted. There's a *bit* of a discussion about this lesson.
Also, just try the thing below.
you say that setting glColor3f does not change solve the problem. IMO, you have to call glColor3f BEFORE glRasterPos, eg :
...
glColor3f( /*the color of the text*/ );
glRasterPos2i( /*the position of the text*/ );
glPrint( /*the text!*/ );
...
That's the way to go.
If you're doing like that :
...
glRasterPos2i( /*the position of the text*/ );
glColor3f( /*the color of the text*/ );
glPrint( /*the text!*/ );
...
Then there's a problem.
Edited by - vincoof on January 25, 2002 4:28:47 AM
i know that problem, too.
just type
glDisable(GL_TEXTURES_2D);
before and
glEnable(GL_TEXTURES_2D);
after the code that puts your font to the screen. (including its color-setting and glRasterPos2f)
if you read the former replies to your post and take care of their suggestions as well, everything should be working fine...
just type
glDisable(GL_TEXTURES_2D);
before and
glEnable(GL_TEXTURES_2D);
after the code that puts your font to the screen. (including its color-setting and glRasterPos2f)
if you read the former replies to your post and take care of their suggestions as well, everything should be working fine...
Thanks a lot Guys!!!! My code is running now!
How you said, I had to put glDisable(GL_TEXTURE_2D) before the printing code. Instead of this, the text I''ll put on the screen would be mapped with the current TEXTURE!!!!
:-)
How you said, I had to put glDisable(GL_TEXTURE_2D) before the printing code. Instead of this, the text I''ll put on the screen would be mapped with the current TEXTURE!!!!
:-)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement