Reputation: 5110
I got one old game and I tied to update Cocos2d 2.0 SDK. I got some compilation error.
b2Vec2 gravity;
gravity.Set(0.0f, -10.0f);
self.world = new b2World(gravity, true);
Error: No matching constructor for initialization of 'b2World'
When I change this to below code then works but Box2D debug shapes are not drawn.
self.world = new b2World(gravity);
How to initialize Box2d world in right way that show debug shapes?
Upvotes: 0
Views: 150
Reputation: 5110
Finally I got debug shape by replacing this draw function and GLESDebugDraw files.
-(void) draw
{
[super draw];
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );
kmGLPushMatrix();
self.world->DrawDebugData();
kmGLPopMatrix();
}
Upvotes: 1
Reputation: 64477
Replace the GLESDebugDraw files with those found in a newly created cocos2d 2.0 + Box2D project. Your version is still using GL ES 1.1 commands which don't work in cocos2d 2.x
Upvotes: 2