mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Guard use of empty OpenGL context
This commit is contained in:
parent
f6fa93bb66
commit
83443ae2ff
@ -179,12 +179,15 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
|
||||
if ( m_rimReservoirView->viewer() )
|
||||
{
|
||||
cvf::ref<cvf::OpenGLContext> oglContext = m_rimReservoirView->viewer()->cvfOpenGLContext();
|
||||
if ( oglContext.notNull() )
|
||||
{
|
||||
cvf::OpenGLResourceManager* resourceManager = oglContext->resourceManager();
|
||||
cvf::ref<cvf::ShaderProgram> vectorProgram = resourceManager->getLinkedVectorDrawerShaderProgram( oglContext.p() );
|
||||
|
||||
eff->setShaderProgram( vectorProgram.p() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part->setEffect( eff.p() );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user