GLESDebugDraw OpenGL Error 0x0502?

I had it working in my previous project but after implementing it in my new one I’m getting the error
“OpenGL error 0x0502 in …/GLES-Render.cpp DrawSegment 185”

And the draw is completely janky. I am performing some other opengl operations in my game including rendering position/color into a texture, and realtime position/texture rendering. Maybe i somehow fudged up the use of GLES-Render? Why might this be happening?

I have had the same problem today.

I have solved using B2DebugDraw (https://github.com/vinova/B2DebugDraw).

The rendering in the simulator is slow but on real device it’s ok

Hope this can help you.

Bye,
Massimo

B2DebugDraw did not help.
The errors slow down some box2d samples on ipad device to <10 fps if running from xcode. When run from the device (without xcode) its normal - fast.

Hello, try to add this to your draw():

void YourLayer::draw() {
    ccGLEnableVertexAttribs(kCCVertexAttribFlag_Position);
    kmGLPushMatrix();
    world_->DrawDebugData();
    kmGLPopMatrix();
}

Already have all that. The game works, but Console is going crazy with:
Cocos2d: OpenGL error 0x0502 in /Users/…/Classes/Box2dView.cpp draw 606

Thanks anyway.

3# positive solution, now a success

ccGLEnableVertexAttribs(kCCVertexAttribFlag_Position);