<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Clint,</div><div> I was just checking on OpenGL contexts. The QGLContext class can take a paint device as a parameter, as described here: <a href="http://www.mathematik.uni-ulm.de/help/qt-2.3.1/qglcontext.html">Qt Toolkit - QGLContext Class</a></div><div><br></div><div>You could also set up overlay and underlay planes in OpenGL. </div><div><br></div><div>If Mac OS X implementation of OpenGL supports overlay and underlay planes, we could get the VTK scene to draw into the underlay plan and the Qt scene to draw into the overlay plane. This would fit in nicely with the Trolltech suggestions to use drawBackground(). Since we are not going to use Qt for generating an OpenGL scene, we don't have to do any OpenGL stuff in drawBackground(). </div><div><br></div><div>So, in order of trying this out, </div><div>a. somehow get VTK to render onto the QVTKWidget, that is now subclassed from QGLWidget, using single buffering like you suggested</div><div>b. get the Qt scene with the widgets to render onto the OpenGL overlay plane. get the VTK scene to render onto the OpenGL underlay plane. </div><div><br></div><div>Perhaps a way out would be to create two separate OpenGL rendering contexts, one targeting the OpenGL overlay plane and the other targeting the OpenGL underlay plane. This will help composite the OpenGL scene, perhaps without resorting to a pixel merge? </div><div><br></div><div>I'm just guessing here and the above assumptions need to be validated.</div><div><br></div><div>Best regards,</div><div><br></div><div>Elvis Dowson</div><div><br></div><div><div>On Oct 16, 2008, at 11:46 PM, Clinton Stimpson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>What you should try to do is get QGLWidget and VTK to share the same context, so that you don't have to do any merging of any sort. I don't know how to do that, or know if that is possible with the APIs you're given. As a first step to attempt that, I suggest turning double buffering off in both QGLWidget and vtkRenderWindow.<br><br>Clint<br></div></blockquote></div><br></body></html>