Added scene handler init to custom realize callback

This commit is contained in:
Robert Osfield 2006-07-19 12:58:45 +00:00
parent f67d10ba0c
commit 4bb4add9b3

View File

@ -737,26 +737,30 @@ class TestSupportCallback : public osgProducer::OsgCameraGroup::RealizeCallback
virtual void operator()( osgProducer::OsgCameraGroup&, osgProducer::OsgSceneHandler& sh, const Producer::RenderSurface& ) virtual void operator()( osgProducer::OsgCameraGroup&, osgProducer::OsgSceneHandler& sh, const Producer::RenderSurface& )
{ {
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
unsigned int contextID = sh.getSceneView()->getState()->getContextID();
osg::GL2Extensions* gl2ext = osg::GL2Extensions::Get(contextID,true);
if( gl2ext )
{ {
if( !gl2ext->isGlslSupported() ) OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
{
_supported = false;
_errorMessage = "ERROR: GLSL not supported by OpenGL driver.";
}
GLint numVertexTexUnits = 0; unsigned int contextID = sh.getSceneView()->getState()->getContextID();
glGetIntegerv( GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &numVertexTexUnits ); osg::GL2Extensions* gl2ext = osg::GL2Extensions::Get(contextID,true);
if( numVertexTexUnits <= 0 ) if( gl2ext )
{ {
_supported = false; if( !gl2ext->isGlslSupported() )
_errorMessage = "ERROR: vertex texturing not supported by OpenGL driver."; {
_supported = false;
_errorMessage = "ERROR: GLSL not supported by OpenGL driver.";
}
GLint numVertexTexUnits = 0;
glGetIntegerv( GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &numVertexTexUnits );
if( numVertexTexUnits <= 0 )
{
_supported = false;
_errorMessage = "ERROR: vertex texturing not supported by OpenGL driver.";
}
} }
} }
sh.init();
} }
OpenThreads::Mutex _mutex; OpenThreads::Mutex _mutex;