gldrawpixel to quad

Hi,

Does anybody know how to go about loading a small png image (say 8x16 pixel rectangle) and displaying it as a textured quad at a specific location on to a glcanvas?

I have read that textured quads are faster for graphics rendering than gldrawpixels but
1. I do not know why they are faster (or even how much faster I would expect them to be) and
2. I can’t seem to find any examples from web sources or books that I can understand or will get me started - there is a lot of info on the subject but I’m still none the wiser after wading through it :-[

Any help appreciated.

Regards,

Sally

Are you trying to make an overlay? Some sort of HUD?

For loading the png image, you can get that out of Lesson 6 at nehe.gamedev.net. Source is included in that jar.

To place the quad, you’ll want to enter orthographic mode and turn off the zbuffer before drawing.

You’ll also want to calculate the position of the quad based on screen resolution.

Both NeHe and GameTutorials have masking examples. Perhaps what you’re looking for is there.

Textured quads would be several times faster. If you need more speed you can merge the textures and batch up the quads in vertex arrays.