openGl glReadPixels in to ofImage

Hello everybody,

I am a beginner to OF and openGL. What I am trying to do is, generate an Alpha mask dynamically from
an openGL window and use it to mask video.

I have used glReadPixels

glReadPixels(0, 0, iViewport[2], iViewport[3], GL_RGBA,GL_UNSIGNED_BYTE, pBits);  

to read the GL window, now I want to convert pointer pBits to ofImage so that I can use it for masking.

Please help!!!

Thanks in advance…:slight_smile:

Did you ever find a solution to this? Thanks.