From 0ebf005ac1f35493cd5563ad7e04f612360e2b6c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 1 Sep 2003 11:23:29 +0000 Subject: [PATCH] Added a call to disable all vertex attrib arrays when none are present on an osg::Geometry. --- src/osg/Geometry.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index 9f996332d..9f170f683 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -940,7 +940,8 @@ void Geometry::drawImplementation(State& state) const typedef std::map< Geometry::AttributeBinding, DrawVertexAttribList> DrawVertexAttribMap; DrawVertexAttribMap drawVertexAttribMap; - bool handleVertexAttributes = (!_vertexAttribList.empty() && extensions->isVertexProgramSupported()); + bool vertexVertexAttributesSupported = extensions->isVertexProgramSupported(); + bool handleVertexAttributes = (!_vertexAttribList.empty() && vertexVertexAttributesSupported); bool usingVertexBufferObjects = _useVertexBufferObjects && state.isVertexBufferObjectSupported(); @@ -1134,6 +1135,11 @@ void Geometry::drawImplementation(State& state) const } } state.disableVertexAttribPointersAboveAndIncluding( index ); + + } + else if (vertexVertexAttributesSupported) + { + state.disableVertexAttribPointersAboveAndIncluding( 0 ); } @@ -1216,6 +1222,11 @@ void Geometry::drawImplementation(State& state) const } } state.disableVertexAttribPointersAboveAndIncluding( index ); + + } + else if (vertexVertexAttributesSupported) + { + state.disableVertexAttribPointersAboveAndIncluding( 0 ); } }