fix ShadeNodeTest->SpriteBlur

This commit is contained in:
Huabing.Xu 2013-12-25 16:54:09 +08:00
parent 6b6b37b1ad
commit 2eaba86d76
1 changed files with 19 additions and 10 deletions

View File

@ -204,7 +204,6 @@ void ShaderNode::draw()
void ShaderNode::onDraw()
{
return;
CC_NODE_DRAW_SETUP();
float w = SIZE_X, h = SIZE_Y;
@ -448,6 +447,8 @@ public:
GLuint blurLocation;
GLuint subLocation;
protected:
void onDraw();
};
SpriteBlur::~SpriteBlur()
@ -530,6 +531,14 @@ void SpriteBlur::initProgram()
}
void SpriteBlur::draw()
{
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
cmd->init(0, _vertexZ);
cmd->func = CC_CALLBACK_0(SpriteBlur::onDraw, this);
Director::getInstance()->getRenderer()->addCommand(cmd);
}
void SpriteBlur::onDraw()
{
GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );
BlendFunc blend = getBlendFunc();