Fixed Geometry::drawImplmentation() handling of VBO's to prevent them from being used when display lists are used.
This commit is contained in:
parent
15429198b8
commit
9d72bf4712
@ -877,6 +877,12 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
|
||||
State& state = *renderInfo.getState();
|
||||
|
||||
bool usingVertexBufferObjects = state.useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects);
|
||||
bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject);
|
||||
|
||||
osg::VertexArrayState* vas = state.getCurrentVertexArrayState();
|
||||
vas->setVertexBufferObjectSupported(usingVertexBufferObjects);
|
||||
|
||||
bool checkForGLErrors = state.getCheckForGLErrors()==osg::State::ONCE_PER_ATTRIBUTE;
|
||||
if (checkForGLErrors) state.checkGLErrors("start of Geometry::drawImplementation()");
|
||||
|
||||
@ -892,13 +898,9 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
|
||||
drawPrimitivesImplementation(renderInfo);
|
||||
|
||||
bool usingVertexBufferObjects = state.useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects);
|
||||
bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject);
|
||||
|
||||
if (usingVertexBufferObjects && !usingVertexArrayObjects)
|
||||
{
|
||||
// unbind the VBO's if any are used.
|
||||
osg::VertexArrayState* vas = state.getCurrentVertexArrayState();
|
||||
vas->unbindVertexBufferObject();
|
||||
vas->unbindElementBufferObject();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user