本文整理汇总了C++中StateSet::getTextureAttributeList方法的典型用法代码示例。如果您正苦于以下问题:C++ StateSet::getTextureAttributeList方法的具体用法?C++ StateSet::getTextureAttributeList怎么用?C++ StateSet::getTextureAttributeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateSet
的用法示例。
在下文中一共展示了StateSet::getTextureAttributeList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void TextureUnitsUsageVisitor::apply( StateSet& stateSet )
{
// attribute
const StateSet::TextureAttributeList& taList = stateSet.getTextureAttributeList();
unsigned int c = taList.size();
if( _attributesFound.size() < c )
_attributesFound.resize( c, false );
for( unsigned int i=0; i<c; i++ )
{
// if attribute presence is already set, can skip all the tests for this texture unit
if( _attributesFound[i] )
continue;
// find any texture attribute for the particular texture unit
const StateSet::AttributeList& aList = taList[i];
for( StateSet::AttributeList::const_iterator it = aList.begin(); it != aList.end(); it++ )
{
if( it->second.first.get() != NULL )
{
_attributesFound[i] = true;
break;
}
}
}
// mode
const StateSet::TextureModeList& tmList = stateSet.getTextureModeList();
c = tmList.size();
if( _modeOn.size() < c )
_modeOn.resize( c, false );
for( unsigned int i=0; i<c; i++ )
{
// if mode is already set, can skip all the tests for this texture unit
if( _modeOn[i] )
continue;
const StateSet::ModeList& mList = tmList[i];
StateSet::ModeList::const_iterator it = mList.find( GL_TEXTURE_2D );
if( it != mList.end() )
{
const StateAttribute::GLModeValue value = it->second;
if( (value & StateAttribute::ON) != 0 )
_modeOn[i] = true;
}
}
}