Fixed support for compiling VBO's

This commit is contained in:
Robert Osfield 2009-12-09 13:55:10 +00:00
parent 6e7c02b5d8
commit 5f61d14dc6
2 changed files with 13 additions and 4 deletions

View File

@ -495,16 +495,26 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
inline static bool isCompiled(const osg::Drawable* drawable, inline static bool isCompiled(const osg::Drawable* drawable,
unsigned int contextID) unsigned int contextID)
{ {
// Worry about vbos later if (drawable->getUseVertexBufferObjects())
if (drawable->getUseDisplayList()) {
// 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 drawable->getDisplayList(contextID) != 0;
} }
return true; return true;
} }
inline bool isCompiled(const osg::Drawable* drawable) const 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()) if (drawable->getUseDisplayList())
{ {
for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin(); for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();

View File

@ -239,9 +239,8 @@ public:
// //
// XXX This "compiles" VBOs too, but compilation doesn't do // XXX This "compiles" VBOs too, but compilation doesn't do
// anything for VBOs, does it? // 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"<<std::endl;
_dataToCompile->second.push_back(drawable); _dataToCompile->second.push_back(drawable);
} }
} }