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

  • Home
  • SEARCH
  • 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 8490761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:13:11+00:00 2026-06-10T22:13:11+00:00

Note : Anyone who can help me properly fix this completely gets the 100

  • 0

Note: Anyone who can help me properly fix this completely gets the 100 point bounty!!!

In my application I am mixing UIKit with Cocos2D together, I do some simple custom view animations using addSubview and removeFromSuperview calls. I recently needed to add another CCScene to my app to get rid of some complicated UIKit code that Cocos2D can easily handle. So I have a base view in my app, it is a UIViewController with some buttons on it. Behind those buttons is a CCGLView which Cocos2D will do whatever on. That works great. Then when I want to go to my second view controller (lets call it my game view), after I do my view animations, the viewdidload gets called (thats where my director initialization is for the 2nd CCScene) and either nothing happens or I get errors like below in the console. Now in my original project the errors below are what I get, and in this sample project nothing happens. These are the errors:

OpenGL error 0x0501 in DrawSolidPolygon 104
OpenGL error 0x0502 in DrawSolidPolygon 104
OpenGL error 0x0501 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556
OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556
OpenGL error 0x0501 in -[CCParticleSystemQuad postStep] 411
OpenGL error 0x0506 in -[CCSprite draw] 532
OpenGL error 0x0502 in -[CCParticleSystemQuad draw] 434
OpenGL error 0x0502 in -[CCSprite draw] 532
OpenGL error 0x0502 in -[CCSprite draw] 532

Now when I had one scene in my original project nothing like this happens, it only happens now that I am using 2 CCScenes. So the code in the sample project is a pretty much copy of my original project so anything wrong in there will most likely lead me to fix the issue at hand here and hopefully get rid of those OpenGL errors.

After a few more hours of testing and gathering information, it seems that my issue is similar to: iOS and multiple OpenGL views. I have also seen this link: http://gamesfromwithin.com/using-multiple-opengl-views-and-uikit. However both of these links do not make any sense to me since I do not know how to relate it to Cocos2D. I think this whole issue is a limitation of the current version of Cocos2D but if someone can download my project and somehow apply these past two links’ fixes to my project and fully fix it, that would be great and would fix all of my issues!

Now the version of Cocos2D in my project is the latest available to download for the 2.0 version. If anyone would be nice enough to download the project and see what I am doing wrong I think this will solve the issue for me and others who are experiencing issues similar to mine.

The link below is a download link for the sample project with my issue:
http://www.gogofile.com/Default.aspx?p=sc&ID=634818635814123750_4340

Update as of 9/3/12, I am currently thinking just to contact @riq, the main creator behind Cocos2D for iOS. However before I do so, is everyone sure there isn’t a way to just have one CCGLView and I can just plop it in any UIViewController because technically I will not be using two views, it will just be one shared view between the controllers. Is this way possible?

  • 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-10T22:13:13+00:00Added an answer on June 10, 2026 at 10:13 pm

    Okay so I found out that I pretty much have 3 options:

    1. @Riq told me that support for multiple CCDirectors is coming in version 2.2 which will be released in May 2013. So play the waiting game until the 2.2 beta comes out. Update: 2.1 final has been out since the middle of June so I would guess that the 2.2 beta should be out within a month or two.

    2. Just have one UIViewController that holds the CCGLView. Then whatever UIViewController I need the glView in I would just use addChildViewController (iOS 5+) and I would just keep that UIViewController retained when I am switching views and just do replaceScene at that time too (maybe in the UIView animation completion callback). I think this way would work too but I am not sure of its efficiency.

    Edit: I have used and fully tested this solution and it seems to work great. I recommend doing this until 2.2 comes out. My app runs at 60FPS and looks good.

    3. I personally have not tried any of these links/pull requests and neither has @Riq so this would be my last option. http://www.cocos2d-iphone.org/forum/topic/33480 AND http://www.cocos2d-iphone.org/forum/topic/17821

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

internet cake for anyone who can help me with this. I have a long
Can anyone help with an odd Ruby Gem problem I'm having - note I've
Important: This question isn't actually really an ASP.NET question. Anyone who knows anything about
Can anyone point to a good unified comparison of various AJAX libraries? I've read
Anyone has implemented like the below carousel ? Note: The list of items should
Note, this is not a duplicate of .prop() vs .attr() ; that question refers
(Note: This is not a question about what is the best way with code
Note: Not sure if this is the right stack, please tell if I should
NOTE: This is a followup to my question here. I have a program that
NOTE: This is an old question and the answers here no longer works (since

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.