OpenGL error 0x0506 when game resumes from ad

I just integrated AdTapsy, and I’m using 3 ad networks (AdMob, ChartBoost, and AdColony). AdMob and Chartboost seem to be working just fine, but when an AdColony ad closes the game doesn’t resume correctly and I get console error spam. Can anyone help me with this issue? It would be greatly appreciated.

I am calling pause() and resume() on Director::getInstance() already in the AdTapsy callbacks and they are getting called as expected.

[653:252197] [AdTapsy] [info] Ad shown successfully from adcolony
[653:252197] ***adtapsyDidShowAd***
[653:252197] cocos2d: surface size: 1242x2208
[653:252197] cocos2d: surface size: 1242x2208
[653:252197] cocos2d: surface size: 1242x2208
[653:252197] ***adtapsyDidSkippedAd***
[653:252197] cocos2d: surface size: 1242x2208
[653:252197] failed to call context
[653:252197] cocos2d: surface size: 0x0
[653:252197] Failed to make complete framebuffer object 0x8CD6
OpenGL error 0x0506 in /cocos2d/cocos/renderer/CCRenderer.cpp saveRenderState 144
OpenGL error 0x0506 in /cocos2d/cocos/renderer/CCTextureAtlas.cpp drawNumberOfQuads 691
OpenGL error 0x0506 in /cocos2d/cocos/renderer/CCTextureAtlas.cpp drawNumberOfQuads 691
OpenGL error 0x0506 in /cocos2d/cocos/renderer/CCRenderer.cpp restoreRenderState 170
OpenGL error 0x0506 in -[CCEAGLView swapBuffers] 324

Anyone have any info? This issue is still blocking me and I can’t seem to get any info about it elsewhere.

bump. Any of the Cocos2d-x creators or perhaps AdTapsy guys have any info?

Try adding this two functions to RootViewController.mm

-(void)viewWillAppear:(BOOL)animated { cocos2d::Director::getInstance()->resume(); cocos2d::Director::getInstance()->startAnimation(); }
- (void)viewWillDisappear:(BOOL)animated { cocos2d::Director::getInstance()->pause(); cocos2d::Director::getInstance()->stopAnimation(); }

I came to the same problem, when my app switched from layer with video (with experimental::ui::VideoPlayer) to another layer of my app.
I tried to call stop/start pair from other places of my code and this is the only place where it started to work.

I believe it is a bug, and it can be easily reproduced by adding layer change or transition after playing video in cocos2dx unittests.

Now, i should find something similar for android.

Hi tony,

were you able to figure out a similar fix for android as well ?