pbuffer in OpenGLES for off screen rendering
I'm now using an image which I init with glTexImage2D with a NULL and subsequently call glTexSubImage2D. So my paint loop looks like this:
-bindtexture
-glTexSubImage2D
-drawtexture
-swapbuffers
glTexSubImage2D is not fast as it is not designed to be called repeatedly
in the render loop.
The docs point to something called a pbuffer, but I'll be darned if I can get it to work. The docs dont appear to match the descriptions or apis of any other
available google info.
So my question is how to properly set up a pbuffer and does it work at all?
Primarily, do I have to create a seperate surface using CreatePBuffer surface,
as well as my screen surface? If so then how to fast copy between the pbuffer surface and the screen surface and does this extra copy negate the benefits of using the pbuffer?
I've seen lots of sample code about the setup and attaching a texture to the pbuffer surface, but nothing that shows how to update the screen with this non screen surface.
Thanks for any insight
Mac OS X (10.5.2)