[vtkusers] glDrawPixels is really slow on windows...

Steve M. Robbins steve at sumost.ca
Wed May 30 13:13:50 EDT 2007


Hi Anja,

I'm afraid I don't have an answer for you, just some questions ;-)


On Wed, May 30, 2007 at 04:57:44PM +0100, Anja Ende wrote:

> I moved my application from Linux to windows. It uses VTK and the Qt
> libraries. I had a base VTK window and was using Qt drawing routines to draw
> things on top of the VTK window.
> 
> I was using the vtkRenderWindow SetRGBACharPixelData method to blend the QT
> and vtk image data and than display it on the screen. This worked great
> under Linux.

I'd like to understand what you did, because I did some experimenting
a year ago with combining VTK rendering with Java/Swing-based drawing
and the results were not great.  

My first approach was to use VTK to draw an image in the window, and
then use Swing to write text (e.g. patient demographics) overtop.  The
trouble is that VTK/OpenGL renders the image to the window, then
triggers a Swing "repaint", which will put the text over the window
contents.  There's a brief instant between the VTK render and the
Swing render where there is an image without text, so you see a very
pronounced flicker.

My second approach -- which works fine -- is to have VTK render into
an offscreen buffer that is passed along to Swing for painting on the
screen.  In this case Swing takes the image, puts text overtop and
paints onto the screen in one go so there is no flicker.

Are you doing something like the first case or the second?  If the
first case, how do you manage to avoid a flicker?


Thanks,
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070530/904b01f5/attachment.pgp>


More information about the vtkusers mailing list