Commit a8e138af authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'fix_texture_resource_issue'

f089989f fix an issue with release graphics resources
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1993
parents bace0bcf f089989f
...@@ -366,13 +366,15 @@ bool vtkTextureObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin) ...@@ -366,13 +366,15 @@ bool vtkTextureObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkTextureObject::SetContext(vtkOpenGLRenderWindow* renWin) void vtkTextureObject::SetContext(vtkOpenGLRenderWindow* renWin)
{ {
this->ResourceCallback->RegisterGraphicsResources(renWin);
// avoid pointless reassignment // avoid pointless reassignment
if (this->Context == renWin) if (this->Context == renWin)
{ {
return; return;
} }
this->ResourceCallback->RegisterGraphicsResources(renWin); this->ResetFormatAndType();
this->Context = NULL; this->Context = NULL;
this->Modified(); this->Modified();
...@@ -428,6 +430,8 @@ void vtkTextureObject::CreateTexture() ...@@ -428,6 +430,8 @@ void vtkTextureObject::CreateTexture()
{ {
assert(this->Context); assert(this->Context);
this->ResourceCallback->RegisterGraphicsResources(this->Context);
// reuse the existing handle if we have one // reuse the existing handle if we have one
if (!this->Handle) 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