开发者

Framebuffer Object Problem

开发者 https://www.devze.com 2022-12-08 23:28 出处:网络
Hello I\'m programming in OpenGLES for the iPhone but I\'m currently stuck with a strange framebuffer object error.

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 teste开发者_运维百科d 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.)


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号