It's possible to draw border of boundingBox?

If it’s possible, how i can draw and see boundingBox of Node and Node-based objects?

P.S
i define: #define CC_SPRITE_DEBUG_DRAW 1 but when i recompile cocos2dx i got error:
…/sprite_nodes/CCSprite.cpp: in «virtual void cocos2d::Sprite::updateTransform()»:
…/sprite_nodes/CCSprite.cpp:539:33: error: no declaration «ccDrawPoly» in this scope
…/sprite_nodes/CCSprite.cpp: in «virtual void cocos2d::Sprite::draw()»:
…/sprite_nodes/CCSprite.cpp:592:33: error: no declaration «ccDrawPoly» in this scope

Set both of these to 1 in the ccConfig.h file:

CC_SPRITE_DEBUG_DRAW;
CC_SPRITEBATCHNODE_DEBUG_DRAW;

Sergey Volkov wrote:

…/sprite_nodes/CCSprite.cpp:539:33: error: no declaration «ccDrawPoly» in this scope

Open CCSprite.cpp

Where you see:
ccDrawPoly(vertices, 4, true);

Change to:
DrawPrimitives::drawPoly(vertices, 4, true);

David great fix , but there still problem , in case you have sprite that is not being rendered using an SpriteBatchNode and the updateTransform from CCSprite never called so you never see the bounding box
so what i found to work is :
in you sprite just implement the draw function to look like this :

void MySprite::draw()
{
     Sprite::draw();
    
     
    _customCommand.init(_globalZOrder);
    _customCommand.func = CC_CALLBACK_0(Block::onDraw, this);
    Director::getInstance()->getRenderer()->addCommand(&_customCommand); 
    
   
}
void MySprite::onDraw()
{
   
    kmMat4 oldMat;
    kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
    kmGLLoadMatrix(&_modelViewTransform);
    
    //draw
    CHECK_GL_ERROR_DEBUG();
    // draw bounding box
    Point vertices[4] = {
        Point( _quad.bl.vertices.x, _quad.bl.vertices.y ),
        Point( _quad.br.vertices.x, _quad.br.vertices.y ),
        Point( _quad.tr.vertices.x, _quad.tr.vertices.y ),
        Point( _quad.tl.vertices.x, _quad.tl.vertices.y ),
    };
    //ccDrawPoly(vertices, 4, true);
    DrawPrimitives::drawPoly(vertices, 4, true);
     //end draw
    kmGLLoadMatrix(&oldMat);
  
}

opened bug :
http://www.cocos2d-x.org/issues/3864