diff --git a/src/osgTerrain/GeometryPool.cpp b/src/osgTerrain/GeometryPool.cpp index 1a430496a..9c494d421 100644 --- a/src/osgTerrain/GeometryPool.cpp +++ b/src/osgTerrain/GeometryPool.cpp @@ -957,6 +957,7 @@ void SharedGeometry::drawImplementation(osg::RenderInfo& renderInfo) const GLenum primitiveType = computeDiagonals ? GL_LINES_ADJACENCY : GL_QUADS; osg::GLBufferObject* ebo = _drawElements->getOrCreateGLBufferObject(state.getContextID()); + state.bindElementBufferObject(ebo); glDrawElements(primitiveType, _drawElements->getNumIndices(), _drawElements->getDataType(), (const GLvoid *)(ebo->getOffset(_drawElements->getBufferIndex()))); @@ -966,19 +967,6 @@ void SharedGeometry::drawImplementation(osg::RenderInfo& renderInfo) const state.unbindVertexBufferObject(); state.unbindElementBufferObject(); -#if 0 - if (computeDiagonals) - { - if (state.checkGLErrors("End of SharedGeometry::drawImplementation. computeDiagonals=TRUE")) {} - else OSG_NOTICE<<"SharedGeometry::drawImplementation. OK computeDiagonals=TRUE"<