<div dir="ltr">This looks like an OpenGL resource sharing issue. I don't know exactly how VTK handles multiples windows in a Qt application but it looks like it is trying to bind a texture that is not registered in a certain context.<div><br></div><div>Can tell if this happens when you have a single window or this happens only when you add a second window?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 1, 2016 at 8:15 PM, Mike Withascarf via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8836" dir="ltr"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8988">I'm using QT with VTK for a fairly complex application. Everything works fine</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8989"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8990">normally, but if I try to use a function to 'clear' the QVTKWidget, and then</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8991"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8992">add a new pipeline, I run into lots of OpenGL errors. What would be the</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8993"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8994">appropriate way to clear the window/renderer? Here is the code I've been</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8995"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8996">trying, where window is of type QVTKWidget:</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8997"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8998"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_8999">vtkSmartPointer<vtkRenderer> ren_old =</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9000"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9001">window->GetRenderWindow()-><wbr>GetRenderers()-><wbr>GetFirstRenderer();</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9002"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9003">if (ren_old) ren_old->RemoveAllViewProps(); // Remove the pipeline from</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9004"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9005">renderer</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9006"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9007">if (window->isVisible() && window->GetRenderWindow()-><wbr>IsDrawable())</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9008"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9009">window->GetRenderWindow()-><wbr>Render(); // Update the window so it is blank</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9010"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9011">if (ren_old) window->GetRenderWindow()-><wbr>RemoveRenderer(ren_old); // Remove</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9012"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9013">the renderer</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9014"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9015"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9016"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9017"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9018">I'm using multiple QVTKWidgets in one app, and each might have a pipeline</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9019"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9020">that connects either with vtkImageViewer2 or a normal vtkRenderer. Here are</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9021"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9022">the OpenGL errors reported in the vtkOutputWindow:</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9023"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9024"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9025">ERROR: In C:\vtk\src\Rendering\OpenGL2\<wbr>vtkTextureObject.cxx, line 540</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9026"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9027">vtkTextureObject (0000029AC7337C70): failed at glBindTexture 1 OpenGL errors</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9028"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9029">detected</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9030"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9031">  0 : (1282) Invalid operation</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9032"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9033"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9034"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9035">ERROR: In C:\vtk\src\Rendering\OpenGL2\<wbr>vtkTextureObject.cxx, line 554</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9036"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9037">vtkTextureObject (0000029AC7337C70): failed at glBindTexture(0) 1 OpenGL</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9038"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9039">errors detected</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9040"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9041">  0 : (1282) Invalid operation</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9042"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9043"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9044"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9045">ERROR: In C:\vtk\src\Rendering\OpenGL2\<wbr>vtkTextureObject.cxx, line 540</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9046"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9047">vtkTextureObject (0000029AC7337C70): failed at glBindTexture 1 OpenGL errors</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9048"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9049">detected</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9050"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9051">  0 : (1282) Invalid operation</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9052"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9053"><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9054"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9055">ERROR: In C:\vtk\src\Rendering\OpenGL2\<wbr>vtkTextureObject.cxx, line 554</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9056"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9057">vtkTextureObject (0000029AC7337C70): failed at glBindTexture(0) 1 OpenGL</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9058"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9059">errors detected</span><br style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9060"><span style="font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:13px" id="m_-4913760649112231020yui_3_16_0_ym19_1_1478038332580_9061">  0 : (1282) Invalid operation</span><br></div></div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Thales Luis Rodrigues Sabino</div><div><br></div><div>PhD Student at <a href="http://www.ufjf.br/pgmc/" target="_blank">PGMC-UFJF</a></div><div><a href="http://lattes.cnpq.br/0601030410417146" target="_blank">Lattes</a> | <a href="https://br.linkedin.com/in/tluisrs" target="_blank">LinkedIn</a> | <a href="https://www.researchgate.net/profile/Thales_Luis_Sabino" target="_blank">ResearchGate</a></div></div></div></div></div>
</div>