OpenGL error 0x0500 in -[EAGLView swapBuffers]

OpenGL error 0x0500 in -[EAGLView swapBuffers]
0.0 0



This error is driving me crazy:

OpenGL error 0x0500 in -[EAGLView swapBuffers]

It appears when I set opacity to not 255 for CCLayerColor like this:

CCLayerColor *blackBg = CCLayerColor::layerWithColor(ccc4(0, 0, 0, 100));

or when I use pvr textures with transparency

CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(“images.plist”, “images.pvr”);
CCSprite *background = CCSprite::spriteWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(“Bckgr.png”));


Every time i Init my game i also get this error:

OpenGL error 0x0500 in -[EAGLView swapBuffers]

But it apparently it does not interfere with my game in anyway. It looks ok! But i would love to know what is causing this.

My png spritesheet also has transparency. Have not tried loading a spritesheet without alpha though to confirm this.


Hi Nicolay, which platform did you meet this bug?


I have faced it on iOS


My appeared on iOS as well, dont know if the same happens on android because i havent checked out the console yet.


I am getting this error every time I load a CCParticleSystemQuad into a scene with a CCParallaxNode in the background. If I take out the CCParallaxNode, the error goes away and everything is smooth. If I add the CCParallaxNode back in, the error comes back, the whole screen flickers, and “blank” squares start appearing over all of the nodes in the scene. I’ve tried all of the tricks I can find online, but nothing seems to work. Any help would be appreciated. This is all on iOS. The same code crashes Android when the CCParallaxNode is added.


I have a case as same as what Brandon Dorris mentioned in iOS


I have the same issue.


Might be related to ccparallaxnode, since i use it in my game and have the same error as well.

But both iOS and Android do not crash and everything appears to be normal. The game runs at > 50 fps on both devices. I only use Box2d, ccparallax, and sprites, but i do use a lot of textures (3 x 2048x2048) and audio.


I assumed it was the CCParallaxNode as well. I can put just one relatively small background image in the parallax node and produce the same symptoms. This “OpenGL error 0x0500” was the only other thing that showed up along with the screen flickering and missing squares.


Sorry guys, it seems a bug. Could any one upload a simple project reproducing this error, so we can fix it quickly?
Bug #974 is created.


I can upload a simple project here in a few hours.


here is a sample.

CCParticleMeteor* meteor = CCParticleMeteor::node();
meteor~~>setTexture( CCTextureCache::sharedTextureCache()>addImage );


Is it the same as


No, that seems like a very different problem. The real problem here for me is that the CCParallaxNode seems to cause issues when other sprites (or particles) are drawn on top of it. The screen flickers a bit and small squares are missing from large portions of the screen. I have attached a screenshot to show what I mean.

OpenGL error on runAction using AnimationCache

I’m actually able to reproduce this with a single CCParallaxNode. Here is the code:

CCSize size = CCDirector::sharedDirector()->getWinSize();

space = CCParallaxNode::node(); space->setPosition(ccp(0, 0));

CCSprite *stars3 = CCSprite::spriteWithFile("Starfield3.png"); space->addChild(stars3, 0, ccp(-1, 2), ccp(0, 0)); CCSprite *stars2 = CCSprite::spriteWithFile("Starfield2.png"); stars2->setAnchorPoint(ccp(0,0)); space->addChild(stars2, 1, ccp(-2, 4), ccp(0, 0)); CCSprite *stars1 = CCSprite::spriteWithFile("Starfield1.png"); stars1->setAnchorPoint(ccp(0,0)); space->addChild(stars1, 2, ccp(-4, 8), ccp(0, 0));

CCSprite *grid = CCSprite::spriteWithFile("HexGrid.png"); grid->setAnchorPoint(ccp(0,0)); CCSize gridSize = grid->getContentSize(); space->addChild(grid, 3, ccp(-10, 20), ccp(0, 0));


CCMoveBy *moveLeft = CCMoveBy::actionWithDuration(5.0, ccp(200, 0)); CCMoveBy *moveRight = CCMoveBy::actionWithDuration(5.0, ccp(-200, 0));

CCSequence *sequence = CCSequence::actionOneTwo(moveLeft, moveRight); CCRepeatForever *repeat = CCRepeatForever::actionWithAction(sequence);


The files are here:


OpenGL error 0x0500 generated if you not call CCSprite::init() from child of CCSprite.
Error raised by method
glBlendFunc(m_sBlendFunc.src, m_sBlendFunc.dst);
because m_sBlendFunc not initialised and filled with trash.
(P.S. Sorry for my rude English)


My issue actually turned out to be the one mentioned here: . After adding CCDirector::sharedDirector()->setDepthTest(false);, everything was fixed. I was just thrown off by the OpenGL error message in the logs.


I’m getting this error too, however it’s when utilising CCParticleSystem, following the test included in the repo.

I’m initialising it like so:

    emitter = cocos2d::CCParticleSmoke::node();
    addChild(emitter, SMOKE);


    emitter->setEndColor(cocos2d::ccc4FFromccc4B(cocos2d::ccc4(0, 0, 0, 0)));

This occurs each time this block of code is run. I’ve attempted to manually set the blend mode on the emitter which didn’t work (I doubted it would as it appears to be initialised in the constructor) any further thoughts on this matter?


I meet the same issue as Nic D when I use CCParticleSystem.
I know you are very busy for 2,0. Hope #974 it can ben resolved in the .13