From Tim Moore, Fix for drivers that don't properly support timer extensions.

""
This commit is contained in:
Robert Osfield
2010-11-24 10:38:28 +00:00
parent e2a315ee49
commit 043ae090a5
3 changed files with 8 additions and 4 deletions

View File

@@ -1090,9 +1090,13 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase* viewer)
{
if ((*citr)->getGraphicsContext())
{
unsigned int contextID = (*citr)->getGraphicsContext()->getState()->getContextID();
const osg::State* state = (*citr)->getGraphicsContext()->getState();
unsigned int contextID = state->getContextID();
const osg::Drawable::Extensions* extensions = osg::Drawable::getExtensions(contextID, false);
if (extensions && extensions->isTimerQuerySupported())
if (extensions &&
(((extensions->isARBTimerQuerySupported()
&& state->getTimestampBits() > 0))
|| extensions->isTimerQuerySupported()))
{
++numCamrasWithTimerQuerySupport;
}