本文整理汇总了C++中DrawElementsUInt::setNumInstances方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawElementsUInt::setNumInstances方法的具体用法?C++ DrawElementsUInt::setNumInstances怎么用?C++ DrawElementsUInt::setNumInstances使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawElementsUInt
的用法示例。
在下文中一共展示了DrawElementsUInt::setNumInstances方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Primitive_readLocalData
bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
{
bool iteratorAdvanced = false;
bool firstMatched = false;
if ((firstMatched = fr.matchSequence("DrawArrays %w %i %i %i")) ||
fr.matchSequence("DrawArrays %w %i %i") )
{
GLenum mode;
Geometry_matchPrimitiveModeStr(fr[1].getStr(),mode);
int first;
fr[2].getInt(first);
int count;
fr[3].getInt(count);
int numInstances = 0;
if (firstMatched)
{
fr[4].getInt(numInstances);
fr += 5;
}
else
{
fr += 4;
}
geom.addPrimitiveSet(new DrawArrays(mode, first, count, numInstances));
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawArrayLengths %w %i %i %i {")) ||
fr.matchSequence("DrawArrayLengths %w %i %i {") )
{
int entry = fr[1].getNoNestedBrackets();
GLenum mode;
Geometry_matchPrimitiveModeStr(fr[1].getStr(),mode);
int first;
fr[2].getInt(first);
int capacity;
fr[3].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
fr[4].getInt(numInstances);
fr += 6;
}
else
{
fr += 5;
}
DrawArrayLengths* prim = new DrawArrayLengths;
prim->setMode(mode);
prim->setNumInstances(numInstances);
prim->setFirst(first);
prim->reserve(capacity);
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
unsigned int i;
if (fr[0].getUInt(i))
{
prim->push_back(i);
++fr;
}
}
++fr;
geom.addPrimitiveSet(prim);
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawElementsUByte %w %i %i {")) ||
fr.matchSequence("DrawElementsUByte %w %i {"))
{
int entry = fr[1].getNoNestedBrackets();
GLenum mode;
Geometry_matchPrimitiveModeStr(fr[1].getStr(),mode);
int capacity;
fr[2].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
fr[3].getInt(numInstances);
fr += 5;
}
else
{
fr += 4;
//.........这里部分代码省略.........