views:

25

answers:

1

Hello kind people,

I'm currently trying to learn opengl-es using O'Reilly's 3D programming for the iphone. It's 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. Thing is I get no color... just black.

What makes this such a hard problem to solve is that there is no bug message. It runs fine!

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 here. 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!

+1  A: 

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.

Brad Larson
@Brad, THANK YOU SO MUCH!! I feel a bit foolish as it was completely a copying error, but sometimes you just need that extra set of eyes. I really do appreciate the help. Thanks again!
Eric Brotto