[vtkusers] patch for bug in vtkOpenGLTexture.cxx

Charl P. Botha c.p.botha at its.tudelft.nl
Fri Apr 20 05:57:29 EDT 2001


VTKers,

I was sharing vtkTextures between different vtkRenderWindows and this was
proving problematic (VTK was destroying the wrong texture IDs).  I have
attached a patch that fixes this bug.  Could someone with CVS access and an
understanding of the OpenGL layer please check this and integrate if valid?

BTW, are there any plans to support shared rendering contexts (see shareList
parameter in glXCreateContext man page) so that large textures that have
already been downloaded to graphics hardware can be shared between rendering
contexts?  ATM, vtk doesn't allow this, so the same textures are
re-downloaded, wasting some time and texture memory.

Thanks,

-- 
charl p. botha      | computer graphics and cad/cam 
http://cpbotha.net/ | http://www.cg.its.tudelft.nl/
-------------- next part --------------
--- vtkOpenGLTexture.cxx.old	Fri Apr 20 11:52:07 2001
+++ vtkOpenGLTexture.cxx	Fri Apr 20 11:47:52 2001
@@ -241,9 +241,12 @@
         }
       }
 
-    // free any old display lists
-    this->ReleaseGraphicsResources(ren->GetRenderWindow());
+    // free any old display lists (from the old context)
+    if (this->RenderWindow)
+	  this->ReleaseGraphicsResources(this->RenderWindow);
     this->RenderWindow = ren->GetRenderWindow();
+    // make the new context current before we mess with opengl
+    this->RenderWindow->MakeCurrent();
 
     // define a display list for this texture
     // get a unique display list id


More information about the vtkusers mailing list