// Load your images here void LoadImages () { myWorld.SetDebugDraw (&draw); draw.SetFlags ( DebugDraw::e_shapeBit | DebugDraw::e_aabbBit | DebugDraw::e_jointBit | DebugDraw::e_centerOfMassBit | DebugDraw::e_pairBit); glutTimerFunc (1000 / 100.0, Update, 1); glutTimerFunc (2000 / 1000, Clear, 1); }
void Box2DRenderer::render (Graphics& g, b2World& world, float left, float top, float right, float bottom, const Rectangle<float>& target) { graphics = &g; g.addTransform (AffineTransform::fromTargetPoints (left, top, target.getX(), target.getY(), right, top, target.getRight(), target.getY(), left, bottom, target.getX(), target.getBottom())); world.SetDebugDraw (this); world.DrawDebugData(); }
void DebugDraw::draw() { mWorld->SetDebugDraw(this); mWorld->DrawDebugData(); mWorld->SetDebugDraw(0); }