[vtkusers] vtkRenderWindow, vtkRenderers and OpenGL contexts.

Luke Dodd luke.dodd at gmail.com
Mon Oct 24 07:39:10 EDT 2011


Hi,

I'm essentially writing my own vtkRenderWindow in order to fix some
issues I've been having with the Java wrappers.

I'm currently using vtkGenericOpenGLRenderWindow as a base for
creating a new RenderWindow. Sometimes my OpenGl context has to be
removed, and replaced with a new one (or just removed). I suppose I'll
need to inform the vtkRenderer's of this, so they can clean up native
resources and so that they don't do anything which assumes the OpenGL
context is the same. I've had problems with this kind of thing and the
Java vtkPanel, so I want to check I'm doing this correctly.

Is it enough to call vtkGenericOpenGLRenderWindow::Finalize() prior to
the context being removed? This method, for each renderer associated
with the window, sets it's render window to NULL, and then back to
this (which is what vtkXOpenGLRenderWindow does too). After doing
this, would it be OK for the render window to set up a new context and
render again, with the same renderer?

Thanks for any help. If I can get this to work I'll hopefully have a
proper swing compatible vtkPanel to put up on github!

Best Regards,
Luke Dodd



More information about the vtkusers mailing list