Apple's GLSprite OpenGL ES Sample App

Posts: 2
Joined: 2009.04
Post: #1
I am going through Apple's GLSprite OpenGL ES sample app attempting to figure out how the code works.

In EAGLView.m there is method createFrameBuffer:

- (BOOL)createFramebuffer
    glGenFramebuffersOES(1, &viewFramebuffer);
    glGenRenderbuffersOES(1, &viewRenderbuffer);
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
    glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
    [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer];
    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
        NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
        return NO;
    return YES;

What do the procedure calls glGenFramebuffersOES and glGenRenderbuffersOES do?

I see they are in Apple's OpenGL ES framework (OpenGLES.framework/Headers/ES1/gl.h), but I can't find either in Apple's documentation under Xcode, on their Developer site or in the man pages on, which makes it difficult figuring out how the code works.
Quote this message in a reply
Posts: 86
Joined: 2008.04
Posts: 2
Joined: 2009.04
Post: #3
Cool, thanks!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Possible bug in Apple's touch handling? Jamie W 1 3,190 Feb 23, 2011 03:52 PM
Last Post: Jamie W
  How do I add a UIViewController to GLSprite? Rasterman 0 2,808 Sep 20, 2010 11:49 AM
Last Post: Rasterman