Commit f089989f authored by Ken Martin's avatar Ken Martin

fix an issue with release graphics resources

If someone released graphics resources it sets the callback to
an empty Window but leaves the Context Set. If they then set the
the context back to the same context is was not setting the
new WindowId on the texture. Arguably Releasing graphcis resources
should set the Context to NULL but I am going with this fix as it
more closely matches the old behavior of leaving Context set.
parent 54b4469c
Pipeline #27360 passed with stage
......@@ -366,13 +366,15 @@ bool vtkTextureObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
//----------------------------------------------------------------------------
void vtkTextureObject::SetContext(vtkOpenGLRenderWindow* renWin)
{
this->ResourceCallback->RegisterGraphicsResources(renWin);
// avoid pointless reassignment
if (this->Context == renWin)
{
return;
}
this->ResourceCallback->RegisterGraphicsResources(renWin);
this->ResetFormatAndType();
this->Context = NULL;
this->Modified();
......@@ -428,6 +430,8 @@ void vtkTextureObject::CreateTexture()
{
assert(this->Context);
this->ResourceCallback->RegisterGraphicsResources(this->Context);
// reuse the existing handle if we have one
if (!this->Handle)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment