Nikolay Lastname OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 12
Added by Nikolay Lastname over 1 year ago

Hello,

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"));

joe espindola RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 52
Added by joe espindola over 1 year ago

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.

Zhe Wang RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 1642
Location Amoy, China
Added by Zhe Wang over 1 year ago

Hi Nicolay, which platform did you meet this bug?

Enjoy Coding, Enjoy Life.

Nikolay Lastname RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 12
Added by Nikolay Lastname over 1 year ago

I have faced it on iOS

joe espindola RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 52
Added by joe espindola over 1 year ago

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

Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris over 1 year ago

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.

Tix Lo RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 26
Added by Tix Lo over 1 year ago

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

Adi Fly RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 70
Added by Adi Fly over 1 year ago

I have the same issue.

joe espindola RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 52
Added by joe espindola over 1 year ago

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.

Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris over 1 year ago

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.

Zhe Wang RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 1642
Location Amoy, China
Added by Zhe Wang over 1 year ago

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.

Enjoy Coding, Enjoy Life.

Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris over 1 year ago

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

Tix Lo RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 26
Added by Tix Lo over 1 year ago

here is a sample.

CCParticleMeteor* meteor = CCParticleMeteor::node();
meteor->setPosition(ccp(160,160));
meteor->setTexture( CCTextureCache::sharedTextureCache()->addImage("particle_sun.png") );
this->addChild(meteor);

particle_sun.png (5.1 kB)

Minggo Zhang RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 1641
Added by Minggo Zhang over 1 year ago
Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris over 1 year ago

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.

missing_squares1.PNG - Parts of sprites and particle effects missing with a two layer parallax background. (591.3 kB)

Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris over 1 year ago

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));
this->addChild(space);
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);
space->runAction(repeat);

The files are here: http://lts.cr/Bayt

Antol Peshkov RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 1
Added by Antol Peshkov about 1 year ago

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);
in
CCSprite::draw(void)
because m_sBlendFunc not initialised and filled with trash.
(P.S. Sorry for my rude English)

Brandon Dorris RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 15
Added by Brandon Dorris about 1 year ago

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

Nic D RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 3
Added by Nic D about 1 year ago

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->setTexture(cocos2d::CCTextureCache::sharedTextureCache()->addImage(smoke.c_str()));

    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?

qiu 198022 RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 12
Added by qiu 198022 about 1 year ago

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

Žygis Buzzy RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 31
Added by Žygis Buzzy 10 months ago

Has this error been fixed?

Vovan Savvy RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 3
Added by Vovan Savvy 9 months ago

Žygis Buzzy wrote:

Has this error been fixed?

Error is not fixed
Here is the problem:

#if CC_USES_VBO
glEnable(GL_VERTEX_ARRAY);

// create the VBO buffer
glGenBuffers(1, &m_uQuadsID);

// initial binding
glBindBuffer(GL_ARRAY_BUFFER, m_uQuadsID);
glBufferData(GL_ARRAY_BUFFER, sizeof(m_pQuads0)*m_uTotalParticles, m_pQuads, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
#endif

#if CC_USES_VBO
glDeleteBuffers(1, &m_uQuadsID);
#endif

If you correct #define CC_USES_VBO 1 to #define CC_USES_VBO 0 in ccConfig.h, this bug will not appear.

Moc Interactive RE: OpenGL error 0x0500 in -[EAGLView swapBuffers]
Posts 28
Added by Moc Interactive 6 months ago

In CCParticleSystemQuad

change

glEnable(GL_VERTEX_ARRAY);

to
glEnableClientState(GL_VERTEX_ARRAY);

cocos2dx - 1.0.12


(1-22/22)