本文整理汇总了C++中GLContext::setBlendColor方法的典型用法代码示例。如果您正苦于以下问题:C++ GLContext::setBlendColor方法的具体用法?C++ GLContext::setBlendColor怎么用?C++ GLContext::setBlendColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLContext
的用法示例。
在下文中一共展示了GLContext::setBlendColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blt
void RasterNode::blt(const glm::mat4& transform, const glm::vec2& destSize)
{
GLContext* pContext = GLContext::getCurrent();
FRect destRect;
StandardShaderPtr pShader = pContext->getStandardShader();
float opacity = getEffectiveOpacity();
pContext->setBlendColor(glm::vec4(1.0f, 1.0f, 1.0f, opacity));
pShader->setAlpha(opacity);
if (m_pFXNode) {
pContext->setBlendMode(m_BlendMode, true);
m_pFXNode->getTex()->activate(GL_TEXTURE0);
pShader->setColorModel(0);
pShader->disableColorspaceMatrix();
pShader->setGamma(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
pShader->setPremultipliedAlpha(true);
pShader->setMask(false);
FRect relDestRect = m_pFXNode->getRelDestRect();
destRect = FRect(relDestRect.tl.x*destSize.x, relDestRect.tl.y*destSize.y,
relDestRect.br.x*destSize.x, relDestRect.br.y*destSize.y);
} else {
m_pSurface->activate(getMediaSize());
pContext->setBlendMode(m_BlendMode, m_pSurface->isPremultipliedAlpha());
destRect = FRect(glm::vec2(0,0), destSize);
}
glm::vec3 pos(destRect.tl.x, destRect.tl.y, 0);
glm::vec3 scaleVec(destRect.size().x, destRect.size().y, 1);
glm::mat4 localTransform = glm::translate(transform, pos);
localTransform = glm::scale(localTransform, scaleVec);
pShader->setTransform(localTransform);
pShader->activate();
m_pSubVA->draw();
}