开发者

Example from Chapter 1 of iphone 3D programming book not drawing to screen.

开发者 https://www.devze.com 2023-01-22 09:28 出处:网络
I\'m learning OpenGL-ES with 3D programming for the iPhone (O\'Reilly). Its first tutorial involves drawing the background of the screen grey. I\'ve entered in all the code to the letter and it runs w

I'm learning OpenGL-ES with 3D programming for the iPhone (O'Reilly). Its first tutorial involves drawing the background of the screen grey. I've entered in all the code to the letter and it runs without error, but I get no color...just black. Since it runs fine, there is no bug message.

There are a few very small source files and rather then post all the code here I've zipped up the project and made it available for download her开发者_如何学Goe. I don't know if it is too much to ask for people to look at, but I'm really pulling my hair out looking at code that executes without a hitch, but has no output.

Please let me know if I can be of any help to get to the bottom of this issue.

Thanks so much!


The problem is that you are trying to create your renderbuffer as a framebuffer. If you go to GLView's -initWithFrame: method and change the appropriate lines to read

glGenRenderbuffersOES(1, &renderbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, renderbuffer);

this renders just fine.

Are you sure this is the code from the book? It doesn't match what I have in the version in front of me. The author properly configures the renderbuffer in the book text.

0

精彩评论

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