I’ve been trying to draw images where the white bit is not drawn, and using the following code I get the white bits but not the coloured bits, but every other way I can combine this code in different orders gives me all black or no removal of white. Please, how do I do this to get rid of just the white.
opengl does not color-keying natively. maybe there’s an extension but i didn’t found it.
to draw sprites, the easier way is to add the alpha channel to your image, thus getting a RGBA image.
then, you enable alpha testing and draw your pixmap with glDrawPixels as usual.
you can choose to generate the alpha bitplane offline (ie outside your application, with photoshop/paint shop pro/whatever) or do it online, inside your app: while loading the RGB image, you check the incoming color, if it’s white, you set alpha=1 for that pixel, otherwise you set alpha=0.