Moved VBO switching code into inline methods into osg::State to speed performance

This commit is contained in:
Robert Osfield
2007-05-01 06:28:20 +00:00
parent a67111a64c
commit 40db1a8934
12 changed files with 377 additions and 79 deletions

View File

@@ -223,7 +223,7 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile
osg::VertexBufferObject* vbObject = new osg::VertexBufferObject;
vertices->setVertexBufferObject(vbObject);
osg::ElementsBufferObject* ebo = new osg::ElementsBufferObject;
osg::ElementBufferObject* ebo = new osg::ElementBufferObject;
for(iy=0; iy<num_y-1; ++iy)
{
@@ -237,7 +237,7 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile
}
geom->addPrimitiveSet(elements);
if (ebo) elements->setElementsBufferObject(ebo);
if (ebo) elements->setElementBufferObject(ebo);
}
geom->setUseVertexBufferObjects(vbo);