Archived

This topic is now archived and is closed to further replies.

Adding Color Help.

This topic is 5310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Ive got a game full of texture mapping and with bitmapped fonts in the top corner of the screen. The problem is that when i add color to the fonts say...green, the whole textures get a green highlihgt (Like The Matrix Movie exactly). i.e.
glPushMatrix();
glColor3f(0.0,0.0,1.0);
//fonts
glPopMatrix();

//Have tried removing the push and pop matrix too but didnt work
 
Thanks For Your help

Share this post


Link to post
Share on other sites
are your fonts also intended to be texture mapped?

it may be worth disabling the textures before you draw all the fonts, and then re-enabling it afterwards?

e.g.

glDisable(GL_TEXTURE_2D);
glColorf(0.0f, 0.0f, 1.0f);
// do fonts here
glEnable(GL_TEXTURE_2D);

Share this post


Link to post
Share on other sites
You''ll have to restore the color after rendering your fonts:

glColor3f(0.0f, 0.0f, 1.0f); // Change to render green fonts
RenderFonts(); // Render fonts
glColor3f(1.0f, 1.0f, 1.0f); // Change back to white

Share this post


Link to post
Share on other sites
quote:
Original post by Count_Zero
are your fonts also intended to be texture mapped?

it may be worth disabling the textures before you draw all the fonts, and then re-enabling it afterwards?

e.g.

glDisable(GL_TEXTURE_2D);
glColorf(0.0f, 0.0f, 1.0f);
// do fonts here
glEnable(GL_TEXTURE_2D);


YES!!! Thanks Allot that solved the problem.

Share this post


Link to post
Share on other sites
quote:
Original post by James Trotter
You''ll have to restore the color after rendering your fonts:

glColor3f(0.0f, 0.0f, 1.0f); // Change to render green fonts
RenderFonts(); // Render fonts
glColor3f(1.0f, 1.0f, 1.0f); // Change back to white

And thanks for that too. Solved another problem before i was going to have it

Actually i knew it would be somehting like that too but didn''t what color to change it back too

Share this post


Link to post
Share on other sites