views:

783

answers:

3

Hello I'm programming in OpenGLES for the iPhone but I'm currently stuck with a strange framebuffer object error.

At first I was following a few tutorials from Simon Maurice: http://web.me.com/smaurice/AppleCoder/Welcome.html

But then I moved on to do a few experiments of my own before continuing with other tutorials, however my experiment has hit a problem. What I was trying to do was make the EAGLView the view of a ViewController and this worked perfectly fine when the base code was originally from the tutorials.

Since EAGLView is a subclass of the UIView it's not too hard to do this, so continuing on with the experiment I wanted to do it with a clean slate. I created a new project in Xcode with the Windows-based Application project and created a new EAGLView and a ViewController to do the same task as the previous project.

However after compiling and running the view comes up white and the console outputs the "failed to make complete framebuffer object %x" error during the createFramebuffer process. (Error console output: "GLController[2071:207] failed to make complete framebuffer object 0").

I first thought it was my code so I ripped the working code from the previous project into the new project and still receive the same errors. At the same time I moved the new projects code into the old project and compiled with a successful output.

I'm confused to why the same code won't work correctly in a new project yet the new code will work correctly in the old project. If someone knows what I am missing it would be greatly appreciated.

Thanks.

(Also tested with several EAGLViews from Apple sample codes and the same error occurs on the new project, but does not occur on the old project with a ViewController attached.)

A: 

there has been a change in opengles template program from the last Iphone SDK to the current one. There is support code written for choosing between ES2.0 and ES1.1

please note that.

Quakeboy
I thought of that too, used the new OpenGLES template for my test and it also failed to work. Except when copying all the EAGLView and related classes such as the ES1 and ES2 Renderer from the sample template works perfectly fine in the old project. It does not seem to want to work the other way (Moving the ViewController classes into the new SDK OpenGLES template).
Wesux
+2  A: 

I've run into a similar problem when trying to set an EAGLView as the view of a viewController. Instead, attach the viewController's view property to a standard UIView. Then, later on, when the view has successfully loaded (perhaps in the viewController's viewDidLoad method), instantiate an EAGLView and add it as a subview to viewController.view.

sb
A: 

Shot in the dark here, lacking more info about what you've done, but...are you instantiating your EAGLView via IB (and thus going through -initWithCoder:), or programmatically (-initWithFrame:)?

If you look at EAGLView.m, you'll see that only -initWithCoder: does the actual initialization required. It is very easy to migrate that initialization code to a shared (or -initWithFrame: only) initializer.

Josh Bleecher Snyder