[iPad-3]-[iOS 5.0]-[Objective-C]-[XCode 4.3.3]-[Cocos2D]-[openGL|ES 2.0]
I'm learning how to use openGL|ES 2.0 and have stumbled on Frame Buffer Objects (FBO)s
Info: I'm working with Cocos2D which has a lot of extra-fancy handling for drawing. I imagine that this may be linked with the issue. If the 'default' frame buffer for cocos is different from the actual default frame buffer that draws to the screen, this could result in a mis-draw
My Problem: in the init function of my "helloworld.m" class, if I place "glBindFrameBuffer(GL_FRAMEBUFFER, 0);" anywhere, I simply get a blank screen!
-(id) init
{
if( (self=[super init]))
{
CGSize winSize = [CCDirector sharedDirector].winSize;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
CCSprite * spriteBG = [[CCSprite alloc] initWithFile:@"cocos_retina.png"];
spriteBG.position = ccp(512,384);
//[self addChild:spriteBG z:1];
[self scheduleUpdate];
_mTouchDown = NO;
_mSprite = [CCSprite spriteWithTexture:_mMainTexture];
_mSprite.position = ccp(512,384);
[self addChild:_mSprite];
self.isTouchEnabled = YES;
} return self;}
Am I missing something basic and obvious?
As far as I've learned, the function "glBindFramebuffer(GL_FRAMEBUFFER, 0);" simply just setting the Framebuffer to 0 applies the default framebuffer that draws to the screen.