Check for presence of occlusion query extension

This commit is contained in:
scrawl
2015-12-06 14:08:49 +01:00
parent c7f32e11f2
commit 9aba89c88d

View File

@@ -243,7 +243,7 @@ public:
virtual void deleteGLObject(GLuint globj)
{
const GLExtensions* extensions = GLExtensions::Get(_contextID,true);
if (extensions->isGlslSupported) extensions->glDeleteQueries( 1L, &globj );
if (extensions->isOcclusionQuerySupported || extensions->isARBOcclusionQuerySupported) extensions->glDeleteQueries( 1L, &globj );
}
};
@@ -285,6 +285,10 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const
{
unsigned int contextID = renderInfo.getState()->getContextID();
osg::GLExtensions* ext = renderInfo.getState()->get<GLExtensions>();
if (!ext->isARBOcclusionQuerySupported && !ext->isOcclusionQuerySupported)
return;
osg::Camera* cam = renderInfo.getCurrentCamera();
// Add callbacks if necessary.