【已解决】cocos2dx 关于抗锯齿setBlendFunc

在cpp-tests里,在DrawPrimitivesTests中,在
DrawNodeTest::DrawNodeTest()
{

auto s = Director::getInstance()->getWinSize();

auto draw = DrawNode::create();
this-> addChild(draw, 10);

//加上这两句就能起到抗锯齿的作用
BlendFunc bf = { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA };
draw->setBlendFunc(bf);

..................................

}

可是自己新建的项目,却不起作用,问题在哪里呢?

那不是抗锯齿,是颜色混合

还有,2D有抗锯齿?

view plain copy

CCSprite *s=CCSprite::create("xiao.png");  
//抗锯齿  
s->getTexture()->setAntiAliasTexParameters();  
//s->getTexture()->setAliasTexParameters();//不抗锯齿

一楼说的对,请百度“颜色混合”相关资料。

是我搞错了,
//加上这两句也不能起到抗锯齿的作用
BlendFunc bf = { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA };
draw->setBlendFunc(bf);

起作用的是:glEnable(GL_LINE_SMOOTH); 画曲线才平滑