Experimental support for OpenGL Vertex Array Object

This commit is contained in:
Robert Osfield
2016-07-15 15:41:43 +01:00
parent d51036f57e
commit 14d1483b06
16 changed files with 1822 additions and 62 deletions

View File

@@ -176,11 +176,17 @@ class OSG_EXPORT Geometry : public Drawable
*/
virtual void drawImplementation(RenderInfo& renderInfo) const;
/** Set up the vertex arrays for the purpose of rendering, called by drawImplemtation() prior to it calling drawPrimitivesImplementation().*/
void drawVertexArraysImplementation(RenderInfo& renderInfo) const;
void old_drawVertexArraysImplementation(RenderInfo& renderInfo) const;
/** dispatch the primitives to OpenGL, called by drawImplemtation() after calling drawVertexArraysImplementation().*/
void drawPrimitivesImplementation(RenderInfo& renderInfo) const;
void old_drawPrimitivesImplementation(RenderInfo& renderInfo) const;
/** Set up the vertex arrays for the purpose of rendering, called by drawImplemtation() prior to it calling drawPrimitivesImplementation().*/
void new_drawImplementation(RenderInfo& renderInfo) const;
/** Return true, osg::Geometry does support accept(Drawable::AttributeFunctor&). */
virtual bool supports(const Drawable::AttributeFunctor&) const { return true; }
@@ -217,6 +223,9 @@ class OSG_EXPORT Geometry : public Drawable
void addVertexBufferObjectIfRequired(osg::Array* array);
void addElementBufferObjectIfRequired(osg::PrimitiveSet* primitiveSet);
typedef buffered_object< osg::ref_ptr<VertexArrayState> > VertexArrayStateList;
mutable VertexArrayStateList _vertexArrayStateList;
PrimitiveSetList _primitives;
osg::ref_ptr<Array> _vertexArray;