View Full Version : Question about displaying a bitmap while drawing other stuff on top of it
Malarkey
2005.05.01, 08:14 PM
Okay, so here's my current problem: I have a bunch of white 2D sprites that I draw on the screen that I use glColor to change them to whatever color I need. Behind all of these sprites (which are really just quads with textures bound to them), I'm drawing a background image (again, just a quad + texture). The problem I'm having is that the background image is being colored by whatever glColor call I used last. I've poked around at some tutorials and stuff but the solution to my problem is not immediately clear to me. Is there something in the docs or tutorials that I'm just overlooking or what?
Puzzler183
2005.05.01, 08:17 PM
Call glColor4f(1.0f, 1.0f, 1.0f, 1.0f); before drawing the background. That way, it's not modulated with any color.
Duane
2005.05.01, 09:21 PM
I think glLoadIdentity also does that.
Puzzler183
2005.05.01, 09:44 PM
I think glLoadIdentity also does that.
glLoadIdentity will reset the current matrix. Usually this is the GL_MODELVIEW matrix and thus won't affect color, however if you use the color matrix, this will make sure your bitmap is loaded correctly (it applies only on loading textures and doing things like glReadPixels).
Malarkey
2005.05.02, 02:39 AM
Cool. Thanks for the tip.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.