本文整理汇总了C++中TIntermSymbol::getInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntermSymbol::getInfo方法的具体用法?C++ TIntermSymbol::getInfo怎么用?C++ TIntermSymbol::getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntermSymbol
的用法示例。
在下文中一共展示了TIntermSymbol::getInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseInitializer
bool TGlslOutputTraverser::parseInitializer( TIntermBinary *node )
{
TIntermTyped *left, *right;
left = node->getLeft();
right = node->getRight();
if (!left->getAsSymbolNode())
return false; //Something is likely seriously wrong
TIntermSymbol *symNode = left->getAsSymbolNode();
if (symNode->getBasicType() == EbtStruct)
return false;
GlslSymbol * sym = NULL;
if ( !current->hasSymbol( symNode->getId() ) )
{
int array = symNode->getTypePointer()->isArray() ? symNode->getTypePointer()->getArraySize() : 0;
const char* semantic = "";
if (symNode->getInfo())
semantic = symNode->getInfo()->getSemantic().c_str();
sym = new GlslSymbol( symNode->getSymbol().c_str(), semantic, symNode->getId(),
translateType(symNode->getTypePointer()), m_UsePrecision?node->getPrecision():EbpUndefined, translateQualifier(symNode->getQualifier()), array);
current->addSymbol(sym);
}
else
return false; //can't init already declared variable
if (right->getAsTyped())
{
std::stringstream ss;
std::stringstream* oldOut = ¤t->getActiveOutput();
current->pushDepth(0);
current->setActiveOutput(&ss);
right->getAsTyped()->traverse(this);
current->setActiveOutput(oldOut);
current->popDepth();
sym->setInitializer(ss.str());
}
return true;
}