Merge pull request #516 from eligovision/OpenSceneGraph-3.6_program

osg::Program's compileGLObjects and apply methods fixed for OSG witho…
This commit is contained in:
OpenSceneGraph git repository 2018-04-03 12:10:29 +01:00 committed by GitHub
commit d0f891ca31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,7 @@ int Program::compare(const osg::StateAttribute& sa) const
void Program::compileGLObjects( osg::State& state ) const
{
if( isFixedFunction() ) return;
if( _shaderList.empty() ) return;
for( unsigned int i=0; i < _shaderList.size(); ++i )
{
@ -416,7 +416,7 @@ void Program::apply( osg::State& state ) const
const GLExtensions* extensions = state.get<GLExtensions>();
if( ! extensions->isGlslSupported ) return;
if( isFixedFunction() )
if( _shaderList.empty() )
{
extensions->glUseProgram( 0 );
state.setLastAppliedProgramObject(0);