osg::Program's compileGLObjects and apply methods fixed for OSG without OSG_GL_FIXED_FUNCTION_AVAILABLE

This commit is contained in:
Konstantin S. Matveyev 2018-04-02 23:56:36 +03:00 committed by Robert Osfield
parent b920d482c7
commit 6cd00edd6c

View File

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