Added explict setup of the stats graphing geometry so that it's VertexBufferObject is intialized to the correct size to prevent any need for later resizing

This commit is contained in:
Robert Osfield 2016-09-01 14:42:58 +01:00
parent d4d32cbde7
commit 10f1d84f7e

View File

@ -753,7 +753,15 @@ protected:
setUseDisplayList(false);
setDataVariance(osg::Object::DYNAMIC);
setVertexArray(new osg::Vec3Array);
osg::ref_ptr<osg::BufferObject> vbo = new osg::VertexBufferObject;
vbo->setUsage(GL_DYNAMIC_DRAW);
vbo->getProfile()._size = (width)*12;
osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array;
vertices->setBufferObject(vbo.get());
vertices->reserve(width);
setVertexArray(vertices.get());
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back(color);