OpenGL error 0x0502 when loading tile maps

I’m getting an OpenGL error 0x0502 when loading my tile map.

OpenGL error 0x0502 in \cocos2d-2.1rc0-x-2.1.3\cocos2dx\textures\cctextureatlas.cpp cocos2d::CCTextureAtlas::drawNumberOfQuads 681

I tested it in the TestCpp project and it happens there too. It turns out the actual error is in CCTMXLayer::parseInternalProperties() when a CCTMXLayer has cc_vertexz == automatic.

The GL error happens in the setUniformLocationWith1f() call.

The issue can be reproduced by running the “TMX Iso VertexZ” or “TMX Ortho vertexZ” tests.

Any ideas how to fix?

I’m having the same issue. Has anyone figured out how to fix this? (it works fine if I remove setUniformLocationWith1f()…except I can’t set my uniforms)

Thanks.
#2346 is created for it.

Actually, I think this might be a non-issue. As far as I know (and I don’t know very much about opengl), you need to have a shader loaded/“used” in order to set uniforms for it. That may be incorrect though, does anybody know? It fixed my problems.

I fixed it in this pull request.

Minggo Zhang wrote:

I fixed it in this pull request.

hi, Minggo
我在2.1.4基础上按照你的pull request手动改的,但是依然会有该错误
OpenGL error 0x0502 in ………2dx\textures\cctextureatlas.cpp cocos2d::CCTextureAtlas::drawNumberOfQuads 681