View Full Version : Sprite

Leyder Dylan
01-16-2001, 07:28 PM

I want to display a logo on my OpenGL program. My logo is a black BMP with the logo in white. You know what I mean I hope.
Example : a cross-hair in on a black BMP.

My question is :

How can I do to put the alpha value for black at 1.0 for only displaying my logo in white ?

Thanks in advance.

01-18-2001, 03:10 AM

prompte your bitmap to RGBA, and for each pixel p, set p.alpha=1.0 if p is white, otherwise set to 0.0

well, if you want the WHITE to show through. change over 1.0 and 0.0 if you want the reverse.


01-18-2001, 04:57 AM
Maybe I'm wrong but if the texture is black with a white logo and you just want the logo to see trhu, u can set the glBlendFunc to GL_ONE_MINUS_SRC_COLOR.

It should work without any picture modifications.


Serge K
01-18-2001, 01:10 PM
glBlendFunc( GL_ONE, GL_ONE );

01-18-2001, 01:48 PM
Gads, yes. I should have thought of that, too. <smacks forhead>