Skip to content

Commit 4cb674d

Browse files
committed
Re-bind the color render buffer before presenting.
1 parent fd20cd4 commit 4cb674d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cocos2d/Platforms/iOS/CCGLView.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@ -(void)presentFrame
367367
GLenum attachments[] = {GL_COLOR_ATTACHMENT0};
368368
glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 1, attachments);
369369
}
370-
371-
glBindRenderbuffer(GL_RENDERBUFFER, [_renderer colorRenderBuffer]);
372-
373370
}
374371

375372
// not MSAA
@@ -379,13 +376,17 @@ -(void)presentFrame
379376
}
380377
}
381378

382-
if(![_context presentRenderbuffer:GL_RENDERBUFFER])
379+
glBindRenderbuffer(GL_RENDERBUFFER, [_renderer colorRenderBuffer]);
380+
381+
if(![_context presentRenderbuffer:GL_RENDERBUFFER]){
383382
CCLOG(@"cocos2d: Failed to swap renderbuffer in %s\n", __FUNCTION__);
383+
}
384384

385385
// We can safely re-bind the framebuffer here, since this will be the
386386
// 1st instruction of the new main loop
387-
if( _multiSampling )
387+
if( _multiSampling ){
388388
glBindFramebuffer(GL_FRAMEBUFFER, [_renderer msaaFrameBuffer]);
389+
}
389390

390391
// Check the fences for completion.
391392
for(CCGLViewFence *fence in _fences){

0 commit comments

Comments
 (0)