OpenGLES Framebuffer issue


#1

I am rendering the charts in a UIScrollView. This works as expected in the Simulator and a current-gen iPod touch. However this crashes on an iPhone 4 with the following log:

 

Failed to make complete framebuffer object, make sure your view size isn’t too big for the device. 0x8cdd

2013-04-29 13:39:04.278 MSPatient[1233:907] GL Error: 

From: SChartGLView

 

The size of my chart is (height of device) x 500, I am rendering in landscape. How can I avoid this issue without making my view an OpenGLES view and releasing the frame buffer myself? I would like to continue using UIKit elements in my view (UIScrollview, UINavigationBar, etc.)


#2

Hey there,

Xcode considers an iPhone 4/4s to have an effective area size of 320 x 480 - if you’re in landscape, a width of 500 would take you 20px outside of the visible screen area. The new iPod touch models have 320 x 568 retina screens and it’s likely your simulator has defaulted to 4" iPhone of the same screen size.

OpenGL forbids the creation of a framebuffer for an area larger than the screen for the chart, as you’ve seen, limiting the size of the chart you can create. However, the chart itself is like a scrollview in that you can pan and zoom around. I like to think of a chart as a ‘window on your data’ and whilst it is of finite size, panning and zooming should allow you to present any view on it that you require.

I hope this helps!

Simon