Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:41:43+00:00 2026-06-08T13:41:43+00:00

[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

  • 0

[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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:41:44+00:00Added an answer on June 8, 2026 at 1:41 pm

    The Problem was that either iOS or Cocos2D (or both) can have a unique framebuffer.
    The handle of that unique frame buffer would be different than 0, and may be different each time.

    To solve this, I have to grab the current FBO’s handle, do my custom Framebuffer stuff and then re-apply the FBO’s handle after I’m done.

    Creates a variable to reference the original Frame Buffer Object

    GLint oldFBO;
    

    Assigns the currently used FBO’s handle (which is a ‘GLint’) to the variable ‘oldFBO’

    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
    
    //here is when you would create or manipulate custom framebuffers.//
    

    After that, You set the original FBO as the current Framebuffer

    glBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As Objective-C has evolved (I use it exclusively with xcode/ios for iPhone/iPad development), there
Is it possible to use Objective-C++ for iOS application (iPhone, iPad, iPod touch) development?
I work with Xcode 4.3 for a iPad iOS 5 project. I am performing
I recently upgrade iPad to iOS 5.1.1. Organizer prompted the Xcode can not find
I have some UIPopoverController that were working fine in 4.3/5.0 iOS iPad. Now, with
I have a ios program for iPad. It is used 2 view, A view
As monotouch updates have stopped (another story), can I upgrade my iPhone/iPad to iOS
So I have developed iphone/ipad apps before using Xcode and Phonegap/Cordova for a while
I'm new to objective-c and iOS development. I need an iPad application to display
I have a UITableView in a UIViewController on ipad (ios 4.3.3) I want the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.