transparent color into Bitmap

Hello,

I would like to draw one bitmap by using the fallowing instruction:

glDrawPixels( theH, theV, GL_RGB, GL_UNSIGNED_BYTE, thePicture);

That function well. Now, I would like to “not draw” (transparent) one color from my bitmap (Ex: I no want the draw function draw the 0xFF, 0xF0, 0XF0 color).

Please, I hope someone can help me because I’m a dummy on OGL

Thanks fro your reply and help.

Cheers,
Stef

Are you wanting to make a sprite type object?

If so, DrawPixels is not the best way to go about it.

But by using textured mapped quads and the alpha channel to create a transparentcy map.

Look at nehe.gamedev.net lesson number 32 or 33 is on making sprites in opengl for games.

Originally posted by ijonesfr:
[b]Hello,

I would like to draw one bitmap by using the fallowing instruction:

glDrawPixels( theH, theV, GL_RGB, GL_UNSIGNED_BYTE, thePicture);

That function well. Now, I would like to “not draw” (transparent) one color from my bitmap (Ex: I no want the draw function draw the 0xFF, 0xF0, 0XF0 color).

Please, I hope someone can help me because I’m a dummy on OGL

Thanks fro your reply and help.

Cheers,
Stef[/b]

Alternatively, make the image 32-bits deep and use the GL_RGBA format. Then you can specify the transparency in the alpha channel. Set it to 0 for transparent pixels and 255 for opaque ones.
Set glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), enable blending and draw the image.

Don’t forget to disable blending afterwards or the Earth will spiral into the sun.