tags:

views:

37

answers:

1

Right now I'm drawing a cube with OpenGL, I'm using Windows and WGL context. I have blending enabled so my cube looks semi transparent. Basically the background == the clear color (Black). I'd like to be able to save the image in raw RGBA format which I can then make into a png. I basically want the cube to blend in with a NULL background (0,0,0,0). How could I save the OpenGL output and have the background color be (0,0,0,0) (transparent) Without using a color mask (like 255,0,255).

Thanks

+1  A: 

Just draw the cube, setting the clear color to (0, 0, 0, 0), and save the output using glReadPixels.

Matias Valdenegro
Great! Thanks!!
Milo