diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index d5f659da5..d6eb751ad 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -495,16 +495,26 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl inline static bool isCompiled(const osg::Drawable* drawable, unsigned int contextID) { - // Worry about vbos later - if (drawable->getUseDisplayList()) + if (drawable->getUseVertexBufferObjects()) + { + // say it's not compiled leaving it up to the compileGLObjects() to handle. + return false; + } + else if (drawable->getUseDisplayList()) { return drawable->getDisplayList(contextID) != 0; } + return true; } inline bool isCompiled(const osg::Drawable* drawable) const { + if (drawable->getUseVertexBufferObjects()) + { + // say it's not compiled leaving it up to the compileGLObjects() to handle. + return false; + } if (drawable->getUseDisplayList()) { for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin(); diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 2df676647..28da47b74 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -239,9 +239,8 @@ public: // // XXX This "compiles" VBOs too, but compilation doesn't do // anything for VBOs, does it? - if (_dataToCompile && drawable->getUseDisplayList() && !_pager->isCompiled(drawable)) + if (_dataToCompile && (drawable->getUseVertexBufferObjects() || drawable->getUseDisplayList()) && !_pager->isCompiled(drawable)) { - // osg::notify(osg::NOTICE)<<" Found compilable drawable"<second.push_back(drawable); } }