<div dir="ltr">Another way to do the same is this:<div><br><div><a href="https://gitlab.kitware.com/vtk/vtk/blob/master/GUISupport/Qt/Testing/Cxx/TestQVTKOpenGLWidget.cxx#L32-33">https://gitlab.kitware.com/vtk/vtk/blob/master/GUISupport/Qt/Testing/Cxx/TestQVTKOpenGLWidget.cxx#L32-33</a><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 16, 2017 at 11:50 AM, Róbert Špir <span dir="ltr"><<a href="mailto:spir.robert@gmail.com" target="_blank">spir.robert@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Elvis,<br>
I also tried porting from QVTKWidget to QVTKOpenGLWidget and I had to change<br>
the surfaceformat part to this:<br>
<br>
QSurfaceFormat surfaceFormat = QVTKOpenGLWidget::<wbr>defaultFormat();<br>
surfaceFormat.setSamples(0);<br>
QSurfaceFormat::<wbr>setDefaultFormat(<wbr>surfaceFormat);<br>
<br>
Otherwise I had black window.<br>
<br>
Robert<br>
<div class="HOEnZb"><div class="h5"><br>
-----Original Message-----<br>
From: vtk-developers [mailto:<a href="mailto:vtk-developers-bounces@vtk.org">vtk-developers-<wbr>bounces@vtk.org</a>] On Behalf Of<br>
Elvis Stansvik<br>
Sent: Tuesday, May 16, 2017 5:29 PM<br>
To: vtkdev <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
Subject: [vtk-developers] glCopyTexImage2D errors + black windows when<br>
porting QVTKWidget -> QVTKOpenGLWidget<br>
<br>
Today I tried porting our application from QVTKWidget to the new<br>
QVTKOpenGLWidget available in VTK master. The application works fine when<br>
running with the old QVTKWidget, but after porting to QVTKOpenGLWidget I get<br>
lots of:<br>
<br>
ERROR: In<br>
/buildbot/vtk8-builder/build/<wbr>Rendering/OpenGL2/<wbr>vtkTextureObject.cxx,<br>
line 2153<br>
vtkTextureObject (0x275acb0): failed at glCopyTexImage2D 6402 1 OpenGL<br>
errors detected<br>
0 : (1282) Invalid operation<br>
<br>
and all our render windows appear black.<br>
<br>
I followed the advice in the QVTKOpenGLWidget and use<br>
<br>
   QSurfaceFormat::<wbr>setDefaultFormat(<wbr>QVTKOpenGLWidget::<wbr>defaultFormat());<br>
<br>
before constructing the QApplication, to set the correct surface format.<br>
<br>
Does this ring a bell to anyone?<br>
<br>
This is with:<br>
<br>
  Ubuntu 16.04<br>
  Intel HD Graphics 4400<br>
  VTK master @ 97e306e4cdaab9b7b0b25d73da61e2<wbr>20391156b4<br>
<br>
Thanks in advance for any advice. We need to port to QVTKOpenGLWidget as<br>
soon as possible, to get proper support on retina screens.<br>
<br>
Cheers,<br>
Elvis<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<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<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>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
</div></div></blockquote></div><br></div>