From 7c1b3b8552d836cfbe15b0507b3fd321a012eaac Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 23 Oct 2009 09:24:44 +0000 Subject: [PATCH] Fixed handling of Geometry::_internalOptimizedGeometry in the Geometry::drawImplementation(..) --- src/osg/Geometry.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index cbf0e694f..d7e02fca8 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -906,10 +906,17 @@ void Geometry::releaseGLObjects(State* state) const void Geometry::drawImplementation(RenderInfo& renderInfo) const { + if (_internalOptimizedGeometry.valid()) + { + _internalOptimizedGeometry->drawImplementation(renderInfo); + return; + } + State& state = *renderInfo.getState(); Drawable::Extensions* extensions = Drawable::getExtensions(state.getContextID(),true); bool useFastPath = areFastPathsUsed(); + bool usingVertexBufferObjects = _useVertexBufferObjects && state.isVertexBufferObjectSupported(); bool handleVertexAttributes = !_vertexAttribList.empty() && extensions->isVertexProgramSupported(); @@ -917,7 +924,7 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const arrayDispatchers.setUseVertexAttribAlias(state.getUseVertexAttributeAliasing()); arrayDispatchers.reset(); - // arrayDispatchers.setUseGLBeginEndAdapter(!useFastPath); + arrayDispatchers.setUseGLBeginEndAdapter(!useFastPath); arrayDispatchers.activateNormalArray(_normalData.binding, _normalData.array.get(), _normalData.indices.get()); arrayDispatchers.activateColorArray(_colorData.binding, _colorData.array.get(), _colorData.indices.get());