ViVi Home > 技術文書 > cocos2d-x > 描画(DrawPrimitives)


 
Follow @vivisuke Tweet

 

描画(DrawPrimitives)
Copyright (C) 2014 by Nobuhide Tsuda

描画(DrawPrimitives)

void HelloWorld::onDraw(const Mat4 &transform, bool transformUpdated)
{
    Director* director = Director::getInstance();
    CCASSERT(nullptr != director, "Director is null when seting matrix stack");
    director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
    director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform);

    //DrawPrimitives::drawLine(...); 等を使って描画

    //end draw
    director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}