Skip to content
Snippets Groups Projects
Commit 2040ca5c authored by Thomas Galland's avatar Thomas Galland
Browse files

Sanitize some OpenGL rendering classes

parent 52db68e9
No related merge requests found
......@@ -324,6 +324,12 @@ void vtkOpenGLFXAAFilter::ApplyFilter()
}
vtkShaderProgram* program = this->QHelper->Program;
if (!program)
{
vtkWarningMacro(
"Unable to retrieve shader program from internal vtkOpenGLQuadHelper instance.");
return;
}
program->SetUniformi("Input", this->Input->GetTextureUnit());
float invTexSize[2] = { 1.f / static_cast<float>(this->Viewport[2]),
1.f / static_cast<float>(this->Viewport[3]) };
......
......@@ -96,6 +96,10 @@ void vtkOpenGLQuadHelper::ReleaseGraphicsResources(vtkWindow*)
{
this->VAO->ReleaseGraphicsResources();
}
// Owner is shader cache. When the render window releases it's graphic ressources,
// OpenGL state is deleted, so the cache is deleted as well.
this->Program = nullptr;
}
//------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment