Updates to the DatabasePager code to include support for compiling texture

objects and display lists before merging loaded subgraphs with the main
scene graph.
This commit is contained in:
Robert Osfield
2003-07-10 11:10:39 +00:00
parent 12c7526f87
commit c5c7a1b2ba
3 changed files with 214 additions and 24 deletions

View File

@@ -306,9 +306,10 @@ public:
virtual void operator()(OsgSceneHandler& sh, Producer::Camera& camera)
{
_databasePager->compileRenderingObjects(*(sh.getSceneView()->getState()));
sh.drawImplementation(camera);
_databasePager->compileRenderingObjects(*(sh.getSceneView()->getState()));
}
osg::ref_ptr<DatabasePager> _databasePager;
@@ -330,8 +331,15 @@ bool Viewer::realize()
p!=_shvec.end();
++p)
{
// pass the database pager to the cull visitor so node can send requests to the pager.
(*p)->getSceneView()->getCullVisitor()->setDatabaseRequestHandler(_databasePager.get());
// set up a draw callback to pre compile any rendering object of database has loaded,
// but not yet merged with the main scene graph.
(*p)->setDrawCallback(new DatabasePagerCompileCallback(_databasePager.get()));
// tell the database pager which graphic context the compile of rendering objexts is needed.
_databasePager->setCompileRenderingObjectsForContexID((*p)->getSceneView()->getState()->getContextID(),true);
}
}