[vtk-developers] patch for bug in vtkOpenGLTexture.cxx

Charl P. Botha c.p.botha at its.tudelft.nl
Thu Apr 26 14:10:14 EDT 2001


VTK developer folks,

At the risk of being very irritating, I'm sending this here as well, as I
haven't been able to elicit any response from any of the pertinent parties.
Nevermind the "BTW" shared rendering context bit, I'm only worried about the
OpenGL texturing bug.  Is there anyone that can have a look at this?

Thanks,
Charl

----- Forwarded message from "Charl P. Botha" <c.p.botha at its.tudelft.nl> -----

Date: Fri, 20 Apr 2001 11:57:29 +0200
From: "Charl P. Botha" <c.p.botha at its.tudelft.nl>
To: vtkusers at public.kitware.com
Subject: patch for bug in vtkOpenGLTexture.cxx
Reply-To: "Charl P. Botha" <c.p.botha at its.tudelft.nl>
User-Agent: Mutt/1.2.5i

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/

--- 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


----- End forwarded message -----

-- 
charl p. botha      | computer graphics and cad/cam 
http://cpbotha.net/ | http://www.cg.its.tudelft.nl/





More information about the vtk-developers mailing list