[vtkusers] QT VTK OpenGL errors

Mike Withascarf mikewithascarf at yahoo.com
Tue Nov 1 18:15:04 EDT 2016


I'm using QT with VTK for a fairly complex application. Everything works fine
normally, but if I try to use a function to 'clear' the QVTKWidget, and then
add a new pipeline, I run into lots of OpenGL errors. What would be the
appropriate way to clear the window/renderer? Here is the code I've been
trying, where window is of type QVTKWidget:

vtkSmartPointer<vtkRenderer> ren_old =
window->GetRenderWindow()->GetRenderers()->GetFirstRenderer();
if (ren_old) ren_old->RemoveAllViewProps(); // Remove the pipeline from
renderer
if (window->isVisible() && window->GetRenderWindow()->IsDrawable())
window->GetRenderWindow()->Render(); // Update the window so it is blank
if (ren_old) window->GetRenderWindow()->RemoveRenderer(ren_old); // Remove
the renderer



I'm using multiple QVTKWidgets in one app, and each might have a pipeline
that connects either with vtkImageViewer2 or a normal vtkRenderer. Here are
the OpenGL errors reported in the vtkOutputWindow:

ERROR: In C:\vtk\src\Rendering\OpenGL2\vtkTextureObject.cxx, line 540
vtkTextureObject (0000029AC7337C70): failed at glBindTexture 1 OpenGL errors
detected
  0 : (1282) Invalid operation


ERROR: In C:\vtk\src\Rendering\OpenGL2\vtkTextureObject.cxx, line 554
vtkTextureObject (0000029AC7337C70): failed at glBindTexture(0) 1 OpenGL
errors detected
  0 : (1282) Invalid operation


ERROR: In C:\vtk\src\Rendering\OpenGL2\vtkTextureObject.cxx, line 540
vtkTextureObject (0000029AC7337C70): failed at glBindTexture 1 OpenGL errors
detected
  0 : (1282) Invalid operation


ERROR: In C:\vtk\src\Rendering\OpenGL2\vtkTextureObject.cxx, line 554
vtkTextureObject (0000029AC7337C70): failed at glBindTexture(0) 1 OpenGL
errors detected
  0 : (1282) Invalid operation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161101/1ad98e56/attachment.html>


More information about the vtkusers mailing list