fbo on iPhone


I have an iPhone app, that converts a photo into a lot of crosses. The area they appear is bigger than the screen, so I added scroll functionality but since I have to render a lot of lines in every frame. The app is quite slow…

So I thought I could use an offscreen framebuffer, render my content onto it and just translate the resulting texture around. This would also help me add the functionality of saving an image to the iPhone library.

After stumbling upon this post: http://forum.openframeworks.cc/t/fast-screen-buffer-w-feedback/2356/0, I tried to adapt the ofxFBOTexture to use with the iPhone, since the poster sadly did not share his modified version.

I mostly replaced EXT with OES and the addon compiles for the iPhone now.

But whenever I want to allocate the fbo, glCheckFramebufferStatusOES returns false. I copied several examples over but always go the same result…

I have uploaded the modified files here and here. Maybe somebody already set up a framebuffer on the iPhone and is willing to take a look?


oh - I just did the same thing.
I had to add some code because the OF iphone code uses a render buffer object and the normal fbo code messes with it.

Hope that works for you


Yes, your files work.



Can I use RGBA with the iphoneFBO?

I can’t do myFBO.allocate(640, 480, GL_RGBA32F_ARB);
myFBO.allocate(640, 480, true);

I would like to use alpha but as soon as i draw two circles with alpha, it only draws the last one.


ok the alpha seems not to be the problem.

i am trying to draw two shapes with different colors but they both either have the same color or one is not drawn.

myFBO.allocate(320, 480, true);  
void testApp::draw() {	  
	ofSetColor(0, 255, 255);  
	ofCircle(200, 200, 50);  
	ofSetColor(0, 0, 255);  
	ofRect(100, 100, 10, 10);  
	myFBO.draw(0, 0, ofGetWidth(), ofGetHeight());