diff --git a/sources/Box2D/Common/b2Draw.h b/sources/Box2D/Common/b2Draw.h index 16c0b323..7dbcdef4 100755 --- a/sources/Box2D/Common/b2Draw.h +++ b/sources/Box2D/Common/b2Draw.h @@ -79,6 +79,8 @@ public: /// @param xf a transform. virtual void DrawTransform(const b2Transform& xf) = 0; + /// Clear draw commands + virtual void ClearDraw() = 0; protected: uint32 m_drawFlags; }; diff --git a/sources/Box2D/Dynamics/b2World.cpp b/sources/Box2D/Dynamics/b2World.cpp index d39b85b7..53bc14a2 100755 --- a/sources/Box2D/Dynamics/b2World.cpp +++ b/sources/Box2D/Dynamics/b2World.cpp @@ -1139,6 +1139,8 @@ void b2World::DrawDebugData() return; } + g_debugDraw->ClearDraw(); + uint32 flags = g_debugDraw->GetFlags(); if (flags & b2Draw::e_shapeBit)