Moved old GL2Extensions::Get(..) usage across to new osg::State::get<GL2Extensions>() usage
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14567 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
66da1328f8
commit
6569f69de1
@ -34,8 +34,8 @@ VertexAttribDivisor::~VertexAttribDivisor()
|
|||||||
|
|
||||||
void VertexAttribDivisor::apply(State& state) const
|
void VertexAttribDivisor::apply(State& state) const
|
||||||
{
|
{
|
||||||
const GL2Extensions* extensions = GL2Extensions::Get(state.getContextID(), true);
|
const GL2Extensions* extensions = state.get<GL2Extensions>();
|
||||||
if (extensions)
|
if (extensions->glVertexAttribDivisor)
|
||||||
{
|
{
|
||||||
extensions->glVertexAttribDivisor( _index, _divisor );
|
extensions->glVertexAttribDivisor( _index, _divisor );
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,10 @@ void GLObjectsVisitor::apply(osg::Node& node)
|
|||||||
bool programSetAfter = _renderInfo.getState()->getLastAppliedProgramObject()!=0;
|
bool programSetAfter = _renderInfo.getState()->getLastAppliedProgramObject()!=0;
|
||||||
if (programSetBefore && !programSetAfter)
|
if (programSetBefore && !programSetAfter)
|
||||||
{
|
{
|
||||||
osg::GL2Extensions* extensions = osg::GL2Extensions::Get(_renderInfo.getState()->getContextID(), true);
|
osg::State* state = _renderInfo.getState();
|
||||||
|
osg::GL2Extensions* extensions = state->get<osg::GL2Extensions>();
|
||||||
extensions->glUseProgram(0);
|
extensions->glUseProgram(0);
|
||||||
_renderInfo.getState()->setLastAppliedProgramObject(0);
|
state->setLastAppliedProgramObject(0);
|
||||||
_lastCompiledProgram = 0;
|
_lastCompiledProgram = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,9 +67,10 @@ void GLObjectsVisitor::apply(osg::Geode& node)
|
|||||||
bool programSetAfter = _lastCompiledProgram.valid();
|
bool programSetAfter = _lastCompiledProgram.valid();
|
||||||
if (!programSetBefore && programSetAfter)
|
if (!programSetBefore && programSetAfter)
|
||||||
{
|
{
|
||||||
osg::GL2Extensions* extensions = osg::GL2Extensions::Get(_renderInfo.getState()->getContextID(), true);
|
osg::State* state = _renderInfo.getState();
|
||||||
|
osg::GL2Extensions* extensions = state->get<osg::GL2Extensions>();
|
||||||
extensions->glUseProgram(0);
|
extensions->glUseProgram(0);
|
||||||
_renderInfo.getState()->setLastAppliedProgramObject(0);
|
state->setLastAppliedProgramObject(0);
|
||||||
_lastCompiledProgram = 0;
|
_lastCompiledProgram = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,9 +154,10 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(_renderInfo.getState()->getLastAppliedProgramObject()){
|
else if(_renderInfo.getState()->getLastAppliedProgramObject())
|
||||||
|
{
|
||||||
osg::GL2Extensions* extensions = osg::GL2Extensions::Get(_renderInfo.getState()->getContextID(), true);
|
osg::State* state = _renderInfo.getState();
|
||||||
|
osg::GL2Extensions* extensions = state->get<osg::GL2Extensions>();
|
||||||
extensions->glUseProgram(0);
|
extensions->glUseProgram(0);
|
||||||
_renderInfo.getState()->setLastAppliedProgramObject(0);
|
_renderInfo.getState()->setLastAppliedProgramObject(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user