Advertisement

Problem with the text color

Started by November 28, 2001 06:42 PM
11 comments, last by Badone 23 years, 2 months ago
Hi, I''m trying to make a game for an extra credit project in math at school. It''s kind of like a quiz review game. The problem I''m having is all the text is black. I can see it, since I have a model behind it, but it won''t turn white. Right before I draw the text I have glColor3f(1.0f,1.0f,1.0f);. Any help would be greatly appreciated!
How are you drawing the text? If you''re using any of the Win32 API functions such as TextOut or DrawText you must, of course, use the appropriate color functions (SetTextColor and SetBkColor, I believe) in the Win32 API; since OpenGL is not part of the Win32 API, OpenGL drawing has nothing to do with the Win32 API and vice versa (with the exception of the wgl-prefixed functions).
Advertisement
One problum may be that
glColor3f(1.0f,1.0f,1.0f) is black...pretty sure.
try

glColor3f(0.0f,0.0f,0.0f)

I am pretty sure about that!
Nope, (0, 0, 0) is black. Since, 0-1 ranges darkest to lightest, or to be exact, lowest saturation to highest saturation of color.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
ok my bad, wasn''t sure
I''m drawing the text using nehe''s 13th tutorial, Bitmap fonts.

http://nehe.gamedev.net/tutorials/lesson13.asp

Advertisement
Er, post your draw code.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
I edited it a little bit so it didn''t have the counters and stuff.
	glColor3f(1.0f,1.0f,1.0f);	glRasterPos2f(-0.1f, 0.0f);	glPrint("What is the answer to 2+2?");	glRasterPos2f(-0.1f, 0.3f);	glPrint("A) 4    B) 5"); 
Hmm.. That SHOULD work. But I''m sure you know that. So let''s try something more helpful. Have you by any chance tried any OTHER colors? Also, make sure the texture you use has the text white.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Hmm. That''s pretty screwy. The only thing I can think of is maybe the texture environment is somehow not correct. GL_MODULATE should be what you''re using, if I''m not mistaken. I''ve never managed to get glRasterPos to do what I thought it was supposed to do, but I''m more curious about glPrint; as far as I know, it''s not part of OpenGL, so, assuming that''s true, I know nothing about it...

This topic is closed to new replies.

Advertisement