Added check against State::useVertexBufferObjects(..) so that Display Lists are only used when VBO is OFF.
This commit is contained in:
parent
961bffcca4
commit
359b136b5e
@ -532,7 +532,7 @@ inline void Drawable::draw(RenderInfo& renderInfo) const
|
|||||||
|
|
||||||
|
|
||||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||||
if (_useDisplayList)
|
if (!state.useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects) && _useDisplayList)
|
||||||
{
|
{
|
||||||
// get the contextID (user defined ID of 0 upwards) for the
|
// get the contextID (user defined ID of 0 upwards) for the
|
||||||
// current OpenGL context.
|
// current OpenGL context.
|
||||||
|
@ -595,7 +595,7 @@ void Drawable::compileGLObjects(RenderInfo& renderInfo) const
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||||
if (_useDisplayList)
|
if (!renderInfo.getState()->useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects) && _useDisplayList)
|
||||||
{
|
{
|
||||||
// get the contextID (user defined ID of 0 upwards) for the
|
// get the contextID (user defined ID of 0 upwards) for the
|
||||||
// current OpenGL context.
|
// current OpenGL context.
|
||||||
@ -624,7 +624,6 @@ void Drawable::compileGLObjects(RenderInfo& renderInfo) const
|
|||||||
|
|
||||||
void Drawable::draw(RenderInfo& renderInfo) const
|
void Drawable::draw(RenderInfo& renderInfo) const
|
||||||
{
|
{
|
||||||
// OSG_NOTICE<<"Geometry::draw() "<<this<<std::endl;
|
|
||||||
|
|
||||||
State& state = *renderInfo.getState();
|
State& state = *renderInfo.getState();
|
||||||
bool useVertexArrayObject = state.useVertexArrayObject(_useVertexArrayObject);
|
bool useVertexArrayObject = state.useVertexArrayObject(_useVertexArrayObject);
|
||||||
@ -661,7 +660,7 @@ void Drawable::draw(RenderInfo& renderInfo) const
|
|||||||
|
|
||||||
|
|
||||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||||
if (_useDisplayList)
|
if (!state.useVertexBufferObject(_supportsVertexBufferObjects && _useVertexBufferObjects) && _useDisplayList)
|
||||||
{
|
{
|
||||||
// get the contextID (user defined ID of 0 upwards) for the
|
// get the contextID (user defined ID of 0 upwards) for the
|
||||||
// current OpenGL context.
|
// current OpenGL context.
|
||||||
|
@ -785,7 +785,7 @@ void Geometry::compileGLObjects(RenderInfo& renderInfo) const
|
|||||||
|
|
||||||
void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||||
{
|
{
|
||||||
// OSG_NOTICE<<" Geometry::drawImplementation()"<<std::endl;
|
// OSG_NOTICE<<"Geometry::drawImplementation() "<<this<<std::endl;
|
||||||
|
|
||||||
if (_containsDeprecatedData)
|
if (_containsDeprecatedData)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +181,9 @@ void State::initializeExtensionProcs()
|
|||||||
_forceVertexArrayObject = _isVertexArrayObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_ARRAY_OBJECT);
|
_forceVertexArrayObject = _isVertexArrayObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_ARRAY_OBJECT);
|
||||||
_forceVertexBufferObject = _forceVertexArrayObject || (_isVertexBufferObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_BUFFER_OBJECT));
|
_forceVertexBufferObject = _forceVertexArrayObject || (_isVertexBufferObjectSupported && (ds->getVertexBufferHint()==DisplaySettings::VERTEX_BUFFER_OBJECT));
|
||||||
|
|
||||||
|
OSG_NOTICE<<"_forceVertexArrayObject = "<<_forceVertexArrayObject<<std::endl;
|
||||||
|
OSG_NOTICE<<"_forceVertexBufferObject = "<<_forceVertexBufferObject<<std::endl;
|
||||||
|
|
||||||
|
|
||||||
// Set up up global VertexArrayState object
|
// Set up up global VertexArrayState object
|
||||||
_globalVertexArrayState = new VertexArrayState(this);
|
_globalVertexArrayState = new VertexArrayState(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user