From 2929667dc4baff57ef59f4f24edc7f4df66288de Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 26 Apr 2007 16:50:35 +0000 Subject: [PATCH] Added using of VertexBufferObject and ElementsBufferObject classes --- examples/osgparametric/osgparametric.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/osgparametric/osgparametric.cpp b/examples/osgparametric/osgparametric.cpp index ead083ed0..eca35b106 100644 --- a/examples/osgparametric/osgparametric.cpp +++ b/examples/osgparametric/osgparametric.cpp @@ -220,6 +220,11 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile geom->setVertexArray(vertices); + osg::VertexBufferObject* vbObject = new osg::VertexBufferObject; + vertices->setVertexBufferObject(vbObject); + + osg::ElementsBufferObject* ebo = new osg::ElementsBufferObject; + for(iy=0; iyaddPrimitiveSet(elements); + geom->addPrimitiveSet(elements); + + if (ebo) elements->setElementsBufferObject(ebo); } geom->setUseVertexBufferObjects(vbo);