Projects > cpp > Issues > Bug #2564

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

OpenGL error 0x0502

Bug #2564 [Rejected]
godyZ 2013-08-19 07:28 . Updated almost 2 years ago

(waiter opened this issue a month ago in github)

In TestCpp , ClippingNodeTest, Hole Demo
then you will see this error
OpenGL error 0x0502 in d:2d-x-2.1.4\cocos2dx\sprite_nodes\ccsprite.cpp cocos2d::CCSprite::draw 591

I use win7 and cocos2d-x 2.1.4 in debug mode.
And cocos2d-x 2.1.3 also have this issue.
On Android, you will see:
E/Adreno200-ES20(29536): <__load_uniform_float:531>: GL_INVALID_OPERATION

zhangxm 2013-08-22 03:48
  • Status changed from New to Rejected
  • Target version changed from Candidate to 34

It is fixed in 3.0 alpha0 pre.

Donmizzi 2014-01-04 23:19

Minggo Zhang wrote:

It is fixed in 3.0 alpha0 pre.

Is there an workaround for the cocos2d-x 2.2?

CCSprite in the 3.0aplha has huge changes.

Don 2014-01-08 08:32
  • Target version deleted (34)
Harion 2014-09-27 13:16

This issue has came back in cocos2d-x v3.2 when I use GLES-Render to debug for box2D in the physical map made by tiledmap. This bug just appear when I use GLES-Render to debug box2D and it was not often in past but when I add more and more tile layers and object into map so now it's appearing usually. And the terrible is when this bug appeared my system is slowing down so that I must to use Force Quit to close Xcode.

My tilemap (29 x 190) tiles and tiles width is 64.

**This is my code **

void Level::prepareLayers()
for (auto& object : this->map->getChildren())
// is this map child a tile layer?
auto layer = dynamic_cast<TMXLayer
if (layer != nullptr)

void Level::createFixtures(CCTMXLayer* layer)
// create all the rectangular fixtures for each tile
Size layerSize = layer->getLayerSize();
for (int y = 0; y < layerSize.height; y++)
for (int x = 0; x < layerSize.width; x++)
// create a fixture if this tile has a sprite
auto tileSprite = layer->getTileAt(Point(x, y));
if (tileSprite)
this->createRectangularFixture(layer, x, y, 1.0f, 1.0f);

void Level::createRectangularFixture(TMXLayer* layer, int x, int y, float width, float height)
// get position & size
auto p = layer->getPositionAt(Point(x,y));
auto tileSize = this->map->getTileSize();
const float pixelsPerMeter = 32.0f;

// create the body
b2BodyDef bodyDef;
bodyDef.type = b2_staticBody;
(p.x + (tileSize.width / 2.0f)) / PTM_RATIO,
(p.y + (tileSize.height / 2.0f)) / PTM_RATIO
b2Body* body = world->CreateBody(&bodyDef);

// define the shape
b2PolygonShape shape;
(tileSize.width / pixelsPerMeter) * 0.5f * width,
(tileSize.width / pixelsPerMeter) * 0.5f * height

// create the fixture
b2FixtureDef fixtureDef;
fixtureDef.shape = &shape;
fixtureDef.density = 1.0f;
fixtureDef.friction = 0.3f;
fixtureDef.restitution = 0.0f;
fixtureDef.filter.categoryBits = kFilterCategoryLevel;
fixtureDef.filter.maskBits = 0xffff;

End when I run to test on simulator this is alert show in debug area on my Xcode 5.1.1

cocos2d: OpenGL error 0x0502 in /Volumes/WORKSPACE/Projects/TestTilemap/Classes/Libraries/GLES-Render.cpp DrawSegment 214

cocos2d: OpenGL error 0x0502 in /Volumes/WORKSPACE/Projects/TestTilemap/Classes/Libraries/GLES-Render.cpp DrawSegment 214

cocos2d: OpenGL error 0x0502 in /Volumes/WORKSPACE/Projects/TestTilemap/Classes/Libraries/GLES-Render.cpp DrawSegment 214


and the code at line 214 in my GLES-Render.cpp file is:

What I need to do to solve this issue for I can debug box2d on tilemap map?
Please help.

agenindonesia 2014-11-25 20:31 Agen Texas Poker Dan Domino Online Indonesia Terpercaya
OK, I’ve updated the announcement and added a link to zipball on google code. Thank you for reminding me.
Agen Indonesia | Agen Bola | Poker Indonesia

ionliga 2014-11-28 14:36

The optimization introduces a bug where the priority and Touch Mode will not get changed if the list is locked.
The most straight forward fix is to merge the pHandlersToAdd and pHandlersToRemove into a queue and process through all of them in the order they are received Agen Texas Poker dan Domino Online Indonesia Terpercaya | Agen Bola | Taruhan Bola | Agen Bola | Agen Judi Bola Online, Agen Judi Casino Online Indonesia Terpercaya

Atom PDF

Start date:2013-08-19
Due date:
% Done:


Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.