How to copy pixel buffer to EGL pbuffer surface?

Hi All,

I want to copy a raw pixel buffer to pbuffer surface, just update its color buffer, but the color buffer of pbuffer surface is not accessable. Is there any way to access the color buffer?

Thanks.

At least one implementation has a vendor specific extension to that returns a pointer to the color buffer of the current surface. If you make your pbuffer surface current, you can retrieve its color buffer pointer through this extension.

Absent such an extension, the best approach we’ve found is to create a texture, load it from the pixel buffer using glTexImage2D then render a couple of textured triangles using ortho projection.

The only way I can think of is to create a gles texture, copy your pixels into the texture with glTexImage2D, and then render the texture into the pbuffer (e.g. render 2 triangles that cover the entire pbuffer).
-Acorn

In my previous reply, I forgot to mention that there is an OES_draw_texture extension supported by several implementations with which you can draw a texture into the color buffer. It’s quicker than drawing 2 triangles and you don’t need to change so much of the GL state to accomplish the drawing.