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:
parent
d4d32cbde7
commit
10f1d84f7e
@ -753,7 +753,15 @@ protected:
|
|||||||
setUseDisplayList(false);
|
setUseDisplayList(false);
|
||||||
setDataVariance(osg::Object::DYNAMIC);
|
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;
|
osg::Vec4Array* colors = new osg::Vec4Array;
|
||||||
colors->push_back(color);
|
colors->push_back(color);
|
||||||
|
Loading…
Reference in New Issue
Block a user