Box2D 2.2.0 I can't use the GLES-Render files draw any shape

I'm also having a problem with GLESDebugDraw. I'm using Box2D 2.2.0. I have updated the GLES-Render files to use b2Draw and have patched the
GLESDebugDraw::DrawTranform method. I have setup and registered GLESDebugDraw with my world but not matter what I do, I cannot get it to draw any shapes around my bodies. Has anyone found a fix for this? What am I missing?

DrawTranform method:

Code: Select all

void GLESDebugDraw::DrawTransform(const b2Transform& xf)
{
 b2Vec2 p1 = xf.p, p2;
 const float32 k_axisScale = 0.4f;

 p2 = p1 + k_axisScale * xf.q.GetXAxis();
 DrawSegment(p1,p2,b2Color(1,0,0));
 
p2 = p1 + k_axisScale * xf.q.GetYAxis();
 DrawSegment(p1,p2,b2Color(0,1,0));
}


Code: Select all

#import"GLES-Render.h"
GLESDebugDraw *_debugDraw;


init in

Code: Select all

// Enable debug draw
_debugDraw = new GLESDebugDraw();
_world->SetDebugDraw(_debugDraw);

uint32 flags =0;
flags += b2Draw::e_shapeBit;
_debugDraw->SetFlags(flags);


Code: Select all

-(void) draw
{
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);

_world->DrawDebugData();

glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}


I should do now?I want to draw any shapes around my bodies.I'm very worried!!!
Hmm... it looks ok. Is the view positioned in the right place to see the bodies? Maybe you could use the debugger to step into DrawDebugData, just in case something strange is happening.
irresistible force wrote:Hmm... it looks ok. Is the view positioned in the right place to see the bodies? Maybe you could use the debugger to step into DrawDebugData, just in case something strange is happening.

When commissioning no mistakes, but is not painting my body draw any shape
rrtt, did you ever solve this? I have the same problem. I created an empty project from the template with box2d like irresistible force said and copied the GLESRender Class not my files. They build fine too, but nothing gets drawn.

I asked around in chipmunk forum about chipmunk and they gave me a link to a chipmunk class which draws it now because the latest cocos2d 2.0 works with GLES 2.0 and thats what broke my chipmunk debug draw.

Thus the same thing must be happening with box2d. But simply importing GLESRender class files from the newest cocos2d v2 template doesn't work. it must be something else.
Finally!!!!

http://www.cocos2d-iphone.org/forum/top ... ost-165206

Original thread: https://box2d.org/forum/viewtopic.php?t=8536