- Timestamp:
- 07/19/06 14:58:45 (7 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshaderterrain/osgshaderterrain.cpp
r5249 r5339 738 738 virtual void operator()( osgProducer::OsgCameraGroup&, osgProducer::OsgSceneHandler& sh, const Producer::RenderSurface& ) 739 739 { 740 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);741 742 unsigned int contextID = sh.getSceneView()->getState()->getContextID();743 osg::GL2Extensions* gl2ext = osg::GL2Extensions::Get(contextID,true);744 if( gl2ext )745 740 { 746 if( !gl2ext->isGlslSupported() ) 741 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 742 743 unsigned int contextID = sh.getSceneView()->getState()->getContextID(); 744 osg::GL2Extensions* gl2ext = osg::GL2Extensions::Get(contextID,true); 745 if( gl2ext ) 747 746 { 748 _supported = false; 749 _errorMessage = "ERROR: GLSL not supported by OpenGL driver."; 750 } 751 752 GLint numVertexTexUnits = 0; 753 glGetIntegerv( GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &numVertexTexUnits ); 754 if( numVertexTexUnits <= 0 ) 755 { 756 _supported = false; 757 _errorMessage = "ERROR: vertex texturing not supported by OpenGL driver."; 747 if( !gl2ext->isGlslSupported() ) 748 { 749 _supported = false; 750 _errorMessage = "ERROR: GLSL not supported by OpenGL driver."; 751 } 752 753 GLint numVertexTexUnits = 0; 754 glGetIntegerv( GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &numVertexTexUnits ); 755 if( numVertexTexUnits <= 0 ) 756 { 757 _supported = false; 758 _errorMessage = "ERROR: vertex texturing not supported by OpenGL driver."; 759 } 758 760 } 759 761 } 762 763 sh.init(); 760 764 } 761 765
