Page 1 of 1

surfaces and openGL

PostPosted: Sep 18, 2009 @ 3:34am
by jrhee
I implemented a menu system with scrolling panes which makes heavy use of blitting surfaces onto one another before displaying on screen (e.g. menu items are drawn onto a surface with an offset, and the surface is then drawn on screen). I'm trying to make the switch to openGL to run on iPhone, but am running into the problem where the surface needs to be uploaded on each frame to reflect the change to scrolling position. Is there any way to work around this to have the updated surface displayed immediately without the performance impact of uploading to openGL on each frame?

PostPosted: Sep 24, 2009 @ 9:59am
by edge
Hi,

The alternative to uploading textures each frame is to use the render-to-texture feature on the iPhone.

To implement this you need the following API's:
glGenFramebuffersOES
glGenRenderbuffersOES
glRenderbufferStorageOES
glFramebufferRenderbufferOES
glBindFramebufferOES
glFramebufferTexture2DOES
glCheckFramebufferStatusOES