Rendering bitmap containing non-rectangular element.

Hello,

I was wondering what is the easiest way to render bitmaps, containing non rectangular elements, through opengl. For example, if I have a bitmap image containing a star, how would I render just the star portion of the image to the screen?

If have done this before in windows using bitblt and having a corresponding mask image. However, I would like to do this in gl now. I image this can be done through blending, but I am not quite sure where to start.

Thanks.
Mike

You’ll want to take a look at alpha blending. Read NeHe tutorial #8, its really short and really simple.

Old GLman

You can use the alpha channel as a mask for the areas that are to be transparent.

Is my demo call glBall on my website.
http://www.angelfire.com/linux/nexusone/

or on nehe.gamedev.net lesson 33 has an example

Originally posted by MikeH77:
[b]Hello,

I was wondering what is the easiest way to render bitmaps, containing non rectangular elements, through opengl. For example, if I have a bitmap image containing a star, how would I render just the star portion of the image to the screen?

If have done this before in windows using bitblt and having a corresponding mask image. However, I would like to do this in gl now. I image this can be done through blending, but I am not quite sure where to start.

Thanks.
Mike[/b]

Thanks everyone!